fix(control-ui): show archived transcripts and images after reset#77996
fix(control-ui): show archived transcripts and images after reset#77996Rene0422 wants to merge 2 commits into
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: this is a useful candidate for the linked archived transcript visibility bug, but it is not merge-ready because the branch is conflicting, the Gateway API registration is stale against current main, archive discovery is added to a hot Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main creates reset/deleted transcript archives but Is this the best way to solve the issue? No. The direction is useful, but this branch is not the best merge shape until it uses current Gateway/protocol ownership, avoids Security review: Security review cleared: No concrete supply-chain issue was found; the new archive read surface is sensitive but read-scoped and includes filename/path validation, leaving functional/API ownership as the blocker. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 010b61746379. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
@Rene0422 thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(control-ui): show archived transcripts and images after reset This is item 1/1 in the current shard. Shard 14/22. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
Summary
Fixes #77819. After a session reset, the prior
.jsonl.reset.<ts>and.jsonl.deleted.<ts>transcripts persisted on disk but were unreachablefrom the Control UI, so the conversation and its image attachments
looked deleted even though the data was retained.
directory and attach an
archivedTranscriptssummary to the agent'smain session row in
sessions.list. Add two additive RPCs under theread scope:
sessions.archived.list— lists archived transcripts (filename,archivedAt, reason, sessionId, sizeBytes, agentId).
sessions.archived.read— reads a specific archived transcript'smessages by filename. Validates the resolved path stays inside the
agent's sessions dir (path-traversal guard) and that the filename
matches the
<sessionId>.jsonl.(reset|deleted).<isoTs>shape.expanded panel with an inline viewer. The viewer renders text, image,
and attachment content blocks from the JSONL, so prior image
attachments come back as soon as you open one — no separate route
or download needed.
Image attachments were never deleted; they were stored in the archived
JSONL and just had no UI surface. The new viewer reads the same blocks
the live chat view consumes, including base64
image/*sources.Affected surfaces
sessions.listpayload: each agent main row may now carryarchivedTranscripts: ArchivedTranscriptPreview[](additive).sessions.archived.list/sessions.archived.read(read-scoped, additive — third-party clients are unaffected).
transcripts exist, even without compaction checkpoints.
Real behavior proof
Behavior or issue addressed: After
sessions.reset, archived.jsonl.reset.<ts>transcripts persisted in the agent sessions directory but were unreachable from the Control UI, so the prior conversation and its image attachments looked deleted. This change attachesarchivedTranscriptsto the agent's main session row insessions.listand adds two read-scope Gateway RPCs (sessions.archived.list,sessions.archived.read) that the Sessions view consumes to render archived transcripts inline. Fixes WebChat history after session reset hides archived sessions and loses image attachment display #77819.Real environment tested: Linux x86_64, Node v24.14.0, pnpm 10.33.2. OpenClaw built from this branch via
pnpm build(commit76f6758). Gateway run vianode openclaw.mjs --dev gateway run --port 19001(loopback bind, token auth, dev profile under~/.openclaw-dev).Exact steps or command run after this patch:
pnpm install && pnpm buildnode openclaw.mjs --dev gateway run --port 19001(background)~/.openclaw-dev/agents/dev/sessions/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d.jsonl.reset.2026-05-05T10-00-00.000Zwith a user message containing a text block + a base64image/pngblock, and an assistant reply. Standard archive shape produced bysessions.resetpersrc/gateway/session-transcript-files.fs.ts.sessions.listagainst the running gateway viaopenclaw --dev gateway call <method> --params '<json>' --json.sessions.archived.readwith a path-traversal filename to confirm rejection.Evidence after fix:
Observed result after fix:
sessions.archived.listreturns the archived transcript withreason: "reset", the originalsessionId, parsedarchivedAtepoch, andsizeBytes.sessions.archived.readreturns the prior user/assistant messages with the user message'simagecontent block intact —source.media_type: "image/png"and the full base64datapayload survive end-to-end, which is what the Control UI's archived-transcript viewer renders inline asdata:image/png;base64,<data>. The traversal request was rejected at schema validation (theArchivedTranscriptFileNameSchemaregex), before the handler even ran.sessions.listnow carriesarchivedTranscriptson theagent:dev:mainrow, which is the field the Sessions view's expanded panel consumes.What was not tested: macOS and Windows hosts. Control UI click-through was not exercised in this proof — the verified surface is the Gateway RPC payload the UI consumes; the rendering side is covered by the existing UI vitests in
ui/src/ui/views/sessions.test.ts.Test plan
pnpm tsgo:core:all— cleanpnpm lint:core— cleanpnpm format:check(touched files) — cleansrc/gateway/session-transcript-files.archive-discovery.test.ts(4 tests: enumeration, sort order, path traversal rejection,
missing-file rejection)
src/gateway/server.sessions.archived.test.ts(3 tests: end-to-endsessions.archived.list,sessions.archived.readwith base64image payload preserved, traversal + missing rejected)
pnpm test src/gateway/server.sessions.archived.test.ts src/gateway/session-transcript-files.archive-discovery.test.ts src/gateway/session-transcript-files.fs.archive-events.test.ts src/gateway/server.sessions.list-changed.test.ts src/gateway/server.sessions.reset-hooks.test.ts src/gateway/server.sessions.reset-models.test.ts src/gateway/server.sessions.store-rpc.test.ts ui/src/ui/views/sessions.test.ts ui/src/ui/controllers/sessions.test.ts— 71/71 passing.:19001, reset a session, confirmthe archived transcript shows up in the Sessions row's expanded
panel and that opening it renders the prior messages and images.
Closes #77819.