[codex] add rollout token budget configuration (1/N)#28746
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5596849a5c
ℹ️ 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".
| let reminder_interval_tokens = config | ||
| .reminder_interval_tokens | ||
| .unwrap_or_else(|| (limit_tokens / 10).max(1)); |
There was a problem hiding this comment.
Persist resolved rollout-budget defaults in config locks
These rollout-budget defaults are computed only during config load, but save_config_resolved_fields only materializes generic feature enablement and multi_agent_v2; it never writes config.rollout_budget back into the lock. When config-lock export/replay is used with a budget table that omits reminder_interval_tokens or either weight, the lock records only the partial TOML, so a later default change can replay the same session with different budget behavior while validation still passes. Serialize the resolved RolloutBudgetConfig into features.rollout_budget the same way multi_agent_v2 is handled.
AGENTS.md reference: AGENTS.md:L103-L110
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
followed existing precedent from the multi agent feature. handled in 38c5b92
What
This PR defines the structured configuration contract for shared rollout token budgets (across ALL agent threads under 1 rollout).
The reminder interval defaults to 10% of the rollout limit. Sampling and prefill weights default to
1.0.Scope
This PR only defines and validates configuration. It does not track usage, inject reminders, or stop a rollout. Accounting and reminders are implemented in the stacked follow-up #28494.
The existing
token_budgetfeature remains unchanged.rollout_budgethas its own feature key and configuration type.Tests
The config test verifies that the structured fields resolve into
RolloutBudgetConfigand do not enable the existingtoken_budgetfeature.Local checks:
just write-config-schemajust test -p codex-core load_config_resolves_rollout_budgetcargo check -p codex-thread-manager-samplegit diff --checkThe full workspace test suite was not run locally.