Repository navigation
Conversation
…h runs Fixes adcp-client#1585. In batch storyboard runs all scenarios share a single AgentClient instance. When a prior scenario ends with a working-state A2A response the client retains pendingTaskId; if the poll path (waitForCompletion) bypasses absorbServerSideMetadata that taskId is never cleared and bleeds into the next scenario's message/send call. Sellers that have evicted the completed task (A2A 0.3.x defines no minimum retention TTL) return "Task <uuid> not found", causing the scenario to fail. Two fixes: • callA2AToolImpl (a2a.ts): retry once without the stale taskId when "Task not found" is returned while session.taskId is set. • pollTaskCompletion (TaskExecutor.ts): catch "Task not found" from explicit polls and return a descriptive failed TaskResult instead of an uncaught exception. https://claude.ai/code/session_01NXzCFi3jJDNqXaDgQrPzKK
This was referenced May 8, 2026
Contributor
Author
|
Closing in favor of:
The two pieces from this PR that were not extracted:
|
Contributor
Author
|
Acknowledged — thanks for the clear decomposition rationale. The three-way split (#1588 + #1593 + #1596) is a cleaner outcome: runner-level reset, SDK-level narrowing, and the surviving Generated by Claude Code |
bokelley
added a commit
that referenced
this pull request
May 8, 2026
…evicted task Catch "Task <id> not found" errors from getTaskStatus in pollTaskCompletion and return a TaskResultFailure with an actionable error message instead of letting an opaque exception escape the loop. A2A 0.3.x defines no minimum retention TTL for completed tasks, so a seller may evict a task between the buyer observing the working-state response and the first explicit tasks/get poll firing. The error now suggests using push notifications (reporting_webhook) or configuring a longer task retention TTL on the seller. Defense-in-depth follow-up to #1585. The cross-storyboard root cause was already addressed in #1588 (resetContext per storyboard) and #1593 (narrowed pendingTaskId auto-thread to same-skill same-context); this change improves the error surface for any residual case where an evicted task is queried. The not-found regex is bounded (\S{1,128}) to satisfy the CodeQL polynomial-regex check on uncontrolled error strings. Closes/supersedes #1592 (which proposed this same descriptive-error fix bundled with two other changes that #1588 and #1593 obviated). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
bokelley
added a commit
that referenced
this pull request
May 8, 2026
…evicted task (#1596) Catch "Task <id> not found" errors from getTaskStatus in pollTaskCompletion and return a TaskResultFailure with an actionable error message instead of letting an opaque exception escape the loop. A2A 0.3.x defines no minimum retention TTL for completed tasks, so a seller may evict a task between the buyer observing the working-state response and the first explicit tasks/get poll firing. The error now suggests using push notifications (reporting_webhook) or configuring a longer task retention TTL on the seller. Defense-in-depth follow-up to #1585. The cross-storyboard root cause was already addressed in #1588 (resetContext per storyboard) and #1593 (narrowed pendingTaskId auto-thread to same-skill same-context); this change improves the error surface for any residual case where an evicted task is queried. The not-found regex is bounded (\S{1,128}) to satisfy the CodeQL polynomial-regex check on uncontrolled error strings. Closes/supersedes #1592 (which proposed this same descriptive-error fix bundled with two other changes that #1588 and #1593 obviated). Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
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 #1585
In batch storyboard runs, all scenarios share a single
AgentClientinstance (viagetOrCreateClientcaching). When a prior scenario ends with an A2A working-state response,AgentClient.retainSessionsetspendingTaskId. The storyboard poll path (waitForCompletionintask-map.ts) bypassesretainSession, so that task ID is never cleared. The next scenario inherits it; A2A 0.3.x defines no minimum retention TTL for completed tasks, so a seller that has evicted the completed task responds with "Task <uuid> not found" and the scenario fails.Three fixes (root cause + two defense-in-depth):
Root cause —
AgentClient.clearPendingTask()(@internal) +task-map.tsfinallyblock. AfterwaitForCompletionresolves (or throws / times out),clearPendingTask()is called so the stalependingTaskIdis gone before the next scenario starts.Defense-in-depth —
callA2AToolImpl(a2a.ts): whensession.taskIdis set and the seller returns "Task not found", retry once without the task ID. The guard is self-limiting: the recursive call passestaskId: undefined, so the guard cannot fire again.Defense-in-depth —
pollTaskCompletion(TaskExecutor.ts): catch "Task not found" fromgetTaskStatusand return a descriptivefailedTaskResultwith an actionable error message rather than an opaque uncaught exception.What-tested
npx tsc --noEmit: 2 pre-existing errors only (@types/nodenot installed,moduleResolution=node10deprecation warning). No new errors introduced. Verified by running before and after changes.npm run ci:quick: pre-existing environment failure (tsx: not found). Confirmed pre-existing by stashing changes and re-running.Pre-PR review
taskId, not the current call's own ID);pollStartTimefix is soundSession: https://claude.ai/code/session_01NXzCFi3jJDNqXaDgQrPzKK
Generated by Claude Code