Skip to content

fix(codex): enforce turn budgets for reasoning and tool-only responses - #201

Open
ye1457 wants to merge 1 commit into
RLinf:mainfrom
ye1457:fix/codex-model-response-budget
Open

ye1457 wants to merge 1 commit into
RLinf:mainfrom
ye1457:fix/codex-model-response-budget

Conversation

@ye1457

@ye1457 ye1457 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Problem and behavior

Codex counted only nonempty agentMessage items as turns. Reasoning/tool-only responses could therefore exceed --max-turns, while multiple text items from one model response consumed multiple turns. The CLI also lacked the Dashboard's budget interruption.

Count completed model responses from cumulative SDK usage updates, deduplicate repeated updates, and use the same recorder in CLI and Dashboard. Multiple tools or text items within one response count once. Request one interrupt at the limit, preserve an already recorded finish, and retain normal SDK/MCP cleanup. turns_used now reports completed model responses. Document the semantics in both languages.

This is the independent fix for #190 (comment); RoboCasa memory changes remain in #190.

Validation

  • pytest tests/unit_tests -v -rs: 591 passed, 3 skipped. Skips require the optional RoboTwin/LeRobot dependencies.
  • pre-commit run --all-files: passed.
  • English and Chinese Sphinx builds with warnings treated as errors: passed.
  • Regression coverage: five reasoning/tool-only cycles with budgets 1 and 2, multiple text/tool items, duplicate/replayed usage, successful finish at the limit, CLI cleanup, and Dashboard interruption/close.
  • Combined locally with the RoboCasa changes for four real GPT-5.6/xhigh MCP memory-read checks: all passed within the 10-response budget. Raw traces stay local; no robot actions or benchmark reruns were performed.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 RPent-cn | 🛠️ Build #34612359 | 📁 Comparing 8b2d726 against latest (d6876ca)

  🔍 Preview build  

1 file changed
± rst_source/usage/configure_planner.html

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 RPent | 🛠️ Build #34612358 | 📁 Comparing 8b2d726 against latest (d6876ca)

  🔍 Preview build  

1 file changed
± rst_source/usage/configure_planner.html

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.

1 participant