Skip to content

fix(conformance): thread AbortSignal through complyImpl storyboard loop - #1615

Closed
bokelley wants to merge 3 commits into
mainfrom
claude/issue-1612-comply-signal-threading
Closed

bokelley wants to merge 3 commits into
mainfrom
claude/issue-1612-comply-signal-threading

Conversation

@bokelley

@bokelley bokelley commented May 9, 2026

Copy link
Copy Markdown
Contributor

Closes #1612

comply() builds a combined AbortSignal from timeout_ms and an optional external signal, but only checked it between storyboards — via signal?.throwIfAborted() before each runStoryboard() call. A single storyboard with many sequential MCP or A2A calls could consume the entire timeout budget without the signal firing inside it. This is the binding constraint behind the reported 307s wall-clock on both MCP and A2A transports against healthy agents (benchmark from @bokelley: PR #1613 head is wall-clock-identical to baseline because complyImpl's loop is the bottleneck, not pollTaskCompletion).

Three-part fix:

  1. StoryboardRunOptions.signal?: AbortSignal — new optional field. comply() forwards its combined timeout+external signal automatically; direct runStoryboard() callers can pass their own signal to bound a single storyboard run independently.
  2. complyImpl and runWithDegradedProfile — both now spread signal into the runOptions passed to runStoryboard(). The auth-degraded path had the same gap (signal was checked between storyboards but not forwarded into the runner's options).
  3. executeStoryboardPass — adds options.signal?.throwIfAborted() at the start of each phase loop iteration and each step loop iteration. runMultiPass gains the same check at each pass boundary.

When the signal fires, executeStoryboardPass throws (AbortError) at the next phase/step boundary — the caller receives a rejected promise, not a partial result. This is consistent with complyImpl's existing between-storyboard abort behavior; we're just firing at finer granularity.

Known nit (not in this PR): The abort fires at the scheduler level (between steps), not inside an in-flight MCP/A2A transport call. A single step that hangs for longer than the remaining timeout will still block until the call resolves. Forwarding signal into runStep/executeStep at the transport level is the remaining follow-up.

What tested

Pre-PR review

  • code-reviewer: approved — 1 blocker addressed (JSDoc updated to document throw-on-abort behavior; runWithDegradedProfile gap not flagged here but caught by protocol expert); 1 nit noted (transport-layer signal forwarding, out of scope per issue author guidance)
  • ad-tech-protocol-expert: approved — 1 blocker addressed (runWithDegradedProfile runOptions signal gap closed; same fix pattern as complyImpl); ComplyOptions.timeout_ms JSDoc updated to reflect per-phase/step cancellation; confirmed non-breaking optional field addition on StoryboardRunOptions

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num> →
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_018PoRAJU4sTKWvxz6MYf8L7


Generated by Claude Code

claude added 3 commits May 9, 2026 00:01
…r-phase/step

Resolves the comply() preflight timeout on both MCP and A2A transports
(#1612). The combined AbortSignal was only checked between storyboards;
now it fires at every phase and step boundary inside executeStoryboardPass.

https://claude.ai/code/session_018PoRAJU4sTKWvxz6MYf8L7
…ns JSDoc

Document that a fired signal rejects the runStoryboard promise (no partial
result) — consistent with complyImpl's existing between-storyboard abort.

https://claude.ai/code/session_018PoRAJU4sTKWvxz6MYf8L7
…pdate timeout_ms doc

runWithDegradedProfile had the same signal gap as complyImpl: it checks
signal?.throwIfAborted() between storyboards but didn't pass signal into
the runOptions given to runStoryboard, leaving the per-phase/per-step
checks dead on the auth-degraded path.

Also updates ComplyOptions.timeout_ms JSDoc to document the new
phase/step-boundary cancellation behaviour.

https://claude.ai/code/session_018PoRAJU4sTKWvxz6MYf8L7
@bokelley

Copy link
Copy Markdown
Contributor Author

Superseded by #1646 — most of this PR's work landed via #1612 (signal field on StoryboardRunOptions, complyImpl threading, executeStoryboardPass phase/step throwIfAborted). The only remaining gap was runWithDegradedProfile not forwarding signal into its runOptions; #1646 extracts that as a clean patch on current main. Closing.

@bokelley bokelley closed this May 10, 2026
@bokelley

Copy link
Copy Markdown
Contributor Author

Acknowledged — thanks for the context. Work tracked via #1612 and the remaining gap via #1646.


Generated by Claude Code

bokelley added a commit that referenced this pull request May 10, 2026
…ns (#1646)

complyImpl already threads its combined timeout/external AbortSignal
into the StoryboardRunOptions it hands to runStoryboard(), so
executeStoryboardPass can bail at the next phase/step boundary. The
auth-degraded fallback path (runWithDegradedProfile) checked the signal
between storyboards but never forwarded it into the runner's options —
a single degraded storyboard could still consume the entire timeout
budget without firing mid-storyboard. Closes the gap left by #1612 /
completes #1615.

Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
@github-actions github-actions Bot mentioned this pull request May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

storyboard run: A2A pre-flight comply() ~3x slower than MCP, hits 180s timeout for healthy agents

2 participants