core: raise token budget message limits (#29970)

## Why

Token-budget reminder and guidance messages can require more than 1,000
bytes to provide useful model-facing instructions. At the same time,
these strings are injected into model-visible context, so their size
must remain tightly bounded in response to the P0 context-growth
concern. A 2,000-byte runtime cap provides additional room without
allowing the substantially larger context growth of a 4 KiB limit.

## What changed

- raises the runtime byte limits for token-budget reminder templates and
guidance messages from 1,000 to 2,000
- raises the corresponding JSON Schema `maxLength` values to 2,000
- regenerates `codex-rs/core/config.schema.json`

## Testing

- `just test -p codex-features`
- `just test -p codex-core load_config_resolves_token_budget_config
load_config_rejects_invalid_token_budget_reminder_template`

The full `codex-core` test run completed 2,858 tests successfully and
encountered seven unrelated environment-sensitive failures involving
Seatbelt/network environment assertions, MCP capability setup, and abort
timing.
This commit is contained in:
Michael Bolin
2026-06-24 22:05:32 -07:00
committed by GitHub
Unverified
parent cef5444a80
commit 22f12568e1
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -86,11 +86,11 @@ pub struct TokenBudgetConfigToml {
/// Reminder template. `{n_remaining}` is replaced with the tokens remaining before
/// auto-compaction.
#[serde(skip_serializing_if = "Option::is_none")]
#[schemars(length(min = 1, max = 1000))]
#[schemars(length(min = 1, max = 2000))]
pub reminder_message_template: Option<String>,
/// Guidance appended to the context-window metadata in a developer message.
#[serde(skip_serializing_if = "Option::is_none")]
#[schemars(length(max = 1000))]
#[schemars(length(max = 2000))]
pub guidance_message: Option<String>,
}