Repository navigation
fix(cron): suppress control tokens and retain retry usage - #149697
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 16, 2026, 1:20 AM ET / 05:20 UTC (Revision 2). ClawSweeper reviewWhat this changesThis PR removes control tokens from scheduled conversation results while preserving media, counts both completed retry prompts with their respective prices, and avoids a redundant session read during Goal edits. Merge readiness⛔ Blocked before merge - 1 item remains The fixes remain necessary on fetched main, and no actionable introduced defect was identified. The recorded Gateway proof remains relevant after verifying that all five changed cron production modules match the previously tested revision. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw's scheduler runs background agent prompts, records usage, and delivers completed reports into conversations or external channels. These changes normalize reports before transcript insertion and separate whole-run billing from the final request's context usage. flowchart TD
A[Scheduled job] --> B[Agent prompt]
B --> C{Interim acknowledgement?}
C -->|Yes| D[Continuation prompt]
C -->|No| E[Usage and final result]
D --> E
E --> F[Aggregate billing and final context]
E --> G[Normalize control tokens and preserve media]
G --> H[Conversation and channel delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +92, Tests +216, Docs +2. Total +310 across 11 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared delivery normalizer and preserve per-prompt billing facts while persisting only the final request's context snapshot. Do we have a high-confidence way to reproduce the issue? Yes, source establishes both paths: current-session completion receives unnormalized payloads on fetched main, and interim retries replace the first prompt result before accounting. This review did not execute a reproduction. Is this the best way to solve the issue? Yes. Reusing the existing delivery normalizer and usage accumulator repairs the owning paths without adding competing policy, configuration, or storage formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c9121962faf3. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Reuse the entry already read in the current write transaction when capturing previous session identity. Preserve the other lookup keys, current authority checks, post-write identity reads, and canonical certification. This resolves the interaction between #149537 and #149388 without changing the existing query budget. The unchanged test reproduces on their combined main state; all 38 Goal, identity, and canonical-validation tests pass after repair.
f7b6ec3 to
e2151fe
Compare
Keep the existing progress-dismiss and agent-change callbacks as explicit void expressions, preserving their undefined returns and side effects. This brings the renderer back within its existing max-lines limit after #149384 without changing UI behavior.
|
Merged via squash.
|
Refresh against the canonical pre-write reuse from #149697 and retain Vincent Koc's case-distinct Matrix sibling identity regression from #149722. Management-only Goal mutations still preserve identity without taking identity snapshots; shared writer certification and receipt atomicity stay. The current-main64KiB fixture drops3 session-row SELECTs/132942bytes to 2 SELECTs/66771bytes. All23 focused owner/Gateway tests, scoped types, typed lint, formatting and independent P2 review pass. These are local database-read measurements, not production CPU or latency claims. Co-authored-by: Vincent Koc <[email protected]>
* chore(lint): make max-lines a warning Peter decided on 2026-09-16 that max-lines should warn in CI rather than block main. The chat-pane-render.ts failure exposed unnecessary lint burden after #149697. Change all six max-lines scopes to warn while preserving every threshold and all other rules. Document warning behavior and the retained suppression ratchet. The runners and CI already preserve warning output and exit codes. Proof: check-changed, formatting, and git diff --check pass. The current chat-pane-render.ts passes single-file core lint; the exact 702-line revision from failed main run 35060497703 prints one max-lines warning and exits 0 through run-oxlint with CI-style output. The sample UI tsconfig command hit the existing nested-checkout declaration boundary, so proof uses CI's source-only core tsconfig. * test(lint): expect max-lines warnings Align the existing config-policy test with Peter’s 2026-09-16 decision. Preserve all six budgets and exclusions. The prior PR run correctly exposed the stale error expectations. Proof: all 13 oxlint config tests, check-changed, and git diff --check pass. Fresh independent review found no actionable P0/P1 findings.
…49697) * fix(cron): normalize current-session completion payloads * fix(cron): account for completed interim retry prompts * fix(cron): preserve final context after retry accounting * refactor(cron): centralize stale delivery policy * fix(cron): clear stale billing after context-only retries * fix(sessions): reuse the admitted entry during Goal edits Reuse the entry already read in the current write transaction when capturing previous session identity. Preserve the other lookup keys, current authority checks, post-write identity reads, and canonical certification. This resolves the interaction between openclaw#149537 and openclaw#149388 without changing the existing query budget. The unchanged test reproduces on their combined main state; all 38 Goal, identity, and canonical-validation tests pass after repair. * refactor(ui): simplify chat pane callbacks Keep the existing progress-dismiss and agent-change callbacks as explicit void expressions, preserving their undefined returns and side effects. This brings the renderer back within its existing max-lines limit after openclaw#149384 without changing UI behavior. * fix(ci): accept file paths in extension packing fixtures
* chore(lint): make max-lines a warning Peter decided on 2026-09-16 that max-lines should warn in CI rather than block main. The chat-pane-render.ts failure exposed unnecessary lint burden after openclaw#149697. Change all six max-lines scopes to warn while preserving every threshold and all other rules. Document warning behavior and the retained suppression ratchet. The runners and CI already preserve warning output and exit codes. Proof: check-changed, formatting, and git diff --check pass. The current chat-pane-render.ts passes single-file core lint; the exact 702-line revision from failed main run 35060497703 prints one max-lines warning and exits 0 through run-oxlint with CI-style output. The sample UI tsconfig command hit the existing nested-checkout declaration boundary, so proof uses CI's source-only core tsconfig. * test(lint): expect max-lines warnings Align the existing config-policy test with Peter’s 2026-09-16 decision. Preserve all six budgets and exclusions. The prior PR run correctly exposed the stale error expectations. Proof: all 13 oxlint config tests, check-changed, and git diff --check pass. Fresh independent review found no actionable P0/P1 findings.
What Problem This Solves
Current-session cron results could display control tokens, and an interim acknowledgement followed by a second model prompt could lose the first prompt's usage and cost.
User Impact
Scheduled reports use the same silent-reply handling as channel announcements, preserving media when its caption is suppressed. Run usage and estimated cost include both completed prompts; session context reflects the final request. No configuration or migration is required.
Why This Change Was Made
Normalize payloads before the conversation writer commits them. Retain completed prompts with their own usage, model, and timing for billing and diagnostics. Keep final context separate from aggregate billing, including context-only and unavailable-context results. Reuse the real usage predicate in tests and keep stale-delivery policy in its existing owner.
Current-main CI also required three bounded repairs. Goal edits now reuse the entry already validated in their transaction, preserving identity and certification checks; the unchanged read-count assertion reproduced the failure caused by #149537 and #149388. Two chat callbacks use equivalent void expressions to restore the existing file-length limit, with no visual behavior change. The planner fixture repair reuses the exact commit from #149726 so it accepts full test-file paths as well as extension roots.
Evidence
c2b2b7a00168f5ba00ad40c91f9be1828ff71194: leading control token, media with suppressed caption and exact downloaded bytes, silent-only result, ordinary text, and two-prompt accounting. The original Gateway probe reproduced the token leak before repair; fixture cleanup completed.e2151fee2abab22f4f357907b0f1b2bd2e0ed88a. Later changes only simplify the two UI callbacks and correct the CI fixture; the cron and harness inputs are unchanged.