Skip to content

fix: report the same cancellation when a queued steer is replayed - #201399

Merged
roboclaw-bot merged 8 commits into
mainfrom
flake/l99-steer-fifo-cancel
Nov 19, 2026
Merged

roboclaw-bot merged 8 commits into
mainfrom
flake/l99-steer-fifo-cancel

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #200533, #176084, #201094

Work sessions

Linked for team reference; these sessions aren’t public.

What Problem This Solves

After a CLI caller successfully cancels a queued steer, resending its message ID can return a cached abort response or say the input was cancelled because it failed. The response depends on when the Gateway finishes writing the cancellation receipt.

User Impact

A withdrawn steer now reports the same cancellation on replay, including while the receipt is still being written. The original turn continues and the caller can send the message again with a new ID.

Why This Change Was Made

An exact chat.abort targeting an injecting chat input records user-stop for that chat. Replay checks the durable cancellation first, then the admitted cancellation for the same chat, ahead of the response cache. The separate userInitiated presentation flag retains its existing meaning.

After #201334, losing access rejects the next admission but does not cancel already-started work. The current baseline includes the stronger recovery regression from #201713 and the equivalent stale Stop correction from #201744. Both files are kept as-is from main; the cancellation replay fix is unchanged.

Evidence

  • The original pre-cleanup regression returned in_flight. With the fix, replay reports INVALID_REQUEST with chat-input-cancelled and user-stop, both before and after durable settlement. All six steer FIFO cases passed in hosted CI on the original fix.
  • On 3480a783f1760, 80 focused tests and the isolated cross-device Stop test passed, as did targeted lint, formatting, and the Gateway root test typecheck. Independent review against fd933a39c52813 found no actionable P0–P2 defects. Required CI for this head is the landing gate.
  • Required CI on the preceding head passed, including the ratchet and changed-test jobs. That resolves the prior CI failure on that head, but does not establish a root-cause fix for the intermittent SQLite admission failure from the earlier run.
  • Earlier evidence: session-identity ratchet and first failure on an unrelated PR.

@clawsweeper

clawsweeper Bot commented Nov 18, 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.

@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR waits for actual steering admission and durable cancellation before checking that replay is rejected.

Example: Cancel queued CLI input canceled-steer while initial-held-turn is awaiting its provider response.

  • Before: The test can cancel before admission and expects a cached timeout response when replaying canceled-steer.
  • After: The test waits for admission, sends an explicit user Stop, observes cancelled/user-stop, and expects INVALID_REQUEST on replay.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-consistent test repair with no identified defect; successful general checks support it, but execution of the revised case remains unverified.
Proof confidence 🦐 gold shrimp (3/6) This PR changes only a test, so shipped-entry-point proof is not required; supplied evidence does not yet establish execution of the revised cancellation case.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: The regression test can report failure after successful withdrawal or miss the already-admitted cancellation boundary.
Reason: Reliable coverage of cancellation without interrupting the original turn has clear value, and maintainer authorship supplies direction for this narrow test repair.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR makes a focused, source-supported repair to the cancellation test without weakening its behavioral assertions; no actionable patch defect was found.

Priority: P2
Reviewed head: 797db06b42d3d3c141ce38b4fcb319e2e2ca95a3

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Gateway accepts CLI chat requests, passes steering into the active agent queue, and exposes pending-input settlement through history and retry responses.

flowchart LR
A[CLI chat requests] --> B[Gateway admission]
B --> C[Active agent steering queue]
C --> D[Scripted provider]
B --> E[Pending input owner]
E --> F[History and replay responses]
Loading

Technical review

Best possible solution:

Retain this focused test repair using the existing admission observer and pending-input owner.

Do we have a high-confidence way to reproduce the issue?

Source establishes the mismatch: durable cancellation takes precedence over cached replay, while the base test expects cached timeout success; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is the smallest complete repair: synchronize on real admission and settlement, then assert the existing cancellation contract while preserving the original non-delivery and active-turn checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ee37dd3b0335.

Provenance checked

  • Cancellation withdrawal regression keeps the original intent (bcc7cc9: Prevent canceled pending steering from reaching the active run while preserving that run's successful completion.)
  • Admission synchronization keeps the original intent (6605569: Queue parking can precede asynchronous preparation; observe actual runtime admission before releasing held work.)
  • Canceled-input replay response keeps the original intent (703c82d: Expose durable cancellation causes and refuse same-ID replay instead of returning misleading cached success.)

Testing

Proof path: none.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6605569 adds test/gateway-steer-fifo.e2e.test.ts:463 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 660556970ac3; files: test/gateway-steer-fifo.e2e.test.ts)
  • Shakker: Raw commit bcc7cc9 adds test/gateway-steer-fifo.e2e.test.ts:1010 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bcc7cc90bb73; files: test/gateway-steer-fifo.e2e.test.ts)

PR surface

Tests +25. Total +25 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 33 8 +25
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 33 8 +25

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: Repairs a meaningful cancellation regression test whose replay expectation conflicts with the current Gateway contract, without changing production behavior.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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: Repairs a meaningful cancellation regression test whose replay expectation conflicts with the current Gateway contract, without changing production behavior.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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.

  • Confirm the reviewed head passes pnpm test:e2e:gateway test/gateway-steer-fifo.e2e.test.ts -t "withdraws a canceled CLI steer" in the supported built-runtime environment.

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 18, 2026, 2:31 PM ET / 19:31 UTC.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 18, 2026 19:52
@roboclaw-bot roboclaw-bot changed the title test: verify that a queued CLI steer is withdrawn before replay fix: report the same cancellation when a queued steer is replayed Nov 18, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: S and removed size: XS labels Nov 18, 2026
@roboclaw-bot
roboclaw-bot enabled auto-merge (squash) November 19, 2026 01:11
Baseline-Refresh: 11a5067bfc5914b62cbc97b0fa61371eff223ceb
Co-authored-by: steipete <[email protected]>
Baseline-Refresh: 562d3c4956499a905dc93b27aa1ceaff09aec1c8
Co-authored-by: steipete <[email protected]>
@roboclaw-bot
roboclaw-bot merged commit 7edc997 into main Nov 19, 2026
134 checks passed
@roboclaw-bot
roboclaw-bot deleted the flake/l99-steer-fifo-cancel branch November 19, 2026 10:04
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
…enclaw#201399)

* test(gateway): prove queued steer withdrawal before replay

* fix(gateway): replay queued steer cancellation consistently

* fix(gateway): scope steer cancellation to the chat address

* test(gateway): check revocation at the next request boundary

Co-authored-by: steipete <[email protected]>

* test(gateway): let admitted turns finish after a policy close

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>
roboclaw-bot added a commit that referenced this pull request Nov 28, 2026
Retain the publication transport exclusion from main while using the negotiated catalog capability for native clients. Integrating main also includes the queued-steer cancellation repair from #201399.

Co-authored-by: jjjhenriksen <[email protected]>

Co-authored-by: VACInc <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 28, 2026
…on retry

The submitted-input comparison discarded the pending row's disposition,
and a matching RAM fingerprint could replay success before reading the row.
Check the retained row before choosing a retry response so unconsumed
cancellation cannot look delivered. Report queued work as in flight only
with existing custody, without readmitting external retries.

Source commit: 703c82d
Source PR: #200533
Reference commit: 7edc997
Reference PR: #201399

Release adaptation: Hand-port only the read-only retry decision through the
existing SQLite and actor-memory snapshots. Use the schema-42 consumed link
and legacy Stop/dismissal flags instead of new end-cause columns. Do not port
crash replay, new abort-marker metadata, cancellation reopening, migrations,
or UI/protocol changes. Keep the exact graceful-replay admission bypass and
leave consumed, transcript, and completion idempotence intact.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…01399)

* test(gateway): prove queued steer withdrawal before replay

* fix(gateway): replay queued steer cancellation consistently

* fix(gateway): scope steer cancellation to the chat address

* test(gateway): check revocation at the next request boundary

Co-authored-by: steipete <[email protected]>

* test(gateway): let admitted turns finish after a policy close

Co-authored-by: steipete <[email protected]>

---------

Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7edc997)

Release adaptation: use stable pending-input dispositions and finishPendingInput, preserving consumed/transcript precedence and the original wire contract. Companion audit: replay/FIFO proof is adapted; later access-policy, partial-text, and run-less Stop changes are separate, not prerequisites.

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

docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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