Skip to content

A2A: let callers poll tasks returned by SendMessage - #202

Open
harshsaver wants to merge 5 commits into
mainfrom
feat/189-a2a-gettask
Open

harshsaver wants to merge 5 commits into
mainfrom
feat/189-a2a-gettask

Conversation

@harshsaver

Copy link
Copy Markdown
Member

Implements GetTask on the A2A ingress handler using the existing publication authorization, A2A-Version checks, and a new principal-scoped history read (Store/Runtime A2ATaskHistory) that pairs each correlated Bus request with its agent reply.

Mapping and bounds (documented in docs/architecture/a2a-bridge.md):

  • Bus states map one-to-one onto A2A task states; status timestamp is the task update time.
  • History holds one user message per turn in acceptance order (caller's messageId), each followed by its agent reply (durable Bus response id) when present; single plain-text part each.
  • historyLength limits to the most recent N messages (0 = none, omitted = full); negative rejected. Replies surface in history only; no artifacts, no duplicate status message.

Isolation: unknown and other-principal tasks report task-not-found; revoked credentials and disabled publications stay denied via the same in-transaction fencing as acceptance.

Tests (existing harness, bus package):

  • submit → deliver → reply → poll across submitted/working/completed, plus restart durability
  • historyLength selection incl. 0/oversized/negative
  • state mapping for input-required/failed/canceled/rejected
  • foreign-task indistinguishability, rotation/disable paths, version and param errors

Streaming, task listing, cancellation, push notifications, and new content types stay out of scope.

Fixes #189

harshsaver and others added 3 commits November 12, 2026 17:17
Implement GetTask on the A2A ingress handler using the existing publication authorization, version checks, and a new principal-scoped history read that pairs each correlated Bus request with its agent reply. Unknown and other-principal tasks report task-not-found; revoked credentials and disabled publications stay denied. Documents the state/history mapping and bounds in the A2A guide and shows polling in the client example.
…task lookup

Update spec/0.1 to describe the task read, drop the test-only A2ATask
lookup in favour of A2ATaskHistory, remove unused history timestamps,
and correct the GetTask client example.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@harshsaver harshsaver added the agentbox: ready to merge Audited by Claude and Codex; Harsh can merge label Nov 13, 2026
@harshsaver

Copy link
Copy Markdown
Member Author

🤖 Agentbox PR audit: small fixes applied, then ready to merge

What this PR changes

  • What it does: An outside system that hands work to a published agent can now ask how its task is doing and retrieve the agent's reply.
  • What changes in the product: Nothing visible in the workspace UI. Integrators can use the standard task lookup instead of receiving an unsupported-operation error.
  • Why it exists: Issue A2A: let callers poll tasks returned by SendMessage #189. Callers could submit work and receive a task ID but had no standard way to check progress or read the answer.
  • Why merge (or why not yet): The intended flow is implemented, caller isolation is preserved, and all 11 CI checks pass on this commit. The public specification still denies support for task reads, and the implementation leaves two copies of the lookup behind.
  • What to expect after merging: Callers read replies from conversation history. Clients that only inspect output artifacts will not see the answer. Polling has no separate per-caller rate limit, so tight polling loops deserve monitoring. The new tests exercise SQLite; PostgreSQL execution of this read remains untested.
Full audit (Claude (fable, xhigh) × Codex (gpt-6-astra, xhigh), 2 turns, commit e57da46)

PR audit: #202 — A2A: let callers poll tasks returned by SendMessage

Head: d7e168c

Sign-off

  • Claude (fable, xhigh): ❌ not satisfied — the feature is correct and CI is green, but the versioned spec still says task reads are unsupported and a duplicate lookup path is left behind; both are small fixes we can apply.
  • Codex (gpt-6-astra, xhigh): ✅ satisfied — independently verified the blockers and exact fix plan; no material changes are needed to the audit.

Decision

fix — the polling path works as intended; update the stale public spec and remove the duplicate lookup, with the small documentation and unused-field fixes below.

What changes (plain language)

  • What it does: An outside system that hands work to a published agent can now ask how its task is doing and retrieve the agent's reply.
  • What changes in the product: Nothing visible in the workspace UI. Integrators can use the standard task lookup instead of receiving an unsupported-operation error.
  • Why it exists: Issue A2A: let callers poll tasks returned by SendMessage #189. Callers could submit work and receive a task ID but had no standard way to check progress or read the answer.
  • Why merge (or why not yet): The intended flow is implemented, caller isolation is preserved, and all 11 CI checks pass on this commit. The public specification still denies support for task reads, and the implementation leaves two copies of the lookup behind.
  • What to expect after merging: Callers read replies from conversation history. Clients that only inspect output artifacts will not see the answer. Polling has no separate per-caller rate limit, so tight polling loops deserve monitoring. The new tests exercise SQLite; PostgreSQL execution of this read remains untested.

Findings

Blocking

  1. The versioned spec now contradicts the shipped behaviour.
    • spec/0.1/README.md:208 still lists "task-read" among operations the binding does not accept.
    • spec/0.1/http.md:111 has no route row for the task read; only message:send is listed.
    • spec/0.1/http.md:169 describes SendMessage only and says other A2A operations return protocol errors.
    • Rule: CONTRIBUTING.md:38 ("Protocol behavior belongs in the versioned specification"), CONTRIBUTING.md:49, and spec/README.md:21-23 (a protocol change includes the specification update).
    • The PR updated docs/architecture/a2a-bridge.md and docs/clients.md but not spec/0.1/. The existing specification tests do not detect this contradiction.
  2. A duplicate, test-only lookup path is left behind (ruleset: remove obsolete paths; simplest implementation). This is not a demonstrated runtime bug.
    • Store.A2ATaskHistory (bus/a2a_tasks.go:362-407) repeats Store.A2ATask (bus/a2a_tasks.go:228-248): begin transaction, requireCurrentA2APrincipal, expireMessages, loadA2ATask, commit. It then adds message bodies. Runtime.A2ATaskHistory (:409-418) likewise repeats Runtime.A2ATask (:347-356).
    • A2ATask has no production caller outside its own wrapper. Its callers are bus/a2a_tasks_test.go:43,61,68,106 and bus/hardening_test.go:98, yet it stays on the storage interface (bus/storage_backend.go:95). It was already test-only on the base; this PR adds the duplicate rather than replacing that prepared lookup.
    • Consequence: the store-level credential-rotation fence test (bus/hardening_test.go:98) covers the old method, not the production read. The new HTTP rotation/disable tests are rejected earlier in authorize (bus/a2a_ingress.go:44-47), so they do not exercise the rejection at bus/a2a_tasks.go:368.
    • The production transaction does contain the correct fence. Removing the old method and redirecting the existing test closes the coverage gap without another abstraction. Issue A2A: let callers poll tasks returned by SendMessage #189 explicitly points to the existing principal-scoped lookup.

Non-blocking

In the fix plan (same lines are already being touched):

  • Unused fields. A2ATaskHistoryEntry.RequestCreatedAt and ResponseCreatedAt (bus/protocol.go:133,136) are filled at bus/a2a_tasks.go:392,396 and never read. taskHistoryToA2A (bus/a2a_ingress.go:146-168) ignores them, and the pinned SDK's a2a.Message has no timestamp field. Speculative per the ruleset.
  • Docs example does not match the SDK. docs/clients.md:67 shows a2aClient.GetTask(ctx, taskID). The pinned SDK signature is GetTask(ctx, *a2a.GetTaskRequest) (a2aclient/client.go:72 in a2a-go v2.7.0). docs/clients.md:64 also says to poll "until its state is completed"; that fails to stop on failed, canceled or rejected.

Not in the fix plan (optional follow-ups):

  • Unreachable fallbacks. bus/a2a_tasks.go:384-388 silently skips a turn whose request row is missing, and :397 silently drops a missing reply. Both columns are foreign keys to messages (bus/schema.go:156-157; deploy/hosted/migrations/001_runtime.sql:155-156), and retention prunes tasks and messages together (bus/retention_a2a.go:8-9; bus/storage.go:314). These branches mask broken invariants; they are not needed for normal retention.
  • Query shape and history limits. bus/a2a_tasks.go:379-400 issues up to two body queries per turn. All bodies are loaded even for historyLength=0; trimming happens afterward at bus/a2a_ingress.go:161. A join could reduce round trips. Impact is small for the current HTTP product: accepting another turn requires input-required (bus/a2a_tasks.go:188), and only the test-used SetA2ATaskState sets that state.
  • Multi-turn ordering caveat. The new documentation promises acceptance order (docs/architecture/a2a-bridge.md:38), but the reused query orders by millisecond created_at and then caller-controlled client_message_id (bus/a2a_tasks.go:36,151,208; bus/store.go:156). Two turns accepted in the same millisecond can therefore be reversed, affecting which messages a history limit selects. The new test uses already-sorted IDs turn-1 and turn-2 (bus/a2a_gettask_test.go:127,137). This is a pre-existing ordering limitation in the currently test-only multi-turn path, not a blocker for today's single-turn polling flow.
  • Error wording. mapBusA2AError (bus/a2a_ingress.go:173,187) reports internal failures as "The message could not be accepted", which now also appears on a read. Cosmetic.
  • Stale pin row (pre-existing). docs/architecture/a2a-bridge.md:14 says the A2A Go SDK is v2.5.0; go.mod:8 pins v2.7.0. Not caused by this PR.
  • Negative historyLength. Rejected with invalid params (bus/a2a_ingress.go:207-209); the pinned SDK's default handler instead returns empty history (a2asrv/handler.go:297). The pinned specification defines unset, zero and positive values, leaving negatives unspecified. Rejecting them is documented and tested. Pinned A2A specification, §3.2.4.
  • Reply placement is a documented interoperability limitation. Replies appear in history only (bus/a2a_ingress.go:154-166; docs/architecture/a2a-bridge.md:40), matching issue A2A: let callers poll tasks returned by SendMessage #189's request for correlated request/reply history. The pinned specification recommends artifacts for task outputs and says clients cannot generally assume important messages are persisted. That recommendation deserves acknowledgement; this bridge explicitly documents its history guarantee, so it does not require expanding this PR. Pinned A2A specification, §3.7.
  • Coverage. The new tests use the SQLite harness (bus/runtime_test.go:39-46). The hosted CI job selects Test(Postgres|Hosted) (.github/workflows/ci.yml:152) and does not execute these tests. PostgreSQL uses the same Store (bus/postgres.go:41) and portable SQL wrapper (bus/sql_database.go:113), so compilation is covered but execution of the new read is not.
  • Polling cost. No per-principal read limit, unlike output streams (bus/output_streams.go:21,310). Each poll takes a transaction and runs scope-wide expiry (bus/a2a_tasks.go:363-371), including a per-scope PostgreSQL lock (bus/scope_authority.go:38-45). The general 256-request concurrency cap remains (bus/capacity.go:10; bus/server.go:232-248). The expiry-on-read pattern already exists in Store.Receipt (bus/store.go:945-955).

Checked and found correct:

  • Authorization and the A2A-Version check precede task lookup (bus/a2a_ingress.go:199). The SDK may reject malformed query syntax before entering this handler, but that does not look up a task.
  • Foreign and unknown tasks return the same task-not-found error through the principal filter (bus/a2a_tasks.go:29-31; bus/a2a_ingress.go:180-181).
  • Credential generation, grants and publication enabled state are rechecked in the protected transaction (bus/a2a_principals.go:211-222). PostgreSQL scope serialization also prevents retention or reply writes from interleaving with the history read.
  • historyLength unset, zero, positive and oversized values select the expected history; zero omits history through the SDK's omitempty tag (a2a/core.go:364).
  • State mapping and the status timestamp preserve the existing taskToA2A behaviour (bus/a2a_ingress.go:114-137,164-166).
  • The documented 64 KiB body bound matches bus/a2a_tasks.go:336, bus/runtime.go:685 and the byte-length check in bus/validation.go:32.

Fix plan

Line numbers refer to the reviewed head. These are proposed changes for the fix phase; no tracked source files were changed during this audit.

  1. spec/0.1/README.md:208 — replace the paragraph with:

    The reference HTTP+JSON binding accepts authenticated A2A SendMessage requests containing plain text parts. It joins multiple parts in order with a newline, creates a durable Bus request, and returns the correlated A2A Task. It also accepts A2A GetTask, which returns the calling principal's task with its current state and its correlated request and response history as plain text messages. Unknown tasks and tasks of another principal return the same task-not-found error. The first binding does not accept file, URL, data, extension, referenced-task, streaming, push-notification, task-list, or cancellation operations. Rejected requests do not create Bus work. If an A2A-Version header is present, it MUST contain exactly 1.0.

  2. spec/0.1/http.md — after line 111 add:
    | `GET` | `/a2a/agents/{publicationId}/tasks/{taskId}` | Scoped A2A | Durable A2A Task with correlated history |
  3. spec/0.1/http.md:169 — replace the paragraph with:

    POST /a2a/agents/{publicationId}/message:send implements A2A 1.0 HTTP+JSON SendMessage. It accepts user messages made only of plain text parts and returns a durable A2A Task. GET /a2a/agents/{publicationId}/tasks/{taskId} implements A2A 1.0 GetTask for the calling principal's own tasks. It returns the task state and a history of each accepted user message followed by the agent's response when one exists. The optional historyLength query parameter keeps only that many of the most recent messages; 0 returns none and a negative value is rejected. Unknown tasks and tasks owned by another principal return the same A2A task-not-found error. On both routes the bearer credential must belong to the requested publication and the optional A2A-Version header must contain exactly 1.0. Other A2A operations and content types return A2A protocol errors.

  4. bus/a2a_tasks.go — delete func (s *Store) A2ATask (lines 228-248) and func (r *Runtime) A2ATask (lines 347-356).
  5. bus/storage_backend.go — delete line 95 (the A2ATask(...) interface entry).
  6. bus/a2a_tasks_test.go — switch the four callers to the remaining method:
    • line 43: stored, _, err := restarted.A2ATaskHistory(ctx, issued.Credential, publication.ID, task.ID)
    • line 61: working, _, err := agents.runtime.A2ATaskHistory(ctx, issued.Credential, publication.ID, task.ID)
    • line 68: completed, _, err := agents.runtime.A2ATaskHistory(ctx, issued.Credential, publication.ID, task.ID)
    • line 106: _, _, err = agents.runtime.A2ATaskHistory(ctx, other.Credential, publication.ID, task.ID)
  7. bus/hardening_test.go:98 — _, _, err = s.A2ATaskHistory(ctx, p, task.ID).
  8. bus/protocol.go — delete the RequestCreatedAt (line 133) and ResponseCreatedAt (line 136) fields.
  9. bus/a2a_tasks.go (inside Store.A2ATaskHistory):
    • delete var created int64;
    • in both queries change SELECT body,created_at to SELECT body and .Scan(&body, &created) to .Scan(&body);
    • change the request assignment to entry.RequestBody = body;
    • change the response assignment to entry.ResponseMessageID, entry.ResponseBody = correlation.BusResponseMessageID, body.
  10. docs/clients.md:
    • line 64: change "until its state is completed" to "until its state is terminal (completed, failed, canceled or rejected)";
    • line 67: change the call to task, err := a2aClient.GetTask(ctx, &a2a.GetTaskRequest{ID: taskID}) // bearer credential, A2A-Version 1.0.

After applying, run gofmt -l bus (no output expected) and the checks under Verification.

Message to the developer

n/a

Questions for Harsh

n/a

Verification

  • Audit only: no dependency installation, build, typecheck, vet, lint or tests were run. Review used code, the complete eight-file diff, history, documentation and read-only GitHub requests. Only the untracked audit document was written.
  • PR and issue: the prescribed gh pr view --comments command failed because this installed CLI requests retired Projects Classic fields. Explicit JSON fields and the REST API supplied the full PR body, issue A2A: let callers poll tasks returned by SendMessage #189 body, comments, reviews and inline discussion. All discussion lists were empty. Issue A2A: let callers poll tasks returned by SendMessage #189's five acceptance items are implemented, subject to the documentation/cleanup findings above.
  • Head/base: the checkout and live PR head both equal d7e168cbaca75dcdb9ca7ca4e6a43638412f16a8. The live base and local origin/main both equal 85d411e77a1c866295f33ed3462cd4d364b2c107; git log HEAD..origin/main is empty. GitHub reports MERGEABLE and BLOCKED. No rebase is needed.
  • Diff hygiene: git diff --check 85d411e77a1c866295f33ed3462cd4d364b2c107...HEAD was clean.
  • CI: all 11 checks passed. Run 43390538155 reports the exact reviewed head SHA. These are existing CI results, not checks rerun during the audit.
  • Independent code review: read the full diff and both handler/store implementations; traced authorization, credential rotation, delivery and reply transitions, retention, SQLite connection serialization, PostgreSQL scope locking and SQL adaptation. Rechecked every proposed deletion and all five affected test callers. Reviewed the new tests, existing A2A tests, the rotation regression, retention tests, specification policy, changed docs and CI selections.
  • Pinned library: inspected a2a-go v2.7.0 in the existing module cache, including REST routing/query parsing/error encoding, client signatures, default GetTask, task/message types and generated proto comments. No dependency was downloaded.
  • Resolved Turn 1's source gap: retrieved the exact pinned A2A specification at 173695755607e884aa9acf8ce4feed90e32727a1 and read §§3.1.3, 3.2.4 and 3.7. This confirms the history-length assessment and adds the artifact recommendation caveat.
  • Checks that matter after the fix: gofmt -l bus; go vet ./...; go build ./...; go test -race -count=1 ./bus ./spec ./conformance, especially TestA2AGetTask*, TestA2ATask*, TestA2ARotationFencesRetryReadAndStateChanges and TestA2ASendMessage*.
  • Remaining CI validation: run the hosted job with its disposable PostgreSQL configuration (go test -race -count=1 ./bus ./cmd/agentintercom ./conformance -run 'Test(Postgres|Hosted)') and the TypeScript interoperability job. The hosted job exercises existing PostgreSQL paths; it does not by itself add execution coverage for GetTask. Final required CI must pass on the fixed commit.

Audit log

  • Turn 1 (Claude (fable, xhigh)): Audited from scratch at d7e168c (same head as my interrupted earlier pass; no new commits or comments). Verified auth, isolation, historyLength, state mapping, retention and the SDK's REST handling. Raised two blocking items (stale spec/0.1 text; duplicate test-only A2ATask lookup) and wrote an exact fix plan of about 50 lines. Decision: fix.
  • Turn 2 (Codex (gpt-6-astra, xhigh)): Independently verified both blockers and every fix-plan edit against the same head, full issue and pinned SDK. Confirmed transaction fencing and retention; fetched the pinned specification; clarified the pre-existing test-only lookup, artifact recommendation, history-limit cost and multi-turn timestamp ties. No new blocker and no change to the decision or fix plan. Agree; no material changes.

Fixes applied by the audit

  • Applied the fix plan exactly in local commit e57da46 (8 files, +14/-50, not pushed): spec/0.1 README and http.md now describe the GetTask task read; removed the duplicate Store/Runtime A2ATask lookup and its storage-interface entry, pointing the 5 test callers at A2ATaskHistory; dropped the two unused history timestamp fields; corrected the docs/clients.md GetTask example and stop condition. Nothing was built or run.
  • Reviewed by Codex (gpt-6-astra, xhigh): All ten agreed fixes are implemented exactly, follow the ruleset, and add no scope; no correctness issues found. Installs, builds and tests were not run.

Final checks (run once, after both agents agreed)

Reviewed fixed commit e57da46 on Linux arm64 with Go 1.27 and Node 24.
go mod download — PASS.
npm ci (sdk/typescript) — PASS.
gofmt -l bus — PASS; no formatting changes needed.
git diff --check 85d411e..HEAD — PASS.
go vet ./... — PASS.
go build ./... — PASS.
go test -json -race -count=1 ./... — unavailable: ThreadSanitizer reports unsupported VMA range, Found 47 / Supported 48; identical failure on base 85d411e, excluded as a platform limitation.
Hosted suite with -race — same platform limitation on both head and base; requires a supported runner.
go test -json -count=1 ./... — PASS: 589 tests passed, including all new A2A tests; 43 database tests deferred to hosted suite.
go test -json -count=1 ./bus ./cmd/agentintercom ./conformance -run 'Test(Postgres|Hosted)' — PASS against disposable PostgreSQL 17: 49 tests passed, covering all 43 deferred tests.
Supabase identity lifecycle script — PASS; temporary dump redirected under HOME without modifying tracked files.
npm run typecheck — PASS.
npm run build — PASS.
npm run test:errors — PASS: 19 tests.
npm run test:release — PASS: 33 tests and compatibility metadata validation.
npm run build:native — PASS for Linux arm64.
npm run pack:distribution — PASS.
npm run test:distribution — PASS, including installation, CLI invocation and demo.
npm run test:integration — PASS against the freshly built CLI.
npm audit --audit-level=high — PASS; zero vulnerabilities.
Final repository check — tracked files unchanged; disposable PostgreSQL stopped.
Logs: /home/harshsaver/pr202-checks-e57da46-jJJXcdct/logs

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

@harshsaver

Copy link
Copy Markdown
Member Author

Verified the audit fix at head e57da46 (pushed before the audit's reviewed head d7e168c): all 10 fix-plan items are in — spec README + http.md route row and paragraph, both test-only A2ATask methods and the interface entry deleted, all five test callers switched to A2ATaskHistory, timestamp fields and SELECT body cleanup, and the corrected GetTask docs example. gofmt -l bus clean, CI 11/11 green at this head. No further push.

@harshsaver

Copy link
Copy Markdown
Member Author

🤖 Agentbox PR audit: ready to merge

What this PR changes

  • What it does: An outside system that hands work to one of our published agents can now ask how its task is doing and read the agent's reply.
  • What changes in the product: Nothing visible in the workspace UI. Integrators using the standard A2A task lookup get the task's current state and request/reply text instead of an unsupported-operation error.
  • Why it exists: Issue A2A: let callers poll tasks returned by SendMessage #189. Callers could submit work and get a task ID but had no standard way to check progress or read the answer.
  • Why merge (or why not yet): The requested flow is covered through HTTP on SQLite and through the production storage path on PostgreSQL. Caller isolation and credential revocation remain enforced, the public specification describes the operation, and all 11 CI checks pass on this commit.
  • What to expect after merging: Replies come back in conversation history. Clients that only read output artifacts will not see them; this limitation is documented and matches the issue's requested history mapping. No follow-up is required for this feature.
Full audit (Claude (claude-opus-5-5, xhigh) × Codex (gpt-6.1-sol, xhigh), 2 turns, commit d0869b8)

PR audit: #202 — A2A: let callers poll tasks returned by SendMessage

Head: d0869b8

Sign-off

  • Claude (claude-opus-5-5, xhigh): ✅ satisfied — the earlier blockers stay fixed, the merge from main left the PR code untouched, the new PostgreSQL test closes the last coverage gap, and CI is 11/11 green on this exact commit.
  • Codex (gpt-6.1-sol, xhigh): ✅ satisfied — independently verified the merged history, new PostgreSQL test, current implementation and CI; no blocking or material changes to the audit.

Decision

merge — no blocking findings remain, and the PR follows the ruleset and the product rules.

Should this exist?

  • Verdict: yes — Harsh's issue A2A: let callers poll tasks returned by SendMessage #189 asks for callers to poll tasks returned by SendMessage and retrieve correlated request/reply history. This PR implements that request using the existing publication authorization and principal-scoped storage.
  • Product-rule issues: None. No new production limits, throttles, timers or background workers. The documented 64 KiB body bound already exists in acceptance validation (bus/a2a_tasks.go:314, bus/runtime.go:685). The history-length behavior comes from A2A's parameter semantics and is documented. The new test's 60-second context follows the existing PostgreSQL test pattern and does not affect users.
  • Simpler alternative: None needed. The implementation uses the pinned A2A library for HTTP handling, keeps transport conversion separate from storage, and replaces the old lookup rather than keeping a compatibility wrapper.
  • Real-launch evidence: not applicable to the launch-evidence requirement: this changes an authenticated daemon endpoint, not app startup or a harness launch flow. SQLite tests exercise the real A2A client and server over HTTP; the new PostgreSQL test exercises the production runtime/storage path directly.

What changes (plain language)

  • What it does: An outside system that hands work to one of our published agents can now ask how its task is doing and read the agent's reply.
  • What changes in the product: Nothing visible in the workspace UI. Integrators using the standard A2A task lookup get the task's current state and request/reply text instead of an unsupported-operation error.
  • Why it exists: Issue A2A: let callers poll tasks returned by SendMessage #189. Callers could submit work and get a task ID but had no standard way to check progress or read the answer.
  • Why merge (or why not yet): The requested flow is covered through HTTP on SQLite and through the production storage path on PostgreSQL. Caller isolation and credential revocation remain enforced, the public specification describes the operation, and all 11 CI checks pass on this commit.
  • What to expect after merging: Replies come back in conversation history. Clients that only read output artifacts will not see them; this limitation is documented and matches the issue's requested history mapping. No follow-up is required for this feature.

Findings

Blocking

None.

Status of earlier blockers, re-checked at this head:

  • Spec contradiction — still fixed. spec/0.1/README.md:208 lists GetTask as accepted. spec/0.1/http.md:112 adds the route, and :170 describes the read, history-length selection and shared task-not-found error.
  • Duplicate lookup — still fixed. A2ATaskHistory is the sole public task-read path (bus/a2a_tasks.go:329,375; bus/storage_backend.go:95). The five existing test callers use it (bus/a2a_tasks_test.go:43,61,68,106; bus/hardening_test.go:98). There are no remaining references to the deleted A2ATask methods or unused history timestamp fields.

Non-blocking

New since the last round:

  • PostgreSQL coverage — the earlier database-execution gap is resolved. TestPostgresA2AGetTaskHistory (bus/a2a_gettask_test.go:271-317) submits work, reads the submitted request without a reply, delivers and answers it, reads the completed task with the response ID/body, and checks an unknown task. The unknown ID is valid under bus/validation.go:10, so the assertion reaches the not-found path.
    • Its guard, migration, open, random scope and deferred cleanup follow TestPostgresRuntimeContracts (bus/postgres_test.go:24-45). Cleanup deletes the test scope before closing the runtime; DeleteScope removes task correlations safely (bus/scope_admin.go:98-115).
    • It calls the production runtime method, which reaches the shared Store and PostgreSQL SQL adapter (bus/a2a_tasks.go:375-383; bus/postgres.go:41-46; bus/sql_database.go:113-114). It does not repeat the HTTP/history-limit/security matrix on PostgreSQL; those remain covered by SQLite HTTP tests. This is an appropriate addition, not proof that every possible coverage gap is closed.
    • The hosted selector includes its name and sets its required database URL (.github/workflows/ci.yml:144,152). The hosted job and its test step passed. Individual test output was unavailable, so execution is inferred from the selector, environment and unconditional path after the environment guard.
    • Keeping the test in the feature file follows existing practice (bus/channels_test.go:140; bus/attachments_test.go:122; bus/native_wake_test.go:106).
  • Merge from main — no feature regression found. 8fd61f4 merges base 4efe404, bringing in Workspace UI: paginate session directory (#183) and preserve composer drafts (#185) #199 and feat(cursor): launcher-owned CLI setup, cursor-agent doctor fallback and Linux CLI observation #209. Its changed paths exactly match the intervening main changes. All previously reviewed PR files remain byte-identical to e57da46, except the feature test file's three imports and appended PostgreSQL test. The PR-relative diff otherwise remains unchanged.
  • Polling cost — observation only. Each poll opens a scope transaction and runs scope-wide message expiry (bus/a2a_tasks.go:330-340), taking the existing PostgreSQL scope lock (bus/scope_authority.go:38-45). There is no separate caller rate limit; the general 256-request concurrency cap applies (bus/capacity.go:10; bus/server.go:232-248). No evidence warrants adding limits or protective machinery.

Still open from earlier rounds, none requiring a merge hold:

  • Unnecessary missing-row fallbacks. bus/a2a_tasks.go:350-354 skips a turn whose request is missing; :363 drops a missing reply. Foreign keys (bus/schema.go:156-157; deploy/hosted/migrations/001_runtime.sql:155-156), SQLite foreign-key enforcement (bus/store.go:95,126) and unit retention (bus/retention_a2a.go:8-9; bus/storage.go:314) prevent ordinary deletion from creating these cases. If an invariant is broken, the branches hide incomplete history. Returning the error would be a small simplification.
  • Reply placement. Replies appear only in history (bus/a2a_ingress.go:154-166; docs/architecture/a2a-bridge.md:40). The pinned specification recommends artifacts for outputs and warns clients against assuming history persistence without an explicit agreement. Issue A2A: let callers poll tasks returned by SendMessage #189 requests history and this bridge documents its guarantee. Adding artifacts is an optional additive follow-up, not part of the requested fix. Pinned A2A specification, §3.7.
  • Query shape. Up to two body queries per turn (bus/a2a_tasks.go:346-368), even when historyLength=0; trimming occurs afterward (bus/a2a_ingress.go:161-163). A join could reduce round trips. Current HTTP tasks have one turn: accepting another requires input-required (bus/a2a_tasks.go:188), and the state setter has only test callers in this repository.
  • Multi-turn ordering. Docs promise acceptance order (docs/architecture/a2a-bridge.md:38), but the reused query orders by millisecond creation time, then caller-chosen ID (bus/a2a_tasks.go:36,151,208; bus/store.go:156). Tied timestamps can reverse turns. This is pre-existing; the current live HTTP flow has no operation that transitions a task into input-required. The multi-turn test enters that state directly and uses already-sorted IDs (bus/a2a_gettask_test.go:130,136,140).
  • Conformance. The conformance runner exercises Agent Cards and principal administration but does not send or read A2A tasks (conformance/runner.go:196-260). This pre-existing gap remains for the standalone conformance profile; runtime HTTP tests cover the new operation.
  • Error wording. Internal read failures say "The message could not be accepted" (bus/a2a_ingress.go:173,187). Cosmetic.
  • Docs comment. docs/clients.md:64 is a long comment line. The terminal-state stop condition and SDK request signature at :67 are correct.
  • Stale pin row, pre-existing. docs/architecture/a2a-bridge.md:14 says SDK v2.5.0; go.mod:8 pins v2.7.0.
  • Negative history length. Invalid-params rejection is documented and tested (bus/a2a_ingress.go:207-209; bus/a2a_gettask_test.go:172-174). The pinned SDK's default handler instead returns empty history (a2asrv/handler.go:297). The specification defines unset, zero and positive values, leaving negative input unspecified. Pinned A2A specification, §3.2.4.
  • PR description. It does not mention the new PostgreSQL test. Cosmetic.

Checked and found correct at this head:

  • Authorization and the A2A-Version check precede lookup (bus/a2a_ingress.go:198-201). The SDK can reject malformed query syntax before invoking the handler, without accessing task data.
  • Unknown and other-principal tasks produce the same task-not-found error (bus/a2a_tasks.go:28-32; bus/a2a_ingress.go:180-181).
  • Credential generation, grant and publication enabled state are rechecked inside the transaction (bus/a2a_tasks.go:335; bus/a2a_principals.go:211-223). The redirected rotation regression now exercises this production read (bus/hardening_test.go:91-99).
  • Omitted, zero, positive and oversized history lengths select the expected messages; zero omits history through the SDK's omitempty tag (bus/a2a_ingress.go:161-166; SDK a2a/core.go:364).
  • State mapping and timestamps preserve the existing send-path behavior (bus/a2a_ingress.go:114-139,164-166).
  • The documented 64 KiB bound matches request and reply validation (bus/a2a_tasks.go:314; bus/runtime.go:685; bus/validation.go:32).

Fix plan

n/a

Message to the developer

n/a

Questions for Harsh

n/a

Verification

  • No checks rerun during this audit: no dependency installs, builds, typechecks, lint, vet or tests. Review used code, diffs, history, documentation and read-only GitHub requests. Only this untracked audit document was written.
  • Changes since e57da46: verified both merge parents of 8fd61f4; compared its paths against intervening main commits; read the full new PostgreSQL test and imports. d0869b8 adds 51 lines to that file. All other previously reviewed PR files are unchanged.
  • Current PR diff: read all 12 changed files against base 4efe404, plus surrounding authorization, task transitions, retention, schema, runtime and PostgreSQL adapter code. Rechecked the old fixes, all redirected callers, the new test's helpers and cleanup, public docs and specification.
  • Discussion: the prescribed gh pr view --comments still fails on retired Projects Classic fields. Explicit JSON fields and REST supplied the PR description, two existing comments, issue A2A: let callers poll tasks returned by SendMessage #189, reviews and inline discussion. No new discussion or reviews; the existing comments are the automated audit and fix-verification note.
  • Head/base: the checkout and live PR head are d0869b8af02edcad72935d8e05a684b7a580ff81; live base and local origin/main are 4efe404f5aaaee841e327ed08b87bb8020f4bffe. That is the merge base, and git log HEAD..origin/main is empty. GitHub reports MERGEABLE, BLOCKED and REVIEW_REQUIRED. No rebase is needed.
  • Diff hygiene: git diff --check 4efe404...HEAD and git diff --check e57da46..HEAD are clean.
  • CI: run 46142151666 reports the exact reviewed head SHA, pull_request event and success. All 11 checks pass. Job metadata confirms successful Ubuntu race tests, vet, builds, hosted PostgreSQL regressions and TypeScript interoperability. Hosted log retrieval returned no individual test output; this audit does not claim a directly observed named-test result.
  • Library/spec grounding: re-read a2a-go v2.7.0 from the existing module cache: REST routing/query parsing, default GetTask, task/request types, client signature and generated proto comments. Retrieved the exact pinned specification at 173695755607e884aa9acf8ce4feed90e32727a1 and read §§3.1.3, 3.2.4 and 3.7. No dependency download.
  • Historical final checks: the earlier checks on e57da46 passed formatting, vet, build, full functional tests, PostgreSQL/hosted tests and SDK/CLI/interoperability checks. Local race runs were blocked by that machine's ARM64 ThreadSanitizer support and reproduced on its base. Those are historical results; current-head CI separately reports successful race runs.
  • Checks for the final run on d0869b8:
    • gofmt -l bus
    • go vet ./...
    • go build ./...
    • go test -race -count=1 ./... on a supported runner, especially the A2A polling, task, rotation and send tests and the specification tests.
    • Hosted PostgreSQL suite: go test -race -count=1 ./bus ./cmd/agentintercom ./conformance -run 'Test(Postgres|Hosted)' with the disposable database configured. Confirm TestPostgresA2AGetTaskHistory passes rather than skips; use verbose or JSON output for a named result.
    • TypeScript interoperability job against a freshly built daemon, plus its SDK install, typecheck and build prerequisites.

Audit log

  • Turn 1 (Claude (claude-opus-5-5, xhigh)): Re-audited from scratch at d0869b8 against the new base 4efe404. Applied the new product rules: should exist (yes, issue A2A: let callers poll tasks returned by SendMessage #189), no limits, no timers, no default changes, no unsourced numbers.
    • Proved the main merge left the PR code byte-identical, and that the only new code is the PostgreSQL read test, which follows existing conventions and runs in the hosted job.
    • Re-confirmed both earlier blockers are still fixed and CI is green on this SHA.
    • Dropped the old "PostgreSQL untested" note. Restated the polling-cost note as an observation, since the product rules forbid adding limits without evidence.
    • Decision: merge.
  • Turn 2 (Codex (gpt-6.1-sol, xhigh)): Independently verified the new comments, merge ancestry, complete PR diff, added PostgreSQL test and helpers, current auth/isolation/history behavior, pinned SDK/spec and exact-head CI. Clarified that PostgreSQL coverage is a runtime/storage test and that named execution is inferred from CI configuration, and qualified existing fallback/multi-turn observations. No new blocker, decision change or requested work. Agree; no material changes.

Final checks (run once, after both agents agreed)

Verified commit d0869b8 on Linux arm64, Go 1.27 and Node 24.
go mod download — PASS.
npm ci (sdk/typescript) — PASS.
gofmt -l bus — PASS; no formatting issues.
git diff --check 4efe404...HEAD — PASS.
go vet ./... — PASS.
go build ./... — PASS.
go test -json -race -count=1 ./... — platform-blocked: ThreadSanitizer unsupported VMA range, Found 47 / Supported 48; reproduced on base 4efe404, excluded as a PR failure.
Hosted suite with -race — same platform limitation on head and base.
go test -json -count=1 ./... — PASS: 595 tests passed; 44 database tests deferred to hosted suite.
PostgreSQL/hosted suite without -race — PASS: 50 tests against disposable PostgreSQL 17, covering all 44 deferred tests.
TestPostgresA2AGetTaskHistory — explicitly confirmed PASS, not skipped.
Supabase identity lifecycle script — PASS; temporary dump redirected under HOME without modifying source.
npm run typecheck — PASS.
npm run build — PASS.
npm run test:errors — PASS: 19 tests.
npm run test:release — PASS: 33 tests and compatibility metadata validation.
npm run build:native — PASS for Linux arm64.
npm run pack:distribution — PASS.
npm run test:distribution — PASS, including fresh installation, CLI invocation and demo.
npm run test:integration — PASS against the freshly built CLI.
npm audit --audit-level=high — PASS; zero vulnerabilities.
Final repository check — tracked files unchanged; disposable PostgreSQL stopped.
Logs: /home/harshsaver/pr202-checks-d0869b8-Qh9oc2N3/logs

Automated review by Harsh's agentbox: two AI reviewers audited this PR against the project ruleset and agreed on it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agentbox: ready to merge Audited by Claude and Codex; Harsh can merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A2A: let callers poll tasks returned by SendMessage

1 participant