Skip to content

[codex] configure rollout budget reminder thresholds#29423

Merged
rka-oai merged 1 commit into
mainfrom
codex/rollout-budget-reminder-thresholds
Jun 22, 2026
Merged

[codex] configure rollout budget reminder thresholds#29423
rka-oai merged 1 commit into
mainfrom
codex/rollout-budget-reminder-thresholds

Conversation

@rka-oai

@rka-oai rka-oai commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Instead of:

reminder_interval_tokens = 65_536

allow users to configure explicit remaining-token reminder thresholds:

reminder_at_remaining_tokens = [65_536, 32_768, 16_384, 8_192, 4_096, 2_048, 1_024, 512]

Validation

  • CARGO_INCREMENTAL=0 just test -p codex-core rollout_budget: 9 passed
  • just fix -p codex-core
  • just fmt

@rka-oai rka-oai requested a review from a team as a code owner June 22, 2026 09:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an issue

#[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>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an issue

#[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>>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge 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 👍 / 👎.

@rka-oai rka-oai merged commit bd5bd95 into main Jun 22, 2026
31 checks passed
@rka-oai rka-oai deleted the codex/rollout-budget-reminder-thresholds branch June 22, 2026 20:25
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants