Repository navigation
fix(auto-reply): show revoked queued input as a withheld failure instead of a silent cancel - #200213
Conversation
…re selector change A config commit that touches env or session.store republished the store selector and every pending subagent completion was suspended as "store replaced" and never retried. Delivery already resolves the requester by key at send time, so the suspend path is removed. Co-authored-by: obviyus <[email protected]>
…a silent cancel A queued follow-up whose operator authority was revoked was consumed as an abort with only a log line, so the chat showed nothing. It now settles as a failed turn with the refusal reason, like other terminal follow-up failures. The authority probe has one owner in queue/types. Co-authored-by: obviyus <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
…d before admission Co-authored-by: obviyus <[email protected]>
A real session.store switch must not deliver a child result from the old store into a same-key chat in the new store (#152288). The production drop it was meant to fix is not reproduced by an env change, which restarts the Gateway and delivers normally. This reverts commit fbaef92. Co-authored-by: obviyus <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesThis PR reports caught queued-input authority refusals as failed completions and shares the existing authority probe across callers. Example: A queued follow-up's authority check throws “Your operator role changed; reconnect before continuing.” before admission.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides a useful partial repair for silent authority refusals still present on main; no definite introduced regression was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe follow-up runner consumes session-mailbox input, prepares and executes agent turns, then returns terminal results through the submitting source's delivery owner. flowchart TD
A[Queued user input] --> B[Session mailbox]
B --> C[Follow-up runner]
C --> D[Authority and turn admission]
D --> E[Agent execution]
D --> F[Source completion owner]
E --> F
F --> G[Chat terminal result]
Technical reviewBest possible solution: Use the existing source-completion owner to report both thrown authority refusals and signal-driven revocations as failures while preserving deliberate user cancellation. Do we have a high-confidence way to reproduce the issue? Source confirms that main consumes caught authority refusals as aborts and omits source delivery before admission; this read-only review ran no target code. Is this the best way to solve the issue? Reusing failed source completion is a focused repair, and the shared probe preserves existing checks, but already-aborted authority signals still bypass the changed handler. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0eae4c0423cd. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +10, Tests +41. Total +51 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 16, 2026, 2:21 PM ET / 19:21 UTC. |
|
Landed in d981eaa.
|
…ead of a silent cancel (openclaw#200213) ## What Problem This Solves A queued follow-up whose operator authority was revoked (token rotated, device or role revoked) was consumed as an abort. Only a log line recorded it ("canceled input after loss of operator authority"). The chat showed nothing, and the source of the input got an abort instead of a failure. ## Why This Change Was Made - A revoked queued input now settles like the other terminal follow-up failures. The reply operation fails with the refusal reason (`run_failed`). The source gets a failed completion with the notice `withheld: <reason>`, which the chat send path already shows to the user. - This also applies when the refusal happens before turn admission. In that case no turn exists, so the source is settled directly from the queued input. - The authority probe has one owner, `isFollowupOperatorAuthorityCurrent` in `queue/types.ts`. The drain, the stalled-turn handoff and goal continuation use it instead of their own `try { assertCurrent() }` copies. Out of scope: subagent completion delivery after a `session.store` switch is unchanged. The store-switch boundary stays: a child result from the old store must not reach a same-key chat in the new store (openclaw#152288). ## Security model - No authority is widened. Revoked input is still refused and is never replayed. - The only change is that the refusal is visible and reported as a failure. ## User Impact - A queued message that is refused after access is revoked shows a `withheld: <reason>` failure instead of disappearing. ## Evidence - `followup-runner.test.ts`: two tests (revoked input refused before admission, and refused during execution). Both fail on the merge base db7ec00 and pass on the head. - `subagent-registry.store-replaced.test.ts` passes on the head. The PR has no diff in `src/agents` or `src/gateway`. - Real Gateway check of a config commit that touches `env.*` while a child runs (base and head): on both, the Gateway defers the restart, delivers the child result to the parent (requester-settle run ends with `stopReason=stop`) and then restarts. This is why the store-switch boundary is kept. - `pnpm tsgo:core` and `pnpm check:test-types` pass. Co-authored-by: Ayaan Zaidi <[email protected]>
Backport d981eaa. Keep stable follow-up settlement while reporting revoked input as a withheld failure, never retrying it. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
A queued follow-up whose operator authority was revoked (token rotated, device or role revoked) was consumed as an abort. Only a log line recorded it ("canceled input after loss of operator authority"). The chat showed nothing, and the source of the input got an abort instead of a failure.
Why This Change Was Made
run_failed). The source gets a failed completion with the noticewithheld: <reason>, which the chat send path already shows to the user.isFollowupOperatorAuthorityCurrentinqueue/types.ts. The drain, the stalled-turn handoff and goal continuation use it instead of their owntry { assertCurrent() }copies.Out of scope: subagent completion delivery after a
session.storeswitch is unchanged. The store-switch boundary stays: a child result from the old store must not reach a same-key chat in the new store (#152288).Security model
User Impact
withheld: <reason>failure instead of disappearing.Evidence
followup-runner.test.ts: two tests (revoked input refused before admission, and refused during execution). Both fail on the merge base f4fa17a and pass on the head.subagent-registry.store-replaced.test.tspasses on the head. The PR has no diff insrc/agentsorsrc/gateway.env.*while a child runs (base and head): on both, the Gateway defers the restart, delivers the child result to the parent (requester-settle run ends withstopReason=stop) and then restarts. This is why the store-switch boundary is kept.pnpm tsgo:coreandpnpm check:test-typespass.