[codex] configure rollout budget reminder thresholds#29423
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea5694b1bf
ℹ️ 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".
| #[schemars(range(min = 1))] | ||
| pub reminder_interval_tokens: Option<i64>, | ||
| /// Remaining weighted-token values that trigger reminders when crossed. | ||
| pub reminder_at_remaining_tokens: Option<Vec<i64>>, |
There was a problem hiding this comment.
Preserve rollout budget config compatibility
When users have an existing rollout-budget config or exported config-lock file, changing the TOML shape to only accept reminder_at_remaining_tokens while RolloutBudgetConfigToml still denies unknown fields makes prior reminder_interval_tokens configs fail to deserialize before migration; configs that only set limit_tokens also now fail because the resolver requires this new field instead of deriving the previous default. Please keep a deprecated alias/translation or fallback so existing rollout-budget sessions/configs continue to start.
AGENTS.md reference: AGENTS.md:L103-L111
Useful? React with 👍 / 👎.
| #[schemars(range(min = 1))] | ||
| pub reminder_interval_tokens: Option<i64>, | ||
| /// Remaining weighted-token values that trigger reminders when crossed. | ||
| pub reminder_at_remaining_tokens: Option<Vec<i64>>, |
There was a problem hiding this comment.
Cap rollout budget threshold lists
When a managed or user config supplies a large/dense reminder_at_remaining_tokens array, each newly crossed index can append another <rollout_budget> developer-context fragment over the life of the thread, but this new list has no length cap or deduplication before being stored and scanned on every request. Please enforce a small maximum (and ideally normalize duplicates) so the number of injected rollout-budget fragments remains bounded.
AGENTS.md reference: AGENTS.md:L98-L98
Useful? React with 👍 / 👎.
| #[schemars(range(min = 1))] | ||
| pub reminder_interval_tokens: Option<i64>, | ||
| /// Remaining weighted-token values that trigger reminders when crossed. | ||
| pub reminder_at_remaining_tokens: Option<Vec<i64>>, |
There was a problem hiding this comment.
Constrain threshold values in the schema
The resolver rejects zero or negative reminder_at_remaining_tokens, but the generated schema for this new array now advertises each item as an unconstrained integer. Users relying on config.schema.json can therefore get editor/CI validation success for configs that Codex later rejects at startup, so the item schema should carry the same positive-value constraint as the runtime check.
Useful? React with 👍 / 👎.
Summary
Instead of:
allow users to configure explicit remaining-token reminder thresholds:
Validation