Repository navigation
fix(update): update summary drops warnings and understates total time on long runs - #194242
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 Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR preserves warnings ahead of ordinary diagnostics and adds elapsed time when recorded phases omit part of an update run. Example: A run lasts 300 seconds while its recorded activating phase lasts 60 seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this PR addresses a remaining update-reporting defect, but its test-line allocation introduces a concrete CI blocker. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherUpdate drivers record bounded history in the shared-state ledger; the common renderer turns that history into CLI, status, and chat reports. flowchart LR
A[Update drivers] --> B[Step upsert]
B --> C[Bounded ledger codec]
C --> D[Shared state database]
D --> E[Shared report renderer]
E --> F[CLI status and chat]
Technical reviewBest possible solution: Keep the shared eviction policy and report changes, and reduce the allocation to the actual 40 added test lines. Do we have a high-confidence way to reproduce the issue? Current main's eviction code explains warning loss at both bounds, and its renderer lacks total elapsed time; this read-only review ran no reproduction. Is this the best way to solve the issue? The patch repairs the existing owners with one shared eviction selector, preserves named receipts and chronological repair history, and reuses stored timestamps without new state or configuration. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 737c537797cb. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +32, Tests +40, Other +2. Total +74 across 6 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 6, 2026, 12:42 PM ET / 17:42 UTC. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6939135b5b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const totalMs = | ||
| run.createdAtMs == null || run.finishedAtMs == null ? 0 : run.finishedAtMs - run.createdAtMs; | ||
| // Capture and terminal cleanup run outside these phases; large state makes them long. | ||
| if (totalMs - phaseMs >= 1_000) { | ||
| lines.push(`Total: ${formatDurationPrecise(totalMs)}, including work outside these phases.`); |
There was a problem hiding this comment.
Measure total time through terminal cleanup
For CLI updates with slow recovery cleanup, finishedAtMs excludes precisely the work this new total is intended to expose. prepareUpdateCommandTerminalResult in src/cli/update-cli/update-command-terminal.ts completes the run and prepares the report before awaiting automaticallyCleanUpdateRecovery; the subsequent report projection adds cleanup diagnostics without changing the timestamps. Moreover, ordinary phase transitions close one phase when opening the next, and terminalization closes the final phase at finishedAtMs, so their durations normally sum to this same totalMs and suppress the new line entirely. A cleanup taking several minutes therefore still goes unreported. Capture elapsed command/report timing through cleanup separately from the deliberately settled ledger outcome.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
… on long runs (openclaw#194242) * fix(update): keep warnings in the run summary and state total time * test(update): fix report duration expectation * style: format * test(update): fix total duration expectation * fix(update): carry run timestamps into the CLI report * fix(update): keep repair history chronological at the ledger bound * test(update): type the report step fixture * chore: match the test-line allocation to added lines
… on long runs (openclaw#194242) (cherry picked from commit 19446cf) Release adaptation: Adapt warning/failure-aware bounded eviction to target existing upsertStep in update-run-write.ts (source split update-run-step-upsert.ts absent); no owner relocation. Include recorded elapsed report and focused long-run regressions. Preserve retained receipts and chronological repair history; no SQLite schema change. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 681267df3a9ae6f061ee9680be8ae5c0b7a1e03d)
What Problem This Solves
Fixes: the update summary undercounts warnings, and understates how long the update took, when a run is long or noisy.
User Impact
"N warnings need attention" stays accurate when an update produces many steps, and the report states the total time when capture or cleanup ran outside the listed phases.
Why This Change Was Made
Problem
The run ledger keeps 16 KiB and 128 steps. At either bound it evicted the oldest unnamed step, including
warning:*rows such aswarning:finalize:plugins:*, while later plain diagnostics survived. The summary counts warning rows, so warnings vanished from both the count and the list. #192942 fixed this only for the post-plugin Doctor warning.The
Phases:line lists recorded phases only. Pre-phase capture and terminal cleanup are not phases; on a 3 GB state database they took about 250 s and 230 s, so the line understated the update by several minutes.Fix
Total: ...only when total time exceeds the listed phases by a second or more. The CLI report adapter now carries the run timestamps that this needs.Accepted edge case
A flood of warning rows larger than the budget still evicts the oldest warnings. Named receipts remain retained, as before.
Evidence
src/infra/update-run-ledger.compaction.test.ts: warning rows survive both the byte and the step bound; red on base, because the count drops.src/infra/update-run-report.test.ts: the Total line and the adapter timestamps; red on base.$autoreviewis scoped-clean. The independent Codex review found that repair history shared the bound; fixed in this head.Refs #164800