mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
## What changed - Add `ResolvedModelMessages` to resolve catalog text and bundled defaults while preserving explicit empty overrides and their source. - Move base-instruction rendering, Guardian prompt composition, multi-agent role rendering, and `update_plan` guidance filtering into `codex-prompts`; migrate consumers to the shared APIs. - Separate permission-profile resolution from prompt composition, and annotate Guardian policy and classifier instructions with content kinds. ## Testing Add and update coverage for missing versus empty templates, literal overrides, multi-agent role composition, Guardian policy substitution and truncation, and preservation of permission path spellings and order. GitOrigin-RevId: 52335bb7acec0f432d5c57acb2accd5f0276056e
35 lines
1.2 KiB
Rust
35 lines
1.2 KiB
Rust
use super::*;
|
|
use pretty_assertions::assert_eq;
|
|
|
|
#[test]
|
|
fn preset_names_use_mode_display_names() {
|
|
let presets = builtin_collaboration_mode_presets();
|
|
let [plan, default] = presets.as_slice() else {
|
|
panic!("expected Plan and Default presets");
|
|
};
|
|
assert_eq!(plan.name, ModeKind::Plan.display_name());
|
|
assert_eq!(default.name, ModeKind::Default.display_name());
|
|
assert_eq!(plan.model, None);
|
|
assert_eq!(plan.reasoning_effort, Some(Some(ReasoningEffort::Medium)));
|
|
assert_eq!(default.model, None);
|
|
assert_eq!(default.reasoning_effort, None);
|
|
}
|
|
|
|
#[test]
|
|
fn default_mode_instructions_follow_user_input_tool_availability() {
|
|
let presets = builtin_collaboration_mode_presets();
|
|
let default_instructions = presets[1]
|
|
.developer_instructions
|
|
.as_ref()
|
|
.expect("default preset should include instructions")
|
|
.as_ref()
|
|
.expect("default instructions should be set");
|
|
|
|
assert!(default_instructions.contains(
|
|
"Use the `request_user_input` tool only when it is listed in the available tools"
|
|
));
|
|
assert!(
|
|
default_instructions.contains("Ask the user directly with one concise plain-text question")
|
|
);
|
|
}
|