mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
Gate Apps usage instructions by model capability (#37145)
## What changed - Add `include_apps_usage_instructions` to model metadata, defaulting to true for compatibility with existing metadata. - Emit generic Apps guidance only when apps are available and the selected model enables it. - Enable the capability for interactive model presets while leaving `codex-auto-review` and local models opted out. ## Testing - Verify that missing metadata defaults to enabled and an explicit opt-out survives serialization. GitOrigin-RevId: 6a20573cddfd3b80083d2b4b015829b49e6cc283
This commit is contained in:
1 parent
72d937ed4d
commit
2b915a2eed
15 files changed
+43
-1
No files matched your search
@@ -394,6 +394,8 @@ pub struct ModelInfo {
|
||||
pub include_skills_usage_instructions: bool,
|
||||
#[serde(default)]
|
||||
pub include_plugin_usage_instructions: bool,
|
||||
#[serde(default = "default_true")]
|
||||
pub include_apps_usage_instructions: bool,
|
||||
/// Whether the model accepts the Responses API `reasoning.summary` parameter.
|
||||
#[serde(default = "default_true", skip_serializing_if = "is_true")]
|
||||
pub supports_reasoning_summary_parameter: bool,
|
||||
@@ -831,6 +833,7 @@ mod tests {
|
||||
model_messages: spec,
|
||||
include_skills_usage_instructions: false,
|
||||
include_plugin_usage_instructions: false,
|
||||
include_apps_usage_instructions: false,
|
||||
supports_reasoning_summary_parameter: true,
|
||||
default_reasoning_summary: ReasoningSummary::Auto,
|
||||
support_verbosity: false,
|
||||
@@ -1424,6 +1427,7 @@ mod tests {
|
||||
);
|
||||
assert!(!model.include_skills_usage_instructions);
|
||||
assert!(!model.include_plugin_usage_instructions);
|
||||
assert!(model.include_apps_usage_instructions);
|
||||
assert!(model.supports_reasoning_summary_parameter);
|
||||
assert!(!model.supports_image_detail_original);
|
||||
assert_eq!(model.web_search_tool_type, WebSearchToolType::Text);
|
||||
@@ -1434,6 +1438,16 @@ mod tests {
|
||||
assert_eq!(model.tool_mode, None);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn model_info_preserves_explicit_apps_guidance_opt_out() {
|
||||
let value = serde_json::to_value(test_model(/*spec*/ None))
|
||||
.expect("serialize model info with explicit apps guidance opt-out");
|
||||
assert_eq!(value["include_apps_usage_instructions"], false);
|
||||
|
||||
let model = serde_json::from_value::<ModelInfo>(value).expect("deserialize model info");
|
||||
assert!(!model.include_apps_usage_instructions);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn model_info_deserializes_known_tool_mode() {
|
||||
let mut value =
|
||||
|
||||
Reference in new issue
Block a user