Repository navigation
fix: show completed task transcripts after cleanup - #157247
Conversation
Read retained task archives through the existing worker owner, preserving active branches, exact run and generation binding, current access, and bounded display context. Keep live and cron reads bound to their physical transcript. Use disposable navigation storage and reject task preview records above 8 MiB before parsing. Retention and completion delivery remain unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 1:17 PM ET / 17:17 UTC (Revision 11). ClawSweeper reviewWhat this changesThe branch lets the Tasks inspector page through completed subagent conversations after session cleanup by reading retained SQLite archives and shows a non-retryable message when a record exceeds the preview limit. Merge readiness✅ Ready for maintainer review Keep open. Current main and the latest release still depend on the live child session for this read. The branch has credible runtime and access-control proof, and I found no actionable defect in the introduced change. The documented 8 MiB preview limit was explicitly accepted in the PR discussion. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway's task-history request turns task records and session transcripts into pages for the Control UI Tasks inspector. After cleanup removes a child session, the retained SQLite archive supplies its transcript, subject to Gateway access checks. flowchart LR
A[Task record] --> B[Gateway task history]
C[Viewer identity] --> D[Access check]
B --> D
D --> E[Retained SQLite archive]
E --> F[Message projection]
F --> G[Tasks inspector]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +1781, Tests +1731, Docs +15, Other +46. Total +3573 across 49 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep archived task pages bound to the original run and generation, enforce current access at publication, and retain the documented preview limit. Do we have a high-confidence way to reproduce the issue? Yes. Current main loses the live child-session route after cleanup, and the PR records a failing registered archive/delete case before the repair; I did not execute it in this read-only review. Is this the best way to solve the issue? Yes. Reading the retained archive through its existing worker owner addresses the missing transcript while binding pages to the run and preserving current sharing checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6e8d06876fd1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
The capacity error now reaches the Tasks panel with its useful explanation. A retained record above the 8 MiB preview limit keeps history intact and no longer offers a Retry action that cannot help. The wording also covers an oversized candidate from another generation of the same session key; it does not blame the requested task. Other transient history errors retain Retry. These inspected synthetic screenshots use registered error responses through the existing mock Gateway and actual Control UI renderer. They demonstrate rendering; registered RPC and archive framer tests separately cover backend behavior. The after image reflects the final candidate-scope wording. Before: After: |
|
@clawsweeper re-review The remaining final-effect proof requested in revision 3 is now in the PR body under “Authenticated Gateway transport proof on 36b8ed8.” It records final frames from one isolated real Gateway with normal authenticated synthetic clients and real cleanup/archive: authorized history delivery, parent-authorized restricted denial, normal role revocation retiring the in-flight connection without a history frame, and denial after reconnecting the same paired device with its reduced role. The scheduling barrier only pauses real archive verification and supplies no authority or response. The focused proof passed; its fixture-only first failure is disclosed. The current head also contains the typed capacity-error UI consumer and the corrected existing transcript mock. Both inspected before/after image pairs render in this PR; the capacity pair is linked from the body. Please assess the updated evidence and current head through the ordinary review workflow. |
|
🦞👀 Re-review progress:
|
|
Revision 4 disposition and current-head correction The revision 4 same-key archive finding is an explicit maintainer-accepted availability limitation, not a claim that the blocking behavior was removed. After inspecting the retained schema and reader, we are preserving fail-closed unique-generation selection: archive rows have no independent run-membership index, and an unreadable candidate cannot safely be excluded. Skipping it could overlook another matching run. An ad hoc streaming JSON selector would add substantial correctness and maintenance cost for this exceptional record size; a durable index would require a separate storage-contract change. Head The normal current-head review can reconcile revision 4 against this explicit tradeoff and accurate user-facing contract. The authenticated transport evidence already accepted in revision 4 is unchanged. The PR body retains the limitation and proof; the capacity after screenshot now shows this exact wording and was inspected, chat-delivered, uploaded and visually verified in the existing screenshot comment linked from the PR body. |
|
Merged via squash auto-merge.
|
* fix: show completed task transcripts after cleanup Read retained task archives through the existing worker owner, preserving active branches, exact run and generation binding, current access, and bounded display context. Keep live and cron reads bound to their physical transcript. Use disposable navigation storage and reject task preview records above 8 MiB before parsing. Retention and completion delivery remain unchanged. * chore: document task history SQLite boundaries * fix: enforce archived task preview access and capacity errors * fix: show permanent task preview limits in the inspector * fix: clarify archived task preview capacity limits * test: align archived task capacity assertion


What Problem This Solves
Fixes finished sub-agent tasks showing “No transcript messages yet” after
cleanup: "delete", despite an existing retained transcript.User Impact
The Tasks inspector can show and page through retained conversations after cleanup, including failures before the first assistant reply. No migration or configuration change is needed; retained archive bytes are unchanged.
Deleted child sessions no longer have sharing metadata. Archive previews therefore require existing access independent of those missing facts, such as Gateway administrator access. Profile-scoped readers keep normal sharing checks while the child session is retained; access to the parent task does not establish the deleted child's entitlement.
A single archived record above 8 MiB makes this preview unavailable, including when it belongs to another retained generation with the same session key. Run membership is stored inside the records, so an unreadable candidate prevents a unique match even if the requested run’s own archive is small. Tasks explains this permanent limit without suggesting refresh or offering an ineffective retry. Existing messages remain visible if an older page fails. Ordinary transient failures keep their retry action.
Why This Change Was Made
Cleanup removes the live alias that Tasks previously queried. The existing archive worker now reads the exact run and active archive generation, using the canonical branch selector and chat projection for redaction, coordination, recovered errors, heartbeat boundaries, and size notices. Shared header timestamp handling filters inherited pre-start announce pairs after a fork while retaining current acknowledgements.
Live and cron reads bind to the physical transcript through the existing worker owner. Paging and final publication revalidate the recorded generation, current task and sharing authority, preventing alias reuse from selecting a different conversation. Harness history is unchanged.
Disposable SQLite scratch storage bounds navigation state. The reader rejects records above 8 MiB before concatenation or parsing; ordinary oversized records retain the existing size notice. Completion delivery's final-answer scanner remains unchanged. A structured capacity detail carries the safe error through the Tasks UI while preserving generic retry behavior.
Evidence
The registered regression failed after real archive/delete cleanup and now returns retained messages and valid cursors. All six archive cases pass, covering forked history, heartbeat and hidden context, failure-only runs, coordination and pagination. The same fixture verifies allowed retained reads, profile-scoped live access, missing-entitlement denial, revocation during awaited verification and capacity-error mapping. The earlier 36-case archive/payload and 35-case live-binding groups also passed.
Hosted review identified the same-key candidate availability limit above. Maintainer source review accepts it explicitly: archive rows contain no independent run index, and skipping an unreadable candidate would weaken unique-generation selection. The behavior remains a documented limit, not a fixed availability defect. The later exact-head hosted review accepted this explicit tradeoff and retained its sufficient runtime/access proof verdict. The correction makes the message accurate and extends the existing owner fixture to verify refusal during both initial lookup and binding revalidation. The focused case passed in 7.01s (36.49s command wall including cold worker compilation); the registered error capture took 14.13s. Seven scoped static checks and fresh delta review passed.
The capacity UI regression failed on both initial and older-page errors before the consumer correction. All 44 Tasks detail/state tests now pass, including generic retry behavior and retention of already-loaded content. Exact synthetic registered RPC responses supply the browser evidence below.
Hosted CI exposed two integration issues: missing local Kysely boundary annotations, corrected with byte-identical emitted JavaScript, and an enumerated transcript mock that omitted the new pure failure-run helper. The corrected mock retains the real module and overrides only its event sink; the exact failed file now passes all 226 tests. The original failed logs remain retained; five sibling CI jobs were cancelled rather than independently failing. Canonical protocol generation/check passes, including the generated Swift detail-union arm. Consumer review raised a possible queued-refresh interaction; source inspection rejected it because every page scans the whole archive before filtering, so an unchanged archive cannot fail capacity only on an older page and then have a successful tail. A successful later tail represents readable source and should recover. The original review and its disposition remain retained. All selected static checks passed. CI passed on
36b8ed8114a1. The later wording head exposed a stale registered-test substring; the typed capacity error was correct, and the corrected assertion now passes with all six existing registered archive cases (51.78s command wall, including 15.22s cold worker compilation; the formerly failing case took 6.34s). Scoped lint/format/diff and fresh delta review pass, with no production or media change. The same run also had an iOS checkout-only timeout before any build/test, an intervening-main shared-client lifetime fixture race, and a 120-second planner-test timeout. The lifetime race is separately fixed on main in619405d49dddand included here; its owner proved 20 standalone and three original-order shard runs. The planner timeout remains separately investigated, and the checkout failure has no established underlying transport cause. Latest-head hosted gates remain required.The current-main integration preserves the worker helper’s success-envelope ownership and adds only the existing transcript-binding callback/result kind. Fresh review passed. Four selected registered flows (live child, failure receipt, cron pagination, and archived cleanup pagination) passed in 42.51s command wall; 27 unrelated cases were filtered, not rerun. Core types (51.37s), scoped lint (18.16s), Swift generation, assertion guard, format and diff checks passed. Main’s generated protocol additions and baseline reductions are preserved. The subsequent main fixture integration leaves all 48 task source files unchanged; only the baseline incorporates unrelated main reductions while retaining the obsolete lifecycle-row removal.
The original runtime replay restored the CSV and report/chart task requests and answers. A fresh full build of the published integration head
689bb6970818then passed in 891.85s, and all eight served startup assets matched that build. Through the normal UI, two real OpenAI children usingcollect: trueandcleanup: "delete"returned the expected arithmetic result (204) and Unicode text. Their retained task transcripts remained readable across selection changes and a hard reload. Persisted records independently confirm both successful collections, absent live child nodes/windows, and published deleted archives. Final-head hosted review found no actionable or security findings and accepted the runtime, authenticated transport and inspected UI evidence.Measured test costs and large-history limits
The backend access/error six-case archive suite took 38.27s, its expanded sharing/capacity case 7.96s (18.32s command wall), and the Tasks UI group 5.49s. The existing 226-case directive suite took 73.38s. Earlier archive and live-binding groups took 27.31s and 66.60s. Registered tests use real SQLite/archive workers; cold compiler output is reused within a CI group. No sleeps, polling, retries, timeout increases or worker restrictions were added.
A retained non-CI diagnostic of 1.85 million records previously exhausted the 512 MiB worker heap. The final reader returned the exact count, page, cursor and 8,000 context records in 39.06s with 166.9 MiB sampled worker heap and 1.04 GiB process RSS, using a 4 MiB page budget. This is worker proof, not a full UI measurement: the complete extreme-history browser flow and final verification latency remain unproven. Source tracing confirms that this browser request has no default deadline; the previously reported 30-second browser limit was incorrect and belongs to a separate client wrapper. The measured 39.06-second worker read remains a latency follow-up; timeout behavior and currentness checks are unchanged.
A 250 MiB single record exposed excessive native parsing memory, so that parser was removed. The final reader rejects it in 0.490s with sampled process RSS of 687.7 MiB, versus 610.3 MiB before the read; the rejected implementation reached 3.80 GiB. No heap sample arrived before rejection. An initial diagnostic assertion incorrectly rejected the expected worker Error event; source and lifecycle receipts confirm the capacity rejection, joined worker and absence of an out-of-memory error. Large fixtures remain outside per-PR CI.
The final integrated build measured startup JavaScript at 371,178 bytes against the unchanged 371,332-byte limit, including the separately landed Labs fix. The optional strict UI report still fails on inherited Mermaid assets: 1,593,188 bytes against 983,040. No dependency or budget changes were made, and no full strict-performance pass is claimed. The earlier backend candidate also exceeded the startup limit; those original results remain retained.
These inspected synthetic Control UI captures replay exact registered responses following real cleanup. Later repairs preserve this ordinary successful transcript output.
Before
After
Inspected capacity-error before/after screenshots show the permanent preview-limit guidance and removal of ineffective retry actions. Both screenshots were also delivered in the originating chat.
Authenticated Gateway transport proof on 36b8ed8
A one-off fixture used one isolated real Gateway, configured synthetic trusted-proxy identities, ordinary device pairing and normal WebSocket requests. The task transcript was written and archived through the real cleanup owner. The administrator received the retained answer. A restricted viewer could read the parent task through
tasks.get, but received no child transcript. A second administrator then used the normalusers.setRoleRPC to revoke the reading operator's role while real archive verification was paused at a deferred scheduling barrier. The Gateway retired that connection without a history response; reconnecting the same paired device with its reduced role returned an explicit denial. The barrier supplied neither authority nor transcript data.The fixture passed in 19.44s command wall / 7.38s test time. Its first run passed the access and socket-retirement checks, then failed because the fixture tried to pre-pair its existing device again; the replay reused that pairing. No production code, timeout, retry or authorization rule changed.
The following final response frames contain only synthetic content. Connection credentials and endpoints are absent:
{ "cleanupDeleted": true, "allowed": { "type": "res", "id": "60988d9a-ca7c-4ed9-aa18-d19496e061c3", "ok": true, "payload": { "messages": [ { "role": "assistant", "content": "Synthetic archive result: 22.00, café 雪", "stopReason": "stop", "__openclaw": { "runId": "transport-child-run", "id": "transport-synthetic-answer", "recordTimestampMs": 1790254211070, "seq": 1 } } ] } }, "parentAuthorized": true, "denied": { "type": "res", "id": "f28cc47b-dcdd-4d37-a7db-fbf0722f2ac3", "ok": false, "error": { "code": "UNAVAILABLE", "message": "Unable to load this task's transcript. Refresh the task and try again." } }, "revocation": { "roleChangeOk": true, "closure": { "code": 4001, "reason": "operator role changed" }, "inFlightHistoryFrames": [], "reconnectDenied": { "type": "res", "id": "bcd04a4c-8463-4054-baac-2a4f239e3e16", "ok": false, "error": { "code": "UNAVAILABLE", "message": "Unable to load this task's transcript. Refresh the task and try again." } } } }