Repository navigation
Drain in-flight workflows on MCP stdin EOF; close C2c2e (E6) - #272
Merged
Merged
Conversation
…ck (E6) `a2a-bridge mcp` no longer cancels detached workflows the moment stdin closes. On clean EOF it stops reading, lets in-flight workflows finish and persist within `[server] mcp_eof_grace_secs` (default 900; 0 keeps the immediate cancel), then cancels whatever is still running exactly as before. `bridge_mcp::serve` keeps its zero-grace behaviour; the CLI uses the new `serve_with_eof_grace`. Fold E5 review items: warn when declared chains have no effect because served admission is not affirmative, document the redundant budget-policy term, and note the current-thread runtime dependence of the refusal projection test. New tests hold candidate B at a dispatch gate for the A2A disconnect, the A2A resubscribe-with-cursor, and the MCP drain / grace-zero / over-deadline cases, and add a negative test for the durability gate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Lane G C2c2e sub-slice E6, the final served-fallback slice: aggregate closure plus the owner's MCP lifecycle decision.
MCP stdin EOF now drains instead of cancelling (owner decision 2026-11-01). On EOF,
a2a-bridge mcpstops accepting requests and lets in-flight detached workflows finish within a bounded grace ([server] mcp_eof_grace_secs, default 900 s;0keeps the previous immediate cancel), persists results, then exits; anything still running at the deadline is cancelled as before. SIGTERM/SIGINT during the grace performs the same clean shutdown EOF used to (cancel Working runs, release warm sessions) — orchestrator ruling: a signal means "stop now". The handler is installed only when the grace starts, so signal behaviour while serving is unchanged. A run blocked on client input after EOF consumes the grace unlesspermission_timeout_msbounds it (documented).E5 review items folded: disconnect and resubscribe tests hold the run in flight; direct negative test for the durability gate;
tracing::warn!when declared chains have no effect; comment on the redundant governed check; note on the refusal-projection test's runtime dependence.Closure: absent chains add no fields, receipts or candidate effects; uncapped wire receipt, CLI fixture and workload golden unchanged.
Verification
a2a-bridge,bridge-coordinator,bridge-mcp,-D warnings) clean;fallback_workflow172/172;bridge-coordinator+bridge-mcp318/318; config grace tests 3/3;uncapped_order_and_wire_controlbyte-identical to base. Mutation check: disabling the signal arm makesmcp_signal_during_eof_grace_shuts_down_cleanlyfail (boundary timeout); restored.Deferred (SMELL, immaterial)
🤖 Generated with Claude Code
https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ