fix: detect semantic Codex cost catch-up progress - #2844
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 10, 2026, 2:58 PM ET / 18:58 UTC. ClawSweeper reviewWhat this changesThe PR changes Codex cost catch-up to track semantic scanner state and stop a scheduler when it revisits a prior pending state. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 4 items remain This PR remains necessary: current main and v0.49.1 still use byte changes as the catch-up progress signal. The revised recurrence handling addresses the prior review concern and has focused synthetic coverage, but merge should wait for redacted real-cache after-fix proof. Priority: P2 Review scores
Verification
How this fits togetherCodexBar scans local Codex JSONL session history in bounded passes and persists progress in its cost cache. The normal refresh path and Spend Dashboard consume that cache to decide whether history coverage is complete or catch-up should continue. flowchart LR
A[Local Codex session files] --> B[Bounded cost scanner]
B --> C[Persisted cost cache]
C --> D[Semantic progress state]
D --> E[Normal catch-up scheduler]
D --> F[Spend Dashboard scheduler]
E --> G[Usage coverage and status]
F --> G
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the semantic-state design and land it only after a redacted real Codex-cache run demonstrates both finite completion and safe pause behavior. Do we have a high-confidence way to reproduce the issue? Unclear: the source and synthetic regressions establish the intended cycle, but no reusable real Codex-cache capture demonstrates the failure and after-fix behavior on current main. Is this the best way to solve the issue? Yes for the bounded-state problem: semantic cursors plus recurrence detection are narrower than treating every live byte append as progress, pending real-cache validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d7934a5f6121. LabelsLabel 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
History |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a78e5ebbce
ℹ️ 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".
Summary
Prevent Codex cost catch-up from repeatedly running when only an active, already-complete session continues to append, while preserving progress for finite bounded backlog work.
The progress fingerprint now tracks:
Completed live appends and repeated growth of a fork blocked on the same missing parent no longer look like finite catch-up progress.
The catch-up schedulers also remember semantic progress states seen during the current run. This preserves bounded cursor progress while stopping a repeated validation cycle when its cursor returns to an earlier state.
Root cause
The catch-up scheduler used cached file byte changes as its no-progress signal. Active Codex sessions can append between bounded passes, so an unrelated unresolved dependency could remain pending while those live bytes kept the worker awake. At the same time, some real bounded work advances through semantic cursors or completion aggregates without changing the previously fingerprinted bytes.
This change fingerprints finite backlog state instead of ordinary completed-file growth. Repeated semantic states are detected across the whole catch-up run rather than only between adjacent passes.
Context
Refs #2815.
This addresses the native semantic-stall path and is complementary to #2834, which fixed the separate #2824 scheduling loop.
Validation
Final branch head:
make checkmake testDeterministic regressions cover:
Private local corpus contents and runtime artifacts are intentionally not published. The public verification in this PR is limited to source, synthetic fixtures, and reproducible repository test results.