Repository navigation
fix(cron): include job name when reading single-job run history - #88294
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 1, 2026, 12:07 AM ET / 04:07 UTC. Summary PR surface: Source +1, Tests +311. Total +312 across 12 files. Reproducibility: yes. from source inspection: current main's single-job Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land this branch or an equivalent fix that passes a job-name lookup into single-job Do we have a high-confidence way to reproduce the issue? Yes from source inspection: current main's single-job Is this the best way to solve the issue? Yes, this is a maintainable fix: it reuses the existing run-log enrichment contract and keeps the deleted-job fallback unchanged. A direct AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3b802a7fbc5a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +1, Tests +311. Total +312 across 12 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
|
Added a focused regression test in File: The test writes two historical JSONL entries (no
Real test run (Crabbox / Cloudflare standard-4)``` Test Files 1 passed (1) cloudflare run summary sync=41.684s command=2m50.812s total=3m32.517s exit=0 15 pre-existing tests + 1 new regression test, all green. To run locally: ```bash Note on "non-clobber" behaviorAn earlier draft of the test also asserted that a pre-existing |
steipete
left a comment
There was a problem hiding this comment.
Maintainer review after current main update: the fix idea is still the right one, but this branch is now stale and cannot merge.
Blocking before merge: GitHub reports mergeable=CONFLICTING / mergeStateStatus=DIRTY, and a local git merge-tree against current origin/main conflicts in src/cron/run-log.ts, src/cron/run-log.test.ts, and src/gateway/server-methods/cron.ts. main has since moved cron run history to the SQLite/object-argument API: readCronRunLogEntriesPage now takes one options object with storePath at src/cron/run-log.ts:284, while this PR still patches the older readCronRunLogEntriesPage(logPath, opts) shape.
The bug still exists on current main: the all-jobs branch builds jobNameById and passes it to the reader at src/gateway/server-methods/cron.ts:576, but the single-job branch at src/gateway/server-methods/cron.ts:591 still calls readCronRunLogEntriesPage with only storePath, jobId, and filters. The UI still renders ${entry.jobName ?? entry.jobId} at ui/src/ui/views/cron.ts:1850, so historical entries without jobName still fall back to the raw id.
Best fix: rebase/adapt this same approach onto current main by adding single-job name enrichment to the current object-based reader path, or by passing a one-entry jobNameById map from the single-job gateway branch. The regression test also needs to use the current SQLite/migration helper shape rather than writing directly to the old JSONL reader signature.
Code read: src/cron/run-log.ts, src/cron/run-log/entry-codec.ts, src/cron/run-log/sqlite-store.ts, src/gateway/server-methods/cron.ts, src/cron/run-log.test.ts, ui/src/ui/views/cron.ts. No duplicate/related gitcrawl hits found for this exact cron run-history jobName symptom.
52ada5f to
e045e36
Compare
e045e36 to
2cdddfb
Compare
5951b6f to
9ee3f6a
Compare
ecf9b7c to
6687cf8
Compare
The cron.runs gateway handler enriches log entries with jobName in the all-jobs scope, but the single-job scope did not pass any job-name lookup into the SQLite run-log reader. Entries returned for one job could therefore reach Control UI without jobName, making the run-history title fall back to the raw job id. Build a one-entry jobNameById map for the current job and pass it through the same reader enrichment path used by all-jobs history. If the job no longer exists, the map stays undefined and existing fallback behavior is unchanged.
Asserts that readCronRunLogEntriesPage stamps a supplied jobNameById map onto single-job page entries, matching the gateway data shape used for both all-jobs and single-job cron.runs responses. Addresses review feedback on openclaw#88294.
e25fd82 to
456965f
Compare
|
Maintainer update: rebased and rewrote this onto the current cron run-log architecture. What changed:
Local proof on final branch:
CI proof:
Known proof gap: no live Pi/Telegram rerun from me; the PR retains the contributor's supplied real-device proof for the user-visible CLI symptom. |
…claw#88294) * fix(cron): include job name in single-job run history The cron.runs gateway handler enriches log entries with jobName in the all-jobs scope, but the single-job scope did not pass any job-name lookup into the SQLite run-log reader. Entries returned for one job could therefore reach Control UI without jobName, making the run-history title fall back to the raw job id. Build a one-entry jobNameById map for the current job and pass it through the same reader enrichment path used by all-jobs history. If the job no longer exists, the map stays undefined and existing fallback behavior is unchanged. * test(cron): cover single-job run history job name enrichment Asserts that readCronRunLogEntriesPage stamps a supplied jobNameById map onto single-job page entries, matching the gateway data shape used for both all-jobs and single-job cron.runs responses. Addresses review feedback on openclaw#88294. * test(cron): preserve nullable tool schema validation * test(cron): assert runtime nullable tool schema * test(cron): refresh prompt snapshots --------- Co-authored-by: Kip Claw <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
…claw#88294) * fix(cron): include job name in single-job run history The cron.runs gateway handler enriches log entries with jobName in the all-jobs scope, but the single-job scope did not pass any job-name lookup into the SQLite run-log reader. Entries returned for one job could therefore reach Control UI without jobName, making the run-history title fall back to the raw job id. Build a one-entry jobNameById map for the current job and pass it through the same reader enrichment path used by all-jobs history. If the job no longer exists, the map stays undefined and existing fallback behavior is unchanged. * test(cron): cover single-job run history job name enrichment Asserts that readCronRunLogEntriesPage stamps a supplied jobNameById map onto single-job page entries, matching the gateway data shape used for both all-jobs and single-job cron.runs responses. Addresses review feedback on openclaw#88294. * test(cron): preserve nullable tool schema validation * test(cron): assert runtime nullable tool schema * test(cron): refresh prompt snapshots --------- Co-authored-by: Kip Claw <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Problem
In Control UI Cron run history, the single-job view could render the raw job id instead of the human-readable job name. The UI title uses
entry.jobName ?? entry.jobId, so missingjobNamein the gateway response becomes visible immediately.The all-jobs
cron.runspath already builds ajobNameByIdmap and passes it through run-log enrichment. The single-job path did not pass any job-name lookup, so entries returned for one job could still lackjobName.Fix
cron.runsgateway branch, resolve the current job withcontext.cron.list({ includeDisabled: true }).jobNameByIdmap into the existing SQLite run-log reader enrichment path.cron.runsreturnsjobName;jobNameByIdstamps single-job page entries.No schema migration, dependency change, or new runtime storage path.
Real behavior proof
Behavior addressed: Single-job
cron.runsresponses lackedjobName, so Control UI run-history titles fell back to the raw job id.Real environment tested: Raspberry Pi 4 Model B, ARM64 Debian bookworm, OpenClaw 2026.5.27 (
27ae826), Node 22.x, patched installed gateway dist under/usr/lib/node_modules/openclaw/dist/.Exact steps or command run after this patch: Restarted
openclaw.serviceafter applying the equivalent gateway patch, cleared/var/tmp/openclaw-compile-cache, then ran:Evidence after fix: Terminal output from the real patched Pi setup:
Observed result after fix: The gateway response now carries the live job name for the single-job run-history entry. That is the field consumed by the Control UI render path
entry.jobName ?? entry.jobId, so the run-history title showsTwitter archive exportinstead of the raw UUID.What was not tested: Windows/macOS runtime, deleted jobs whose historical rows no longer have a current job definition, and a Control UI screenshot through the tailnet-only nginx setup.
Maintainer verification
pnpm test src/cron/run-log.test.ts src/gateway/server.cron.test.ts src/agents/tools/cron-tool.schema.test.ts -- --reporter=verboseResult: 3 Vitest shards passed, 49 tests passed.
Result: all matched files use the correct format.
Result: clean, no accepted/actionable findings.
Result: passed locally. Direct
pnpm check:changedfirst attempted delegated Testbox and failed becauseblacksmithis not installed locally; direct Azure Crabbox fallback queued for 10 minutes and timed out before leasing (run_1fee25ccd7fc,cbx_05ca4f92c90d).AI Disclosure
main