fix(ui): surface compaction checkpoints in chat history#76437
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Current main has a source-level reproduction path: gateway emits compaction markers, but the UI renders them as a generic Compaction separator with no recovery copy or action. Next step before merge Security Review detailsBest possible solution: Land the focused UI/docs change if maintainers accept the chat-level recovery affordance; keep deeper transcript stitching and reset-archive recovery in the existing gateway PRs tracking those paths. Do we have a high-confidence way to reproduce the issue? Yes. Current main has a source-level reproduction path: gateway emits compaction markers, but the UI renders them as a generic Compaction separator with no recovery copy or action. Is this the best way to solve the issue? Yes, pending maintainer UX approval. The PR is narrow because it preserves bounded chat.history behavior and points users to existing Sessions checkpoint APIs instead of replaying checkpoint transcript bytes in chat.history. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b258c3fc6578. |
a23a9a5 to
76e0bbd
Compare
Summary
Fixes #76415 by making compaction boundaries explicit in Control UI/WebChat history instead of letting refreshes look like earlier turns silently disappeared.
The narrow product choice here is to preserve the current bounded active-transcript
chat.historybehavior and add a chat-level recovery affordance:Compacted historydividers instead of a genericCompactionlabelOpen checkpointsaction that switches to the Sessions view, expands the active session's checkpoint panel, and refreshes checkpoint metadataBug / Current Behavior
Issue #76415 reports that after automatic compaction, a long Control UI/WebChat session reloads from the compacted successor transcript. The old full turn-by-turn transcript is retained in checkpoint/reset files, but normal chat history can make earlier messages look lost after refresh.
I verified the issue is still open and not already closed by a linked PR.
closedByPullRequestsReferencesis empty.Related PR Review
I checked related live PRs before opening this one:
gitcrawlwas stale for #76415 (local store last updated before the issue existed), so I fell back to live GitHub search.prtagswas installed and authenticated, but the prtags API returned 502 for list/search/write attempts, so duplicate-group writes could not be completed in this run.Security / Privacy
This PR intentionally does not read, stitch, replay, or expose archived/checkpoint transcript bytes through
chat.history.Security-relevant boundaries preserved:
sessions.compaction.*methods and server-side permissionsTests
RED proof first:
pnpm test ui/src/ui/chat/build-chat-items.test.ts ui/src/ui/views/chat.test.tsfailed before implementation because the builder emitted onlyCompactionand the view rendered no explanation/action.Passing proof:
pnpm test ui/src/ui/chat/build-chat-items.test.ts ui/src/ui/views/chat.test.ts— 27 tests passedpnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/web/webchat.md ui/src/styles/chat/grouped.css ui/src/ui/app-render.ts ui/src/ui/types/chat-types.ts ui/src/ui/chat/build-chat-items.ts ui/src/ui/chat/build-chat-items.test.ts ui/src/ui/views/chat.ts ui/src/ui/views/chat.test.ts— passedgit diff --check— passedtbx_01kqp0e8zndm2cng8ky8d9jpan:OPENCLAW_TESTBOX=1 pnpm check:changed— passed (core,coreTests,docslanes)Docs
Updated WebChat docs: https://docs.openclaw.ai/web/webchat