Repository navigation
fix: ask_user stops accepting answers when prompt delivery fails - #124148
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 6:46 AM ET / 10:46 UTC. ClawSweeper reviewWhat this changesThe PR makes Merge readinessNo blocking correctness finding: this is a focused P1 repair for a current-main delivery-state gap. It needs member-owner approval and an exact-current-main proof refresh before merge because the branch is behind main. Priority: P1 Review scores
Verification
How this fits togetherThe auto-reply dispatcher delivers agent tool output to the active or originating channel. flowchart LR
A[Agent invokes ask_user] --> B[Pending question]
B --> C[Auto-reply dispatcher]
C --> D[Queued or routed delivery]
D --> E[Delivery settlement]
E --> F[Answerable or prompt failed]
F --> G[Inbound user reply]
Decision needed
Why: This member-authored, maintainer-labeled PR changes whether a channel prompt remains eligible to consume a later inbound answer. Before merge
Agent review detailsSecurityNone. PR surfaceSource +130. Total +130 across 5 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the exact-settlement rule at the turn-ledger and routed-delivery owners, preserve ambiguous post-transport failures as potentially visible, and merge only after current-main validation confirms the same behavior. Do we have a high-confidence way to reproduce the issue? Yes—current main shows the idle-only path, and the PR’s focused real-dispatcher table directly varies the missing settlement outcomes; this read-only review did not execute the suite. Is this the best way to solve the issue? Yes—the exact delivery result is available at the queued and routed delivery owners, while an idle barrier alone cannot establish that a prompt reached transport. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7e0941270d0d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer landing decision: approved. ClawSweeper before-merge items:
Local ClawSweeper result on |
|
Landed as f7b809933d6910838039bbf372fb9074a047245e from source ba7edcdbdcc16c12b037f61bdc55f189a80e0956. Exact-head CI, focused owner tests, local ClawSweeper, and Telegram cancellation/answer proof passed before merge. |
Do not leave invisible ask_user prompts armed to consume later messages. Reject only delivery outcomes proven invisible; preserve ambiguous post-transport failures and untracked dispatcher behavior. Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #123915
What Problem This Solves
Fixes an issue where an
ask_userprompt could be marked answerable even though its channel delivery was cancelled or failed before transport. The next unrelated inbound message could then be consumed as the missing answer.Why This Change Was Made
The tool callback treated dispatcher idleness as delivery success and discarded the existing per-payload settlement outcome. The queued-delivery owner now requires the exact outcome for tracked dispatchers and rejects only outcomes proven invisible; routed delivery applies the same invariant at its result owner. Ambiguous failures after transport begins remain accepted because the prompt may already be visible.
No provider-specific path, retry, compatibility shim, or fallback was added. Production delta: +25 lines; regression/test delta: +105 lines. The production growth is the generic exact-settlement and abort contract shared by the owner boundary; the call site is net negative.
User Impact
Invisible questions no longer remain armed to capture a later message. Visible and possibly partially delivered questions keep their existing answer flow.
Evidence
cancelledandfailed-before-delivercases; 2 table cases failed because rejection was expected.cancelled,failed-before-deliver,delivered, and ambiguousfailed-deliver; routed non-delivery and queue-admission rejection have sibling coverage.git diff --checkconfig/tsconfig/oxlint.core.jsonon all 5 touched filespnpm tsgo:corepnpm check:test-types$distill: zero findings$greybeard: zero findingsba7edcdbdcc16c12b037f61bdc55f189a80e0956):Stableresolved asstatus: answered, then Telegram receivedASK_USER_E2E_FINISHED.reply_payload_sendinghook cancelled only theask_userpayload. Telegram recorded no question event; the bridge receivedask_user prompt delivery failed | queued reply delivery failed; the model resumed and Telegram received the single visible final messageASK_USER_E2E_FINISHED.