Repository navigation
fix: correct merge-step readiness, close Java parity gaps, and harden the client - #13
Merged
guofei66 merged 3 commits intoOct 12, 2026
Conversation
… the client Scheduling - A merge step could start before its own predecessor had run. Step readiness was computed from direct predecessors and then filtered to activated ones, so a graph whose branches activate at different times let the merge consume a partial input and still report success. Readiness now considers every active ancestor, and the deadlock path reports the missing steps instead of returning a silent result. Protocol and transport, aligned with the Java engine - Recover an interrupted SSE stream by polling the task, bounded by the new task_poll_interval_seconds (default 20s, floor 0.1s). The poll runs only after a stream interruption, never while the stream is alive. - Open a negotiation for a bare Propose message and fail loudly when a negotiation round yields no task, instead of sleeping in a spin. - Bound the notification acknowledgement with the new notification_ack_timeout_seconds (default 300s), so a remote that accepts the stream but never acknowledges can no longer leave the caller waiting forever. - Observe transport activity per body chunk, including an SSE comment heartbeat that never becomes a decoded event, and judge notification liveness from it. A stream receiving only heartbeats was previously reported as dead, and a caller acting on that tore down a live subscription; a genuinely dead stream leaked its connection and task forever. A subscription is now released after send_timeout_seconds without any transport activity, configurable through notification_idle_timeout_seconds. - Report the last business event separately through last_business_event_at, keeping last_event_at as transport activity. Security - Match sensitive header names after stripping '-' and '_', so api_key, x_api_key, access_session, pwd and passwd are redacted like their other spellings; a header registered through register_sensitive_header now matches in any spelling. - Fail closed on TLS material for the registry path, and reject .env keys that are not valid environment-variable names. Correctness and cleanup - Fix the repeated-argument parse patch, cache one A2A client per agent and invalidate the cache when agent cards change, forward task_id in the intermediate status event, bound stream_message by timeout_seconds, accept a custom CA, mTLS identity and CRL for the registry helpers, and make workflow_engine.__version__ the single source of the distribution version. Tests: 120 passing, 72 of them new across test_review_fixes.py, test_p0_alignment.py and test_java_history_parity.py. Signed-off-by: Zhoujie628 <zhoujie628@users.noreply.github.com>
Signed-off-by: Zhoujie628 <zhoujie628@users.noreply.github.com>
Signed-off-by: Zhoujie628 <zhoujie628@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12
Found while auditing this engine against the Java engine (
workflow-engine-sdk-java) and against that engine's commit history.Scheduling correctness
A merge step could start before its own predecessor had run. Step readiness was computed from direct predecessors and then filtered to those already activated, so a graph whose branches activate at different times let the merge consume a partial input and still report success. Readiness now considers every active ancestor, and the deadlock path reports the missing steps instead of returning a silent result.
Protocol and transport, aligned with the Java engine
task_poll_interval_seconds(default 20s, floor 0.1s). The poll runs only after an interruption, never while the stream is alive.notification_ack_timeout_seconds(default 300s), so a remote that accepts the stream but never acknowledges cannot leave the caller waiting forever.send_timeout_secondswithout any transport activity.last_business_event_at, keepinglast_event_atas transport activity.Security
-and_, soapi_key,x_api_key,access_session,pwdandpasswdare redacted like their other spellings. A header registered throughregister_sensitive_headernow matches in any spelling..envkeys that are not valid environment-variable names.Correctness and cleanup
Fix the repeated-argument parse patch, cache one A2A client per agent and invalidate the cache when agent cards change, forward
task_idin the intermediate status event, boundstream_messagebytimeout_seconds, accept a custom CA, mTLS identity and CRL for the registry helpers, and makeworkflow_engine.__version__the single source of the distribution version.Behavior changes to review
Several changes are observable to existing callers:
NotificationHeartbeat.last_event_atnow reports transport activity rather than the last business event, andis_healthy()judges liveness from transport activity.send_timeout_secondswithout transport activity. Hosts that relied on a subscription staying open forever must be updated.stream_messageis bounded bytimeout_seconds, which defaults to the interaction deadline. Long-lived streams need an explicit larger value.Verification
120 tests pass, 72 of them new across
test_review_fixes.py,test_p0_alignment.pyandtest_java_history_parity.py.verify_sdk.pyreports VERIFICATION: PASS.