Skip to content

Drain in-flight workflows on MCP stdin EOF; close C2c2e (E6) - #272

Merged
shoedog merged 1 commit into
mainfrom
feat/mcp-drain-closure-c2c2e6
Nov 2, 2026
Merged

shoedog merged 1 commit into
mainfrom
feat/mcp-drain-closure-c2c2e6

Conversation

@shoedog

@shoedog shoedog commented Nov 2, 2026

Copy link
Copy Markdown
Owner

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 mcp stops accepting requests and lets in-flight detached workflows finish within a bounded grace ([server] mcp_eof_grace_secs, default 900 s; 0 keeps 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 unless permission_timeout_ms bounds 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

  • Implementer (Claude Code Sonnet 5.5): round 1 workspace green, drain tests RED on base. Round 2 (signal path, config helper, docs) could not build in the container sandbox (no registry access), so it was verified on the host.
  • Host: fmt; clippy (a2a-bridge, bridge-coordinator, bridge-mcp, -D warnings) clean; fallback_workflow 172/172; bridge-coordinator + bridge-mcp 318/318; config grace tests 3/3; uncapped_order_and_wire_control byte-identical to base. Mutation check: disabling the signal arm makes mcp_signal_during_eof_grace_shuts_down_cleanly fail (boundary timeout); restored.
  • Review: gpt-6.1-sol + Opus 5.5 (Opus synth) APPROVE round 1, no WRONG findings; round 2 addressed its material SMELLs (signal during grace, docs, config wiring test).

Deferred (SMELL, immaterial)

  • The resubscribe test infers attachment from a short sleep rather than a subscriber-count/snapshot signal.
  • No new assertions at the plan's originally named line anchors; closure rests on the existing absent-chain and golden tests.

🤖 Generated with Claude Code

https://claude.ai/code/session_017izEynabPeSUBT573AtvaZ

…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
@shoedog
shoedog merged commit 2d6300a into main Nov 2, 2026
6 checks passed
@shoedog
shoedog deleted the feat/mcp-drain-closure-c2c2e6 branch November 2, 2026 03:09
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant