fix(acp): treat session/prompt ack timeout as delivered#4812
Merged
Conversation
POST /v1/sessions/:id/send to an idle session returned a false-negative 422 PROMPT_DELIVERY_FAILED even though the prompt was delivered and the agent replied — the dashboard surfaced an error toast for a message that went through. Root cause: sendPrompt treated an AcpJsonRpcTimeoutError as "not delivered" (#4705). Empirically the request is written to a live JSON-RPC pipe and claude-agent-acp (single-threaded, in-order) processes the queued prompt; the ack merely lags past the 5s window on idle/cold-resumed sessions. A dead pipe rejects with a transport error, never a timeout — so a timeout is a slow ack, not a non-delivery. Reverses the #4705 assumption: timeout now returns delivered:true; the transcript remains the source of truth. Actual JSON-RPC errors (e.g. -32601) are still thrown. Updated the 3 test sites that asserted the old delivered:false / prompt_ack_timeout behavior. Verified live: /send on an idle session returns {"ok":true,"delivered":true,"attempts":1} and the reply appears in the transcript. Generated by Hephaestus (Aegis dev agent)
Contributor
There was a problem hiding this comment.
✅ Approved.
Review summary:
- Correctness: Reverses the #4705 assumption with empirical justification. Timeout on a live JSON-RPC pipe = slow ack, not non-delivery. Dead pipes reject with transport errors, never timeouts. The reasoning is sound.
- Security: No new attack surface. No secrets, no input validation changes.
- Tests: 3 test sites updated (acp-backend.test.ts, acp-sendprompt-timeout-4705.test.ts). New direct sendPrompt test covers the continue-conversation case. All assertions match the new behavior.
- Patterns: Follows existing error handling patterns. Log operation renamed from
promptAckTimeout→promptAckTimeoutAcceptedfor audit clarity. - PR Hygiene:
fix(acp):title correct. Targetsdevelop. Issue #4705 linked in body. +53/-18, 3 files — focused scope. - CI: 16/17 green, 1 pending (helm-smoke). All critical checks pass (test ubuntu-20/22, lint, dashboard-e2e, platform-smoke, CodeQL, security scans).
9-gate sweep: All gates pass. Squash merging now.
OneStepAt4time
pushed a commit
that referenced
this pull request
Jun 27, 2026
…emantics PR #4812 reverses the #4705 assumption: a session/prompt timeout is now treated as delivered:true (slow ack on a live pipe, not non-delivery). Update the error-values note in the POST /v1/sessions/:id/send section to reflect the new semantics and clarify when prompt_ack_timeout still surfaces in the 422 response. Refs: #4812, #4705
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.
Aegis version
Developed with: v0.6.7
Problem
POST
/v1/sessions/:id/sendto an idle session returned a false-negative422 PROMPT_DELIVERY_FAILED(prompt_ack_timeout) even though the prompt was delivered and the agent replied. The dashboard showed an error toast for a message that went through — continue-conversation appeared broken.Root cause
sendPrompttreatedAcpJsonRpcTimeoutErroras "not delivered" (#4705). Empirically the request is written to a live JSON-RPC pipe andclaude-agent-acp(single-threaded, in-order) processes the queued prompt; the ack merely lags past the 5s window on idle/cold-resumed sessions. A dead pipe rejects with a transport error, never a timeout — so a timeout is a slow ack, not a non-delivery.Change
Reverses the #4705 assumption: on
session/prompttimeout, returndelivered: true; the transcript remains the source of truth. Actual JSON-RPC errors (e.g.-32601) are still thrown.src/services/acp/backend/prompts.ts— timeout →{ delivered: true, attempts: 1 }.delivered: false/prompt_ack_timeoutbehavior (acp-sendprompt-timeout-4705.test.ts,acp-backend.test.ts).Verification
npx tsc --noEmitclean./sendon an idle session →{"ok":true,"delivered":true,"attempts":1}, reply appears in transcript (was 422).Notes
npm run gatehas pre-existing Windows-only flakes (path-separator inworktree-4694, ENOENT temp races) unrelated to this change; CI runs on Linux where those pass.