fix(agent): recover bounded Codex false stops across runtimes - #83560
CryptoKylan wants to merge 4 commits into
Conversation
Share a two-attempt continuation budget across Codex runtimes and verification rounds. Preserve durable terminal checkpoints, tool-call projections, and app-server attempt accounting across recovery and failure paths.
Remove terminal sentinels before restoring checkpoint transcript rows while preserving interrupted-turn durability. Correct the app-server recovery budget comment and add focused regressions for returned and persisted history.
fix(agent): recover bounded Codex false stops across runtimes
|
|
Addressed the automated review and pushed
I left the suggested classifier-corpus fixture extraction out because it is test-only refactoring with no behavioral correction. Validation: 75 focused tests passed, Ruff and |
|
Related focused contribution: #117240 salvages the historical-tool gate work from #69779 and covers visible acknowledgments after an answered clarification, including conversational proceed and the overlapping tail path. Its real-loop/SQLite tests preserve declines, approval waits, completed/revoked context and live-work suppression without synthetic user rows. This does not port or replace your broader app-server/shared-policy/persistence work. Linking explicitly so maintainers can consolidate the overlapping detector slice; final local affected checks and exact-head independent review are recorded in that PR. |
Problem
Hermes can accept a provider-returned progress checkpoint as a completed turn even when the response explicitly promises more work or says the task remains unfinished. This can stop tool-driven tasks prematurely.
The existing recovery paths do not consistently cover:
Changes
turn/completedidentity before app-server recovery.PAUSEDnotice when recovery or iteration budgets are exhausted.Safety boundaries
Automatic recovery does not run through:
Recovery remains bounded and consumes the app-server iteration budget. No tools, environment variables, prompt mutations, external telemetry, or provider-specific credentials are introduced.
Verification
Against current
main(a1bfbccc02d5bfdaef1568facfca2cc1456c59f0):noqawarning inrun_agent.py).py_compile: pass.git diff --check: pass.tests/run_agent: 1,498 passed, 4 skipped, 2 deselected.One earlier broad candidate run observed an order-dependent credential-pool mock failure. The failing test collects before this PR's changed
tests/run_agentfiles; it passed alone and in paired isolation, the clean-base full suite passed in the same environment, and two later full candidate runs passed. No candidate-adjacent causal path was found.Related work and credit
This reconciles the false-stop family covered by:
The adversarial corpus adaptation remains credited in test comments. This PR is intended as one architectural reconciliation rather than a novelty claim; the authors above are explicitly invited to review whether their reported scenarios are covered.
Closes #69778 if maintainers agree this shared bounded policy supersedes the narrower open implementations.