mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
Make Guardian V3 routing and retrieval guidance configurable (#62372)
## Why Guardian V3 uses fixed guidance for grouping evidence into board channels and deciding when to retrieve more evidence. Longer routing instructions also leave less room for evidence in the model's context window. ## What changed Under `features.guardianv3`, add `housekeeper.routing_instructions` and `reviewer.retrieval_instructions` to customize those strategies while preserving the routing format and the reviewer's board and authorization rules. Blank or omitted instructions use the built-in guidance. Add an optional `max_instruction_tokens` cap that validates each custom prompt separately using an estimated token count. Ignore both prompts and the cap in project config. The `housekeeper.batch_timeout_ms` setting controls the per-batch routing timeout and defaults to 90 seconds. Size routing batches to fit the model's input window after accounting for the prompt and response schema. Route the largest fitting prefix of whole evidence records within the tool-output budget and leave the rest pending. ## Testing Cover prompt validation, project config filtering, feature toggle merging, and default retrieval guidance. Exercise custom prompts in model requests and verify that routing reduces a batch under context pressure or stops without advancing the cursor when even one record cannot fit. GitOrigin-RevId: 83b3fcd23c680e90d2b2aea82a4a290633729658
This commit is contained in:
@@ -106,14 +106,9 @@ pub(crate) fn thread_extensions(
|
||||
);
|
||||
if config.features.enabled(codex_features::Feature::GuardianV3) {
|
||||
let board_manager = thread_manager.clone();
|
||||
codex_guardian_v3::install(
|
||||
&mut builder,
|
||||
thread_manager.clone(),
|
||||
config.sqlite_config().clone(),
|
||||
move |root| {
|
||||
codex_agent_message_board_host::local_board_host(board_manager.clone(), root)
|
||||
},
|
||||
);
|
||||
codex_guardian_v3::install(&mut builder, thread_manager.clone(), config, move |root| {
|
||||
codex_agent_message_board_host::local_board_host(board_manager.clone(), root)
|
||||
});
|
||||
}
|
||||
codex_guardian_v2::install(&mut builder, auth_manager.clone(), thread_manager);
|
||||
codex_memories_extension::install(&mut builder, codex_otel::global());
|
||||
|
||||
Reference in New Issue
Block a user