Skip to content

refactor(cron): own retained run transcript access - #158776

Merged
steipete merged 7 commits into
mainfrom
codex/taskflow-cron-transcript-land
Sep 26, 2026
Merged

steipete merged 7 commits into
mainfrom
codex/taskflow-cron-transcript-land

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

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.history on 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

  • Packaged upgrade and retained-transcript proof passed on exact source/tooling 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.
  • The subsequent reader-boundary repair moves the unchanged lazy discovery operation into its existing worker dispatcher. The unchanged import guard and 121 focused cases pass (one optional benchmark skip), including real worker compilation, cancellation, source custody and cache behavior; both cycle gates, types, final lint and fresh review pass. This is separate source-worker proof, not a relabeling of the older package artifact. The linked proof explains the precise reuse scope.
  • Refreshed main integration passes 310 focused tests with one existing benchmark skip (125.71s wrapper), protocol/native generation and canonical plugins:assets:check after 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.
  • Four rename-during-preparation cases fail before the repair and pass afterward; 295 Cron cases pass. The shared worker/caller suite covers current sharing, revocation and main-thread SQL rejection. The package harness rejects 13 artifact-backed provenance/cursor/content/order corruptions.
  • The final cached-head fixture correction preserves every cursor assertion and verifies the exact warning at its existing collision owner. Actual worker warning emission was independently reproduced; 57 focused tests, affected types, lint and fresh review pass. Current-head CI remains enforced before merge.

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.

Before: Tasks-backed automation run transcript

After: Cron-owned transcript, including an earlier page retrieved through its recorded-run cursor.

After: Cron-owned automation run transcript with earlier history

@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: android App: android app: web-ui App: web-ui gateway Gateway runtime size: XL labels Sep 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 26, 2026, 2:03 PM ET / 18:03 UTC (Revision 6).

ClawSweeper review

What this changes

Adds 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
Reviewed head: 2e83fdc3585e97115edcfdd16ee719b1d1271935

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The owner-level cutover and access checks are coherent, with visual and focused boundary evidence; final-head upgrade coverage is the material gap.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: The maintainer-author proof gate does not apply. Inspected screenshots show the new Automations paging flow, and the changed Cron handler has registered-path tests for retained reads and revocation; the published-updater lane passed on an earlier commit, leaving final-head upgrade coverage open. No stored-data format changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-author proof gate does not apply. Inspected screenshots show the new Automations paging flow, and the changed Cron handler has registered-path tests for retained reads and revocation; the published-updater lane passed on an earlier commit, leaving final-head upgrade coverage open. No stored-data format changes.
Evidence reviewed 9 items Current main still uses Tasks: The Automations transcript controller calls tasks.list and tasks.get; current main has no cron.history schema.
Latest release still uses Tasks: The v2026.9.6 Automations transcript controller calls the same Tasks methods; GitHub reports that release was published on 2026-09-23.
Run-bound Gateway reader: The new handler selects one recorded run, binds its cursor to the record and session generation, and invokes the shared retained-transcript publication path.
Findings None None.
Security None None.

How this fits together

Cron 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]
Loading

Before merge

  • Resolve merge risk (P1) - The Automations view removes its Tasks transcript path. The successful 2026.9.6 published-updater acceptance used an earlier commit, while the final head changes the history worker that serves retained pages; first-page and earlier-page upgrade behavior on the final head remains unverified.
  • Complete next step (P2) - Record a published 2026.9.6 updater-to-final-head run showing first and earlier Cron transcript pages from retained state.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +776, Tests +974, Docs +2, Other +175. Total +1927 across 48 files.

View PR surface stats
Area Files Added Removed Net
Source 30 1585 809 +776
Tests 11 1132 158 +974
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 6 183 8 +175
Total 48 2902 975 +1927

Review metrics

Metric Value Why it matters
New Gateway reader 1 RPC added, 0 config keys added The cutover adds a public read path without adding an operator setting.
Code growth production net +826 lines, tests net +974 lines The production growth supports the Cron reader and shared access path; the PR describes that ownership cutover.

Stored data model

Persistent data-model change detected: database schema: src/gateway/session-utils-store.types.ts, migration/backfill/repair: scripts/e2e/lib/upgrade-survivor/diagnostics.mjs, migration/backfill/repair: scripts/lib/upgrade-survivor-diagnostics.sh, unknown-data-model-change: scripts/e2e/lib/upgrade-survivor/legacy-operator-state.mjs. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Verify the final-head upgrade (recommended)
    Run and inspect the published 2026.9.6 updater cell against the final source, including first and earlier pages from retained Cron runs.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded automation-history improvement with a limited user-facing surface.
  • merge-risk: 🚨 compatibility: Removing the Tasks UI path could make retained transcripts from existing installations unavailable if final-head upgrade behavior differs.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-author proof gate does not apply. Inspected screenshots show the new Automations paging flow, and the changed Cron handler has registered-path tests for retained reads and revocation; the published-updater lane passed on an earlier commit, leaving final-head upgrade coverage open. No stored-data format changes.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The maintainer-author proof gate does not apply. Inspected screenshots show the new Automations paging flow, and the changed Cron handler has registered-path tests for retained reads and revocation; the published-updater lane passed on an earlier commit, leaving final-head upgrade coverage open. No stored-data format changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Shakker: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record final-head published-updater results for first and earlier retained Cron transcript pages.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-26T09:17:54.332Z sha a2e804e :: blocked before merge. :: none
  • reviewed 2026-09-26T09:32:12.115Z sha a2e804e :: blocked before merge. :: none
  • reviewed 2026-09-26T15:32:42.730Z sha 5329730 :: blocked before merge. :: none
  • reviewed 2026-09-26T15:46:41.237Z sha 086cc89 :: blocked before merge. :: none
  • reviewed 2026-09-26T17:07:52.744Z sha 2ed2ead :: blocked before merge. :: none

@steipete
steipete marked this pull request as ready for review September 26, 2026 09:24
@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components. This comment is informational because the PR author has repository Maintain or Admin access.

  • Current SHA: c902e00f56b6d7dda1b5258545c4eebfa88fb02f
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/methods/core-descriptors.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

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.
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 26, 2026
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.
@steipete

Copy link
Copy Markdown
Contributor Author

Packaged retained-transcript proof passed in Package Acceptance 36257794589.

Source and tooling: 2ed2eadbd9479b68a54a750318cdbb5368195664. Tarball SHA256: 30c7c2f4f6509b37d5376862e7f53110693eab81b46a02dca6e568101651d4eb. Package provenance, the embedded source identity, and the uploaded Docker evidence were independently verified.

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 user; the established display owner projects it as assistant. The correction retains content/cursor/order checks and verifies exact job, run-session and source-session provenance. Thirteen artifact-backed corruptions are rejected.

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.
@steipete
steipete enabled auto-merge (squash) September 26, 2026 18:51
@steipete
steipete merged commit 718bf2c into main Sep 26, 2026
255 of 256 checks passed
@steipete
steipete deleted the codex/taskflow-cron-transcript-land branch September 26, 2026 19:17
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 27, 2026
* 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.
steipete added a commit that referenced this pull request Sep 27, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 28, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: workboard proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant