Repository navigation
feat(ui): session-reset dividers + boundary markers for DB-backed sessions - #122222
Conversation
…backed sessions /reset now leaves a durable 'Session reset' divider at the transcript boundary in the Control UI. Root-cause fix underneath: the SQLite transcript projection only selected message events, so compaction (and now reset) markers never reached clients for DB-backed sessions; marker synthesis now has one owner (session-transcript-message.ts) consumed by both storage backends across full/recent/paged/by-id/anchor reads. Additive __openclaw marker kind 'reset' documented in clients.md.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
…ix CI gates Direct imports for the sqlite history readers (the session-accessor barrel is SDK-reachable via session-transcript-lock-runtime); reset marker added to the kept-tail chat.history expectation; lint naming fixes; marker tests split into session-transcript-readers.markers.test.ts.
|
Codex review: needs maintainer review before merge. Reviewed August 11, 2026, 3:58 PM ET / 19:58 UTC. ClawSweeper reviewWhat this changesThe PR makes SQLite-backed chat histories carry reset and compaction boundaries and renders reset boundaries as persistent Control UI dividers. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for normal maintainer review: current main demonstrably omits SQLite transcript boundaries, and the PR repairs the shared display projection without a blocking defect found in review. Priority: P2 Review scores
Verification
How this fits togetherTranscript events are stored in SQLite or legacy files, projected into Gateway chat-history rows, and rendered by the Control UI. Reset and compaction boundaries must survive that projection so operators can understand why history changed. flowchart LR
A[Transcript events] --> B[SQLite or file reader]
B --> C[History projection]
C --> D[Gateway chat history]
D --> E[Control UI chat]
E --> F[Boundary dividers]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +383, Tests +345, Docs +3. Total +731 across 16 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the shared boundary-aware history projection after ordinary exact-head maintainer review; retain message-only readers for usage and previews rather than duplicating marker placement in callers. Do we have a high-confidence way to reproduce the issue? Yes, from source: current SQLite history selection excludes boundary rows with no message position, while the file reader already has a synthetic compaction path. A local execution was not possible in this read-only environment. Is this the best way to solve the issue? Yes. A shared boundary-aware history projection is preferable to UI-side inference or changing the low-level message-only readers used for usage and preview extraction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6c485842b1fb. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…sions (openclaw#122222) * feat(ui): show session-reset dividers and fix boundary markers on DB-backed sessions /reset now leaves a durable 'Session reset' divider at the transcript boundary in the Control UI. Root-cause fix underneath: the SQLite transcript projection only selected message events, so compaction (and now reset) markers never reached clients for DB-backed sessions; marker synthesis now has one owner (session-transcript-message.ts) consumed by both storage backends across full/recent/paged/by-id/anchor reads. Additive __openclaw marker kind 'reset' documented in clients.md. * fix(gateway): keep history readers out of the plugin SDK barrel and fix CI gates Direct imports for the sqlite history readers (the session-accessor barrel is SDK-reachable via session-transcript-lock-runtime); reset marker added to the kept-tail chat.history expectation; lint naming fixes; marker tests split into session-transcript-readers.markers.test.ts.
What Problem This Solves
Two related gaps in the system-notice family that #122144 established:
/resetwrites atype:"reset"boundary into the transcript and the projection silently drops everything before it — the operator sees content vanish with only a transient command ack. After a reload (or from another client) there is no recorded explanation at all. Worst-bug-class material: an action whose durable outcome is nothing.readSessionTranscriptMessageEventsfamily) selects only message events, so the existing compaction divider never rendered for DB-backed sessions — the marker synthesis only existed in the legacy file-based reader (session-utils.fs.ts). Every mocked/unit proof injected history directly, which is why this was never caught.Why This Change Was Made
type:"reset"boundaries as the same synthetic marker message shape (__openclaw:{kind:"reset", id, seq}) already documented for compaction, and the Control UI renders it through the landed minimal divider family ("Session reset · The earlier conversation was cleared.",rotateCcwicon).src/gateway/session-transcript-message.ts, consumed by both the SQLite and file-based readers. The newsession-accessor.sqlite-history-events.tsprojects messages + boundaries across all client read shapes (full, recent tail, paged, count, by-id, anchor) and reuses the existing reset-window truncation owner; message-only readers remain for usage/title extraction where markers don't belong.docs/gateway/clients.mdgains thekind:"reset"sibling paragraph; compaction shape untouched.Config-reload was considered as a third divider kind and deliberately skipped: no producer records a per-session transcript fact for it (restart-sentinel already covers config-recovery restarts as a class-A notice).
User Impact
/resetleaves a durable, visible "Session reset" divider at the boundary — including after reloads and from other clients — with kept turns visible above it.Rendering (mocked fixture: restart-recovery notice + compaction + reset)
Evidence
OPENCLAW_STATE_DIR, port 19822, built dist): real chat turn (anthropic Haiku), real/compact→ compaction divider rendered live on the DB-backed session (it did not before this fix); real/reset→ "SESSION RESET" divider rendered between kept turns and post-reset content, with the projection's kept-entries retention visible.pnpm ui:i18n:baselineclean; deadcode exports scan clean;git diff --checkclean; Codex autoreview clean on the final bundle.