Skip to content

fix(auto-reply): show revoked queued input as a withheld failure instead of a silent cancel - #200213

Merged
obviyus merged 4 commits into
mainfrom
obviyus/identity-pr4b
Nov 16, 2026
Merged

obviyus merged 4 commits into
mainfrom
obviyus/identity-pr4b

Conversation

@obviyus

@obviyus obviyus commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

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 (#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 f4fa17a 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.

obviyus and others added 2 commits November 16, 2026 23:49
…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]>
@clawsweeper

clawsweeper Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: L labels Nov 16, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
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]>
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed agents Agent runtime and tooling size: L labels Nov 16, 2026
@obviyus obviyus changed the title refactor(subagents): deliver completions by key after a store change; show revoked queued input fix(auto-reply): show revoked queued input as a withheld failure instead of a silent cancel Nov 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 16, 2026
@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The runner consumes the input without delivering a failure to its source.
  • After: The source receives a failed completion with the refusal and a withheld notice.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The inspected patch is focused and introduces no definite regression, but its stated repair remains partial and the changed user-visible behavior has only mocked proof.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: A queued message can disappear without an actionable failure when its submitting operator loses authority.
Reason: The maintainer-authored direction has clear value, but production revocation can abort operatorAuthority.signal before draining, and that existing early-return path receives no withheld completion from this change.

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
Reviewed head: 47d4f48d72ed0dc534d34a18ef10bb4691b648ad

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Provide redacted real Gateway chat.send output showing a queued message refused after authority revocation reaches the client as a failure, distinguishing pre-admission refusal from admitted execution.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

PR surface

Source +10, Tests +41. Total +51 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 52 42 +10
Tests 1 42 1 +41
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 94 43 +51

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The change improves failure visibility for queued messages refused after authority loss, with a limited affected workflow.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The change improves failure visibility for queued messages refused after authority loss, with a limited affected workflow.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete signal-driven revocation coverage through the existing source-settlement owner.
  • Supply the real Gateway refusal evidence described above.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 16, 2026, 2:21 PM ET / 19:21 UTC.

@obviyus
obviyus merged commit d981eaa into main Nov 16, 2026
149 checks passed
@obviyus
obviyus deleted the obviyus/identity-pr4b branch November 16, 2026 19:28
@obviyus

obviyus commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in d981eaa.

  • Bug: a queued follow-up whose operator authority was revoked was consumed as a silent abort. The chat showed nothing.
  • Fix: the revoked input now settles as a failed turn with a visible withheld: <reason> notice, also when it is refused before turn admission. The authority probe has one owner in queue/types.ts.
  • Proof: two followup-runner tests fail on the merge base and pass on the head. Local review is clean on the exact head, and CI is green. The subagent store-switch boundary is unchanged.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…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]>
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Backport d981eaa. Keep stable follow-up settlement while reporting revoked input as a withheld failure, never retrying it.

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant