Skip to content

fix(sessions): keep accepted input active during transcript rewrites - #138967

Merged
fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/nimbus-transcript-custody-current-20260905
Sep 5, 2026
Merged

fuller-stack-dev merged 1 commit into
openclaw:mainfrom
fuller-stack-dev:fix/nimbus-transcript-custody-current-20260905

Conversation

@fuller-stack-dev

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where an accepted chat message could disappear from the active transcript and fail with Pending input is no longer active in its admitted transcript when maintenance rewrote earlier history during the same turn.

Why This Change Was Made

Transcript rewrites create new event IDs for the copied active suffix, but accepted-input custody remained bound to the old event ID. This change keeps immutable request identity separate from the current transcript location. Only the exact keyed user owned by the live admitted turn may move that location, and the move becomes visible only after the SQLite rewrite commits.

The existing inactive-branch, ownership, and idempotency checks remain in force. This does not add a generic retry, change schemas, alter provider behavior, or weaken the keyed-turn safety checks.

User Impact

Accepted chat input remains visible and replayable when transcript maintenance truncates or replaces earlier history. Direct and collected inputs both retain one active user entry through repeated rewrites, including context-excluded inputs.

Evidence

  • Current upstream 961464a5177e02cf037b7783fed0dc842619f16d: all four synthetic direct/collected and context-exclusion variants fail with the exact admitted-transcript error.
  • Exact head 3da9a361da67cad12fae63c116f2503f34a04644: all four variants pass, including repeated rewrites, replay against the relocated event ID, and closed-owner terminal replay.
  • Focused and adjacent sweep: 200 tests passed across transcript rewriting, pending-input custody, user-turn media/persistence, interrupted replay, chat admission, and requester-wake coverage.
  • Negative controls cover unauthorized caller-checks, transaction rollback, stale source IDs, closed owners, and aggregate receipt consumption.
  • Source-blind behavior validation passed 5/5 clauses and repeated the green head run.
  • Fresh autoreview found no actionable P0 defect.
  • OPENCLAW_TESTBOX=1 pnpm check:changed: passed on the exact head in Testbox.

The merged keyed-compaction repair #133094 and accepted-send retry repair #137267 are both present in the reproduced base. Neither covers event-ID relocation during a transcript rewrite.

Worked on by

@clawsweeper

clawsweeper Bot commented Sep 5, 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: M maintainer Maintainer-authored PR labels Sep 5, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 5, 2026
@clawsweeper

clawsweeper Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 5, 2026, 4:38 AM ET / 08:38 UTC.

ClawSweeper review

What this changes

Keeps accepted user input on the active transcript when history maintenance copies messages to new entries, with regression coverage for replay and ownership.

Merge readiness

⛔ Blocked before merge - 1 item remains

This remains a useful repair: current main and the latest release lack accepted-input relocation, and the linked merged repairs address different failures. No blocking introduced defect was found.

Priority: P1
Reviewed head: 3da9a361da67cad12fae63c116f2503f34a04644

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with meaningful persistence regressions and no blocking introduced finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored internal session repair is exempt from the contributor proof gate. Reported SQLite rewrite/replay tests are supplemental evidence, not a claimed live chat run; inspection found no unresolved authority case requiring additional final-effect proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored internal session repair is exempt from the contributor proof gate. Reported SQLite rewrite/replay tests are supplemental evidence, not a claimed live chat run; inspection found no unresolved authority case requiring additional final-effect proof.
Evidence reviewed 12 items Introduced change and merge identity: The verified test merge has the pinned main commit followed by the exact PR head as its raw parents. Its changes against main match the seven introduced paths; unrelated base-branch changes are not attributed to this PR.
Current-main defect remains: Current main uses the immutable inputId as the transcript location. Its rewrite, pending-input owner, and message-append modules are unchanged from the reproduced base, so copying the accepted user still encounters the old-entry replay checks.
Latest-release comparison: The supplied latest release, v2026.9.1, also has a single immutable inputId and no relocation context or mutable transcript location.
Findings None None.
Security None None.

How this fits together

OpenClaw stages accepted chat input before the agent processes it. Transcript maintenance copies conversation history into a new branch, and input custody must follow the committed copy so retries recognize the same accepted message.

flowchart LR
  A[Accepted chat input] --> B[Live input owner]
  B --> C[Persisted user message]
  C --> D[History rewrite]
  B --> E[Validate exact relocation]
  D --> E
  E --> F[SQLite commit]
  F --> G[Updated transcript location]
  G --> H[Replay existing message]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +60, Tests +176. Total +236 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 5 77 17 +60
Tests 2 176 0 +176
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 253 17 +236

Review metrics

Metric Value Why it matters
Production versus test growth Production net +60 lines; tests net +176 lines Production growth establishes distinct admission and transcript-location identities plus commit-scoped relocation; tests exercise persistence and lifecycle invariants.

Stored data model

Persistent data-model change detected: serialized state: src/config/sessions/session-accessor.sqlite-pending-inputs.ts, unknown-data-model-change: src/config/sessions/session-accessor.sqlite-pending-inputs.ts, unknown-data-model-change: src/config/sessions/session-accessor.sqlite-transcript-message-append.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep immutable admission identity separate from the commit-published transcript location; the additional scoped state preserves ownership without changing stored formats.

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

Yes, source establishes the path: promote accepted input, rewrite an earlier entry, then replay the accepted user against its old entry ID. The PR reports failing base cases; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes. Updating location at the existing custody and commit boundaries preserves exact replay checks; resolving by idempotency key alone would lose the distinction between authorized relocation and an unrelated replacement branch.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bf90b12fe515.

Labels

Label changes:

  • add P1: The repair addresses accepted chat input disappearing from the active transcript and interrupting an agent turn during history maintenance.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored internal session repair is exempt from the contributor proof gate. Reported SQLite rewrite/replay tests are supplemental evidence, not a claimed live chat run; inspection found no unresolved authority case requiring additional final-effect proof.

Label justifications:

  • P1: The repair addresses accepted chat input disappearing from the active transcript and interrupting an agent turn during history maintenance.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This MEMBER-authored internal session repair is exempt from the contributor proof gate. Reported SQLite rewrite/replay tests are supplemental evidence, not a claimed live chat run; inspection found no unresolved authority case requiring additional final-effect proof.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • 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.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@fuller-stack-dev
fuller-stack-dev merged commit f4fa8a6 into openclaw:main Sep 5, 2026
371 of 373 checks passed
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

@VACInc

VACInc commented Sep 7, 2026

Copy link
Copy Markdown
Member

The complementary atomic transcript-publication repair #138984 has merged as b0ae5b6.

It retains the existing accepted-input authority and transaction-local relocation behavior while publishing the replacement history coherently. Recorded regression coverage includes active versus closed/replaced admission, rejection before durable changes, input custody, and reader agreement after rewrites.

This is follow-through on the shared transcript lifecycle, not a claim that the earlier input-ownership repair was unnecessary or replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

2 participants