Repository navigation
refactor(cron): own retained run transcript access - #158776
Conversation
|
🦞👀 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: blocked before merge. Reviewed September 26, 2026, 2:03 PM ET / 18:03 UTC (Revision 6). ClawSweeper reviewWhat this changesAdds a Cron Gateway reader for paged run transcripts and switches the Automations view from Tasks lookups to that reader, with protocol, native model, documentation, and upgrade-check updates. Merge readiness⛔ Blocked before merge - 3 items remain Keep open. Current main and the latest release still use Tasks for automation transcripts, so this PR has distinct work to do. Published-updater acceptance passed on an earlier commit, but later changes to the session-history worker leave the final head’s upgrade path unverified. Priority: P2 Review scores
Verification
How this fits togetherCron records each automation run and its session binding. The Gateway uses that record to find retained conversation pages, checks current access, and sends the result to the Automations view. flowchart LR
A[Recorded Cron run] --> B[Cron history request]
B --> C[Current access checks]
C --> D[Session history worker]
D --> E[Retained transcript publisher]
E --> F[Automations view]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +776, Tests +974, Docs +2, Other +175. Total +1927 across 48 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep Cron as the run-transcript reader and the shared history publisher as the access owner, then verify retained 2026.9.6 runs through the final-head installed-updater path before landing the UI cutover. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a planned reader cutover. Current main and v2026.9.6 still show the existing Tasks-backed flow. Is this the best way to solve the issue? Yes, conditionally. A run-bound Cron reader reuses the existing retained-transcript access owner; the final-head upgrade path still needs acceptance evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1210fd93e90c. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
Prepare exact session sharing facts through the existing history worker and rebuild current job names and filters after awaited preparation. Add packaged cron.history pagination proof and keep the transcript renderer private. Validation: four registered rename race controls fail before the fix; 15 run-history cases and 280 affected Cron cases pass. Shared worker/caller proof, affected types, lint and independent review pass. Packaged published-updater proof follows on this source.
Move the unchanged source-discovery request out of its runtime owner so retained-history transport types do not create a static import cycle. Both consumers use the existing store contract module. Validation: Madge reproduces the cycle on the prior head and passes on both the repaired head and exact CI merge; runtime cycles, core types, lint and independent P2 review pass. Executable ESM is unchanged apart from whitespace, and package proof retains its original source identity.
Integrate current main and regenerate the Workboard browser manifest from the matching gateway protocol. Preserve the existing scheduled-prompt display contract in upgrade proof by checking exact Cron provenance, session identity and turn boundary alongside cursor, content and ordering. Validation: canonical protocol/native generation, 310 focused tests plus one existing skip, and fresh integration review pass with no accepted actionable findings. Artifact replay reproduces the old role assumption and rejects 13 corruptions after correction. A repeated full-message finding was rejected against the identical prior Cron caller, which never enabled that optional recovery. Exact asset validation and rebuilt installed-updater proof follow on this source.
Supply canonical lazy source discovery from the admitted history worker. The read-only kernel consumes the callback and retains its per-operation cache without importing acquisition or transcript mutation owners. Validation: unchanged import guard reproduces eight forbidden paths before the fix and passes after it; 121 focused cases pass with one optional benchmark skip. Real worker compilation, lifecycle, cancellation, cache and source-custody cases, both cycle gates, affected types, lint and fresh independent P2 review pass.
Rename the worker reader target binding so message lookup and recent-page targets retain their existing local names without shadowing. Exact typed lint, formatting and fresh P2 review pass; runtime behavior is unchanged.
|
Packaged retained-transcript proof passed in Package Acceptance 36257794589. Source and tooling: The published 2026.9.6 updater completed in one attempt. Both synthetic Cron jobs passed at post-update and candidate stages: the latest reply with limit 1, an opaque earlier-page cursor, the original scheduled prompt with exact Cron provenance and turn boundary, distinct retained IDs, ordered sequences, and unchanged run/session/message identities across stages. Backup and rollback also passed. The targeted upgrade lane took 1,234 seconds. This replaces the initial fixture's incorrect assumption that a scheduled prompt retains the display role The later two-file reader-boundary repair and local-variable rename keep the resolver policy, serialized request, lazy cache, invocation order, updater, schemas, package exports and entry registry unchanged. They are covered separately by 121 focused cases (one optional benchmark skipped), actual source-worker compilation, unchanged import guards, lifecycle/custody/cache checks, types, lint and fresh review. The package evidence remains attributed to the 2ed2ead source above; it is not a claim that the final head's npm bytes were executed. Current-head build and CI gates remain required. The generic first-hop post-core exit snapshot was unavailable, so this proof makes no claim about that process's Doctor ownership. |
Keep cached-head history assertions independent of incidental eager discovery and host-only logger mocks. The actual worker still emits the original warning when discovery is needed; verify that exact diagnostic in the existing real collision-owner case alongside target mapping and physical database separation. Validation: original ordered CI entry reproduced the failure; real chat.history worker diagnostic probe preserved the warning. All 57 focused cursor/collision/source tests pass (141.38s wrapper), both affected type graphs, exact lint and fresh P2 review pass. No production behavior or new fixture boot.
|
Merged via squash auto-merge.
|
* refactor(cron): own retained run transcript access * fix(cron): preserve worker-owned history visibility and current filters Prepare exact session sharing facts through the existing history worker and rebuild current job names and filters after awaited preparation. Add packaged cron.history pagination proof and keep the transcript renderer private. Validation: four registered rename race controls fail before the fix; 15 run-history cases and 280 affected Cron cases pass. Shared worker/caller proof, affected types, lint and independent review pass. Packaged published-updater proof follows on this source. * refactor(gateway): keep session source requests with store types Move the unchanged source-discovery request out of its runtime owner so retained-history transport types do not create a static import cycle. Both consumers use the existing store contract module. Validation: Madge reproduces the cycle on the prior head and passes on both the repaired head and exact CI merge; runtime cycles, core types, lint and independent P2 review pass. Executable ESM is unchanged apart from whitespace, and package proof retains its original source identity. * fix(gateway): keep history discovery inside its worker dispatcher Supply canonical lazy source discovery from the admitted history worker. The read-only kernel consumes the callback and retains its per-operation cache without importing acquisition or transcript mutation owners. Validation: unchanged import guard reproduces eight forbidden paths before the fix and passes after it; 121 focused cases pass with one optional benchmark skip. Real worker compilation, lifecycle, cancellation, cache and source-custody cases, both cycle gates, affected types, lint and fresh independent P2 review pass. * refactor(gateway): distinguish history reader and request targets Rename the worker reader target binding so message lookup and recent-page targets retain their existing local names without shadowing. Exact typed lint, formatting and fresh P2 review pass; runtime behavior is unchanged. * test(gateway): verify store warnings at the collision owner Keep cached-head history assertions independent of incidental eager discovery and host-only logger mocks. The actual worker still emits the original warning when discovery is needed; verify that exact diagnostic in the existing real collision-owner case alongside target mapping and physical database separation. Validation: original ordered CI entry reproduced the failure; real chat.history worker diagnostic probe preserved the warning. All 57 focused cursor/collision/source tests pass (141.38s wrapper), both affected type graphs, exact lint and fresh P2 review pass. No production behavior or new fixture boot.
Remove Tasks and TaskFlow runtime, APIs, CLI, SDK surfaces and panels after the Cron, session, native execution and media completion ownership cutovers. Preserve stored rows and import provable legacy native assignments through Doctor; ambiguous ownership stays untouched with a warning. Follows #158221, #158217, #158225, #158222, #158702 and #158776. Related: #156532. Task-specific public APIs retire immediately; retained responsibilities use their existing owners. Maintainer-authorized administrative landing after full CI run 36312986498 attempt 2 passed on 274595e, with subsequent actual conflicts reviewed and focused checks passing. Current PR CI preflight hits the 64 KiB changed-path metadata limit before tests (run 36335042695); its duplicate security-review status mirrors that planning failure. Review and scoped proof are recorded in the PR. Published 9.4 native import is proven; remaining native completion and 9.4 rollback witnesses are explicitly unproven.
Remove Tasks and TaskFlow runtime, APIs, CLI, SDK surfaces and panels after the Cron, session, native execution and media completion ownership cutovers. Preserve stored rows and import provable legacy native assignments through Doctor; ambiguous ownership stays untouched with a warning. Follows openclaw#158221, openclaw#158217, openclaw#158225, openclaw#158222, openclaw#158702 and openclaw#158776. Related: openclaw#156532. Task-specific public APIs retire immediately; retained responsibilities use their existing owners. Maintainer-authorized administrative landing after full CI run 36312986498 attempt 2 passed on 274595e, with subsequent actual conflicts reviewed and focused checks passing. Current PR CI preflight hits the 64 KiB changed-path metadata limit before tests (run 36335042695); its duplicate security-review status mirrors that planning failure. Review and scoped proof are recorded in the PR. Published 9.4 native import is proven; remaining native completion and 9.4 rollback witnesses are explicitly unproven.
Related: #156532
What Problem This Solves
Automation run transcripts still depend on the Tasks API, preventing Tasks from being retired without losing transcript access.
User Impact
Operators can open and page the retained conversation recorded by an automation run through Cron. Missing or ambiguous retained history stays visibly unavailable; custom-session jobs preserve their shared conversation history.
Why This Change Was Made
Adds
cron.historyon the Cron reader introduced in #158222, binds cursors to the recorded run/session generation, and reuses the existing retained-transcript publication owner to enforce current sharing, client, and grant authority. The Automations view uses a shared transcript renderer and no longer calls Tasks APIs for run history.Visibility preparation now uses the existing session-history worker. After an awaited read, Cron rebuilds current job names and filters before projecting the page; limited operators retain current sharing and request authority without main-thread SQLite reads.
Evidence
2ed2eadbd9479b68a54a750318cdbb5368195664. Both jobs passed first/earlier-page reads after the installed 2026.9.6 updater and at the candidate stage, preserving exact provenance, content, run/session/message identity and ordering. Backup and rollback passed in the same one-attempt run.plugins:assets:checkafter commit. Independent review has no accepted actionable findings; the repeated full-message recovery finding was rejected against the identical prior Cron caller, which never enabled that optional callback.Earlier unchanged-input UI proof includes 83 UI tests, four browser cases, overlapping-page/retry/reconnect/attribution/focus coverage, and the inspected synthetic before/after captures below. No live provider or Team deployment is claimed.
Before: Tasks-backed transcript.
After: Cron-owned transcript, including an earlier page retrieved through its recorded-run cursor.