openclaw icon indicating copy to clipboard operation
openclaw copied to clipboard

[Bug]: 2026.12.1 publishes a steered message's target commit again after the next steered message's commit

Open eliavb43 opened this issue 3 days ago • 1 comments

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

On 2026.12.1, when two messages are steered into one running run, the first message's session.message commit (the one carrying __openclaw.steerTargetRunId) is published a second time after the second message's commit; on 2026.11.13 each steered message is published with its target once.

Steps to reproduce

  1. Start a Gateway (2026.12.1) with a model that keeps a run busy for several seconds (a scripted model that answers one word a second works).
  2. Subscribe to session.message for the session (WebSocket client, sessions.messages.subscribe).
  3. chat.send message M1 so a run starts, then chat.send message A and then message B while that run is still active (both are accepted as steered into M1's run).
  4. Log, in order, each session.message with message.role === "user": its __openclaw.idempotencyKey and __openclaw.steerTargetRunId.

We saw this through an Open WebUI integration that does exactly these three sends (its browser end-to-end tests test_a_reply_interrupted_while_queued_says_its_message_went_with_the_next and test_messages_sent_from_other_tabs_while_a_reply_runs_are_answered_together), not with a bare client; the bare-client steps above are the same calls.

Expected behavior

As on 2026.11.13: each steered message is committed with its steerTargetRunId once, in the order they were accepted. The log of user commits for M1, A, B ends with B's target commit.

Actual behavior

On 2026.12.1, A's commit with steerTargetRunId arrives again after B's commits:

A (first commit)
A (second commit, steerTargetRunId = M1's run)
B (first commit)
B (second commit, steerTargetRunId = M1's run)
A (steerTargetRunId = M1's run again)     <- new
B (again)                                 <- new

On 2026.11.13 the same test gives only the first four lines. A client that applies "this message was steered into run X" for every commit that names a target (we did) therefore moves the run's reply from B back to A and ends B's reply: nobody shows B's answer, although the model received both messages and answered. Same result on 2026.12.1 with three messages (the other test).

The cause looks like the new stampSteer call in markRuntimePersisted (src/sessions/user-turn-transcript.ts, 2026.12.1 line 668: admissionWrite = admission.then(() => runInDetachedAsyncContext(() => stampSteer(runId)))). Its comment says it is a no-op when the committed row already names the run, yet a commit naming the target is published again after the next message's. We did not trace why the row counts as changed; confirmPersistedSteerTargetRunId only rewrites and publishes when it does. stampSteer is unchanged on main (a3f814be63f, 2026-12-03).

Bisect on our side: same integration code with 2026.11.13 passes, with 2026.12.1 fails; four different integration commits all fail on 2026.12.1.

OpenClaw version

2026.12.1 (fails), 2026.11.13 (passes)

Operating system

Linux (Ubuntu, GitHub Actions runner), Node 26.14.0

Install method

npm global (npm install -g [email protected])

Model

scripted OpenAI-compatible test model (fake/e2e-default)

Provider / routing chain

openclaw -> local scripted model

Logs

Our diagnostic log of the commits (per user commit: idempotency key suffix, whether it named a target) is in the CI run artifacts of https://github.com/Eliav2/openclaw-openwebui-integration/actions/runs/47035204160 (2026.12.1) and https://github.com/Eliav2/openclaw-openwebui-integration/actions/runs/47036392190 (2026.11.13), artifact e2e-logs-diag451-4 / e2e-logs-diag451-1113-4, file open-webui.log, lines DIAG451.

Impact and severity

Medium: a client that reacts to the steer target of each commit shows no answer for the last steered message. Clients that ignore repeat commits are not affected. We now ignore a repeat commit on our side.

Thanks!

eliavb43 avatar Dec 03 '26 04:12 eliavb43

Codex review: this still needs some work.

Summary Keep open: the report identifies a concrete failure on an official release that can hide replies in a subscribing client. Current source does not establish the suspected cause or demonstrate a fix.

Reproducibility: I did not run a reproduction; the reporter supplies concrete release comparisons, but current source guards unchanged stamps and the linked diagnostic logs were inaccessible.

Next step Reproduce the three-send sequence and capture full repeated message payloads with publication origins before choosing an upstream repair.

Review details

Best possible solution:

Preserve valid transcript updates while ensuring repeated steering facts cannot move reply ownership backward.

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

I did not run a reproduction; the reporter supplies concrete release comparisons, but current source guards unchanged stamps and the linked diagnostic logs were inaccessible.

Is this the best way to solve the issue?

Removing the post-admission stamp is not yet justified because it preserves steering provenance; first identify what changed between repeated publications and retain legitimate metadata updates.

AGENTS.md: found and applied where relevant.

Remaining risk / open question:

  • The diagnostic logs could not be inspected, and no live reproduction was run.
  • Full repeated payloads and their publication origins are needed to distinguish redundant stamping, another metadata rewrite, and delayed snapshot publication.

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

Label changes

Label changes:

  • add P2: A specific multi-steer integration flow can hide an answer, with a reported client workaround and no demonstrated broader outage.
  • add impact:message-loss: The subscribing client reportedly suppresses the last steered message's answer after reapplying an earlier steering target.
  • add issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.
  • add clawsweeper:needs-info: Current issue advisory state selects this label.
  • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
  • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.

Label justifications:

  • P2: A specific multi-steer integration flow can hide an answer, with a reported client workaround and no demonstrated broader outage.
  • impact:message-loss: The subscribing client reportedly suppresses the last steered message's answer after reapplying an earlier steering target.
Evidence reviewed

Acceptance criteria:

  • Exercise M1 followed by A and B through chat.send while subscribed to session.message and identify the origin of every repeated target observation.
  • Verify that the last steered message retains its answer when a prior message snapshot arrives again.
  • Establish a regression that fails before any repair and passes afterward, including confirmation before and after runtime persistence.
  • Run the touched recorder and Gateway event tests plus targeted type, lint, and format checks after a repair.

What I checked:

  • Concrete affected-release report: The reporter compares official npm releases 2026.12.1 and 2026.11.13 with unchanged integration code, describes three chat.send calls, and records repeated steering-target observations followed by a hidden reply; the sole issue comment is an automated review-status message.
  • Suspected call remains on current main: markRuntimePersisted schedules stampSteer after admission when a target run has been confirmed; its comment explicitly expects an unchanged target to be a no-op. (src/sessions/user-turn-transcript.ts:674, a3f814be63f6)
  • The extra call alone does not prove duplicate publication: confirmPersistedSteerTargetRunId returns no replacement when the saved target and supplied native identity already match; publication requires a rewrite result, and the ordinary anchor rewrite returns null for an unchanged callback. (src/sessions/user-turn-transcript-updates.ts:36, a3f814be63f6)
  • Publication can observe a later saved snapshot: Gateway publication rereads the stored message by ID because queued append notifications can cross rewrites; repeated target observations therefore do not establish which producer changed or published the row. (src/gateway/server-session-events.ts:488, a3f814be63f6)
  • Existing tests do not settle event ordering: The recorder tests verify saved steering metadata when confirmation happens before or after runtime persistence; these cases do not exercise two steers and assert the resulting WebSocket publication sequence. (src/sessions/user-turn-transcript.test.ts:659, a3f814be63f6)
  • History explains the stamp's purpose: Merged https://github.com/openclaw/openclaw/pull/202139 introduced the post-admission stamp to retain steering provenance without blocking acceptance, including plugin steering; this establishes intent, not that it caused the reported regression. (src/sessions/user-turn-transcript.ts:674, c3d658254b08)
How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

Reviewed December 2, 2026, 11:50 PM ET / December 3, 2026, 04:50 UTC.

clawsweeper[bot] avatar Dec 03 '26 04:12 clawsweeper[bot]