Skip to content

feat(auto-review): bound background review execution#377

Merged
shiny-code-bot merged 3 commits into
mainfrom
code/background-review-budgets-369
Jul 18, 2026
Merged

feat(auto-review): bound background review execution#377
shiny-code-bot merged 3 commits into
mainfrom
code/background-review-budgets-369

Conversation

@cbusillo

@cbusillo cbusillo commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Closes #369.

Why

The July 17-18 dogfood run showed that detached Background Review could continue for roughly 17 minutes, consume about 2.55 million reported tokens, and surface a finding after the primary agent had already handed off. Background Review needs predictable ceilings and an explicit disposition workflow before Codex Lab can rely on it during normal dogfood.

What changed

  • Defines effective Background Review defaults for scope bytes, elapsed time, cumulative tokens (including cached input), serialized output bytes, and finding count.
  • Enforces scope before launch and elapsed/token ceilings during execution; completed output is accepted at an exact ceiling but rejected once over budget.
  • Persists bounded usage, effective budgets, terminal reasons, target freshness, and finding disposition in a versioned per-run sidecar without changing the existing strict run-index schema.
  • Prevents stale completion from becoming actionable and creates durable needs_attention, repairing, deferred, or obsolete disposition state.
  • Adds root-only auto_review_disposition support plus review/disposition/write, bounded repair detail, app-server schemas, and API documentation.
  • Surfaces terminal budget diagnostics in live and replayed TUI sessions, including cancelled, failed, skipped, and superseded reviews.
  • Makes controlled cancellation/supersede idempotent, preserves valid completed output in terminal races, and keeps status delivery alive across task aborts.
  • Uses stack-bounded rollout deserialization and thread metadata update boundaries required by the expanded app-server proof path.
  • Hardens narrow-width TUI diff rendering after the live dogfood fixture exposed an unsigned prefix-width subtraction panic.

Validation

  • cargo check -j 1 -p codex-auto-review -p codex-app-server-protocol -p codex-app-server -p codex-config -p codex-core -p codex-rollout -p codex-thread-store -p codex-tui
  • Core persistence, budget, awareness, scope, freshness, empty-output, actionable-finding, control, timeout, and token-ceiling fixtures.
  • App-server summary/detail/disposition tests, including repair-detail failure atomicity.
  • TUI status rendering, terminal-summary replay, and narrow-width diff-rendering regression tests.
  • Cross-model read-only review passes with Claude and GPT-family reviewers; final focused passes reported no blockers.

Dogfood proof

  • Live provider run recorded before cutover.
    • Source SHA: 0e3eb23201b06767c27dbc299e41206ec935c811
    • Candidate binary SHA-256: 67ca3c1b186639c917d1516ade19778108f16ce21bbadcaf6f9680ed3c0ef057
    • Review run: 34026fd7-6645-4f57-9185-1553a5eba17c
    • Model: codex-auto-review (medium reasoning)
    • Effective budget: 120,000 scope bytes; 180,000 ms; 250,000 total tokens; 32,768 output bytes; 5 findings
    • Observed usage: 1,123 scope bytes; 61,318 ms; 15,658 total tokens; 1,068 output bytes; 1 finding
    • Result: current completed run with [P1] Clamp remaining budget instead of subtracting raw u64s
    • Disposition: obsolete, actor agent, reason deliberate disposable dogfood fixture; not a production change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bound Background Review cost and require surfaced disposition

2 participants