Skip to content

fix: status checks no longer cancel active replies - #192585

Merged
obviyus merged 2 commits into
mainfrom
investigate/status-conflict-192522
Nov 4, 2026
Merged

obviyus merged 2 commits into
mainfrom
investigate/status-conflict-192522

Conversation

@obviyus

@obviyus obviyus commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #192522. Thanks to @alexph-dev for the report.

What Problem This Solves

Fixes: checking /status while a reply is running can cancel the reply with a transcript conflict and lose the pending answer.

User Impact

Users can check status without interrupting their active reply; the status exchange remains visible in history without entering model context. Ordinary commands retain their existing behavior.

Why This Change Was Made

The delivered-command recorder dropped the existing read-only status classification. Preserve that classification through the shared transcript mirror and stamp both messages using the existing context-free markers. Transcript mutation fences, transactions, schema, retention and retry behavior are unchanged; no migration or configuration action is needed.

Evidence

Built Gateway on Node 24.22.1, with a network-held local model response and native Telegram /status in the same forum topic:
Sanitized runtime receipts.

Case Main 0c0875810a6c Candidate 66ed7177e35b
Status during active model request, twice Status delivered, then transcript conflict; original answer neither delivered nor persisted Status correct; original answer delivered and persisted once; no conflict
No-status control Completes Completes

Each case made one model request and ended with no pending inputs. Main logged ReplaySafeTranscriptConflictError with the SQLite transcript-changed error; candidate retained both existing context-free markers on the status input and reply.

Also exercised the exact candidate through the repository's Telegram Test Server userbot runner: actual user request at 0.24s, native /status at 20.41s, bot status at 22.99s, original final answer at 24.09s after releasing the held response. The model request preceded status, both status messages were marked, and the final answer was persisted exactly once. Lease released and credential scratch removed.

Focused checks: 68 cases pass across command transcript, session manager and transcript suites. The parameterized command-transcript regression fails on main (missing markers) and passes with the fix; its ordinary-command control passes on both. Candidate build, changed-file lint and formatting pass. No broad local suite was run.

The simplification pass kept the existing recorder and storage guards: production net +20 lines, tests net 0, docs net +2. No new retry or transcript-rebase machinery.

Merge danger: two-way code change, with no migration or destructive writes. Reverting restores the prior classification of future status records; already written history is not rewritten. Blast radius is shared delivered-command transcript recording across channels; ordinary commands must remain context-bearing.

@clawsweeper

clawsweeper Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@obviyus

obviyus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: S labels Nov 4, 2026
@obviyus

obviyus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Exact-head runtime proof

Candidate: 66ed7177e35bab577cb74f84f2e3deab8ddc662a; baseline: 0c0875810a6ced55235a855a7e10499ecf5a8a87. Node 24.22.1, built Gateway and native Telegram adapter; local provider held its real response until /status was delivered and persisted. No injected storage failure or clock changes.

                              main x2             candidate x2
status reports active model   yes                 yes
status transcript pair        ordinary messages   both context-free markers
original final delivered      no                  yes, once
original final persisted      no                  yes, once
transcript conflict           yes                 no
model requests per turn       1                   1
pending inputs at end         0                   0
no-status control             completes           completes

Baseline logs contain the SQLite transcript-changed error wrapped in ReplaySafeTranscriptConflictError, followed by the generic user-facing failure. The error wrapper is why a leaf-name-only detector is insufficient; the raw log and missing final answer establish the failure.

Actual Telegram Test Server userbot evidence on the same candidate (identities removed):

0.242s   real user: Please answer with STATUS_TURN_192522_COMPLETE only.
20.406s  real user: /status
22.989s  SUT bot: status reports model openai/gpt-5
24.092s  SUT bot: STATUS_TURN_192522_COMPLETE

The model request was observed before /status; the real status input/reply both carry the context-free pair; the final answer was persisted exactly once with one model request. The maintained runner completed and stopped its consumers; the host-owned broker lease was released and credential scratch removed. These are recorded message events, not reconstructed screenshots or a real-provider claim.

@obviyus
obviyus marked this pull request as ready for review November 4, 2026 06:08
@obviyus

obviyus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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 4, 2026
@clawsweeper

clawsweeper Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves the context-free classification of delivered status commands when recording their input and reply in conversation history.

Example: Send /status in a Telegram forum topic while waiting for STATUS_TURN_192522_COMPLETE.

  • Before: Status arrives, but a transcript conflict prevents the original answer from completing.
  • After: Status remains visible in history, and the original answer is delivered and persisted exactly once.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A small root-cause repair with shipped-entry-point proof, a base-failing recording regression, an ordinary-command control, and existing continuation/reopen coverage; required CI is still pending.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): Exact-head receipts exercise the built Gateway, native Telegram adapter, and actual Test Server userbot with a network-held model response: status is delivered during active work, both status messages retain their markers, and the original answer is delivered and persisted once.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Checking status during active work can cancel the pending answer.
Reason: The maintainer-authored change restores an established status contract, preserves delivered history, and directly addresses the reported failure.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a verified active-reply failure with a focused change and convincing Telegram runtime evidence; no actionable defects were found, and required CI remains pending.

Priority: P1
Reviewed head: 66ed7177e35bab577cb74f84f2e3deab8ddc662a

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared reply dispatcher passes delivered command exchanges to the session transcript owner, whose stored metadata controls model-context inclusion and safe continuation of active turns.

flowchart TD
  A[Authorized status command] --> B[Context-free reply payload]
  B --> C[Channel delivery]
  C --> D[Delivered-command recorder]
  D --> E[Session transcript owner]
  E --> F[Visible conversation history]
  E --> G[Active turn continues]
Loading

Technical review

Best possible solution:

Preserve the existing status classification through the shared recorder while retaining ordinary-command context and all transcript mutation guards.

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

Author-supplied baseline receipts reproduce transcript conflicts during concurrent status checks, and source confirms the relevant production modules remain unchanged on fetched main; this read-only review ran no reproduction.

Is this the best way to solve the issue?

Yes: restoring metadata at the existing recording boundary fixes the demonstrated cause without weakening storage fences, adding retries, or creating another owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Delivered-command history and transcript persistence changes intended behavior with a stated reason (289d859: Retain successfully delivered slash commands and replies as replayable conversation history.)
  • Context-free status behavior keeps the original intent (49fe70f: Keep status visible without introducing model input or invalidating active work.)
  • Command-history documentation changes intended behavior with a stated reason (d234a68: Document retained native command exchanges and their availability in later conversation context.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 289d859 adds src/auto-reply/reply/dispatch-from-config.transcript.ts:62 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 289d859c2bab; files: src/auto-reply/reply/dispatch-from-config.transcript.ts)
  • Peter Steinberger: Raw commit 668e5e8 adds src/auto-reply/reply/dispatch-from-config.transcript.ts:34 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 668e5e8096ad; files: src/auto-reply/reply/dispatch-from-config.transcript.ts)

PR surface

Source +20, Tests 0, Docs +2. Total +22 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 20 0 +20
Tests 1 54 54 0
Docs 1 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 77 55 +22

Review metrics

Metric Value Why it matters
Production versus test growth Production +20/-0; tests +54/-54 Production growth carries and persists existing classification through current owners; the existing integration test is extended without net test growth.

Labels

Label changes:

  • add P1: A routine status check can abort an active channel request and leave its answer undelivered.
  • add merge-risk: 🚨 compatibility: The SDK-exported command recorder gains an optional classification parameter; the maintainer-authored narrow repair preserves existing callers and the established stored-message format.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: A routine status check can abort an active channel request and leave its answer undelivered.
  • merge-risk: 🚨 compatibility: The SDK-exported command recorder gains an optional classification parameter; the maintainer-authored narrow repair preserves existing callers and the established stored-message format.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 4, 2026, 1:14 AM ET / 06:14 UTC.

@obviyus
obviyus merged commit c2cb56c into main Nov 4, 2026
239 checks passed
@obviyus
obviyus deleted the investigate/status-conflict-192522 branch November 4, 2026 06:36
@obviyus

obviyus commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

Landed in c2cb56c. Using /status during a running turn no longer loses the turn's answer.

github-actions Bot pushed a commit to Anti-RombikAnti-Rombik8790/openclaw that referenced this pull request Nov 4, 2026
fix: keep the running turn alive when /status is used mid-turn

Fixes #192522.

Sending `/status` while a turn was still running wrote to the session transcript at the same time as the turn. The running turn then hit `SqliteTranscriptMutationConflict` and its answer was lost. `/status` no longer conflicts with the active turn: the status reply is delivered, and the original answer is still delivered and saved exactly once. No schema, transaction, retention or mutation-fence changes.

Evidence: built Gateway on Node 24.22.1. On main, both active-turn `/status` races failed with transcript conflicts and lost the answer; with this change both passed and the original answer was delivered and saved once. No-status controls passed on both refs. A real Telegram Test Server userbot saw `/status`, the correct status reply and then the original final answer, with one model request and the final answer saved once. Details: openclaw/openclaw#192585 (comment).

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 5, 2026
fix: keep the running turn alive when /status is used mid-turn

Fixes openclaw#192522.

Sending `/status` while a turn was still running wrote to the session transcript at the same time as the turn. The running turn then hit `SqliteTranscriptMutationConflict` and its answer was lost. `/status` no longer conflicts with the active turn: the status reply is delivered, and the original answer is still delivered and saved exactly once. No schema, transaction, retention or mutation-fence changes.

Evidence: built Gateway on Node 24.22.1. On main, both active-turn `/status` races failed with transcript conflicts and lost the answer; with this change both passed and the original answer was delivered and saved once. No-status controls passed on both refs. A real Telegram Test Server userbot saw `/status`, the correct status reply and then the original final answer, with one model request and the final answer saved once. Details: openclaw#192585 (comment).

Co-authored-by: Ayaan Zaidi <[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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. 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.

[Bug]: /status sent during an agent turn kills the turn with SqliteTranscriptMutationConflictError (request dropped)

1 participant