Add progress updates for inbound A2A work - #64
Merged
Conversation
dimavrem22
force-pushed
the
feat/a2a-worker-progress
branch
6 times, most recently
from
August 15, 2026 08:17
d95f36a to
26dd9b2
Compare
dimavrem22
force-pushed
the
feat/a2a-worker-progress
branch
from
August 15, 2026 08:28
26dd9b2 to
6453142
Compare
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.
Executive Summary
Adds immediate acknowledgement and periodic progress reporting for inbound A2A worker tasks.
Description
The gateway now acknowledges an inbound A2A task before starting its Claude Code turn and owns a referenced progress runner for the lifetime of that worker turn. Progress copy comes from an isolated, tool-free, one-turn Claude session using the task text and at most eight normalized tool identifiers of 80 characters each. Tool arguments and results are never retained or included. Unsafe, terminal, empty, or tool-identifier-echoing model output uses one generic nonterminal fallback.
Acknowledgements and pending progress messages are persisted before delivery and reconciled only against exact worker-role task history. Referenced retries recover failed acknowledgement delivery, and every acknowledgement or terminal reply thread drains before cancellation or shutdown returns. Owner fencing prevents an older turn from stopping a follow-up runner, and persisted due times preserve the original cadence across restarts and follow-ups. Explicit terminal tools and automatic completion durably fence new progress and drain any in-flight send before replying; the same fenced caller message cannot rerun after an ambiguous reply outcome, while a genuine caller follow-up acquires a new runner. Every worker admission, duplicate reconciliation, acknowledgement retry, and recovery pass first verifies the authoritative task, context, active state, and latest caller message. Accepted work persists and runs only authoritative caller parts and metadata. Stale persisted generations are finalized without acknowledgement or model work, then recovery discovers the current submitted or working caller generation. This rejects delayed or spoofed generations even after an in-memory cancellation tombstone is lost on restart. Delayed webhooks for input-required, auth-required, and terminal tasks stop before persistence, progress, or model admission. Cancellation publishes a task-and-message generation tombstone before serializing with webhook admission, resolving the latest authoritative caller message when a cancellation omits its message ID. Current or blocked acknowledgement work cannot later start a model turn; reactivation requires a distinct caller-role message whose task, context, key, and active state all match the authoritative task. Shutdown similarly closes admission before it snapshots background work and returns retryable HTTP 503 responses for raced webhooks. Completion, cancellation, stopped server state, and gateway shutdown safely stop or drain background work. The default interval is 180 seconds through
INKBOX_A2A_PROGRESS_INTERVAL_SECONDS.Reason
Long-running A2A tasks previously appeared idle until their final response. Prompt pickup confirmation and occasional concise updates make active work visible without spending a full requester turn on each progress event.
Decisions
Testing
uv run --with pytest pytest -q --ignore=tests/contract: 543 passed, 23 skipped.uv run --with pytest pytest -q tests/contract: 5 passed against the installed Claude Agent SDK and Claude Code CLI.uv build: source distribution and wheel built successfully, including the progress module.inbound-progressscenario: Expect a one-minute CI-only cadence, two ordered nonterminal summaries with at least one descriptive/non-fallback summary, and final result4 + 6 = 10with the unique marker.