mirror of
https://github.com/openai/codex.git
synced 2026-11-03 08:22:30 +00:00
Always send reasoning parameters in Responses requests (#32206)
## What changed - Build a reasoning payload for every Responses request and always include `reasoning.encrypted_content`. - Remove `supports_reasoning_summaries` from model metadata and retire the `model_supports_reasoning_summaries` configuration override. - Use configured or model-default reasoning effort without a capability gate, including for guardian reviews and tracing. GitOrigin-RevId: 2c9f194a5d2d4d688a2235299e6358f82ab8e1ea
This commit is contained in:
1 parent
2b9c050460
commit
d2d00b6632
35 files changed
+25
-143
No files matched your search
+17
-25
@@ -804,25 +804,21 @@ impl ModelClient {
|
||||
model_info: &ModelInfo,
|
||||
effort: Option<ReasoningEffortConfig>,
|
||||
summary: ReasoningSummaryConfig,
|
||||
) -> Option<Reasoning> {
|
||||
if model_info.supports_reasoning_summaries {
|
||||
Some(Reasoning {
|
||||
effort: effort
|
||||
.or_else(|| model_info.default_reasoning_level.clone())
|
||||
.map(reasoning_effort_for_request),
|
||||
summary: if summary == ReasoningSummaryConfig::None {
|
||||
None
|
||||
} else {
|
||||
Some(summary)
|
||||
},
|
||||
// When Responses Lite is disabled, omit context so Responses uses the default,
|
||||
// which is currently `current_turn`.
|
||||
context: model_info
|
||||
.use_responses_lite
|
||||
.then_some(ReasoningContext::AllTurns),
|
||||
})
|
||||
} else {
|
||||
None
|
||||
) -> Reasoning {
|
||||
Reasoning {
|
||||
effort: effort
|
||||
.or_else(|| model_info.default_reasoning_level.clone())
|
||||
.map(reasoning_effort_for_request),
|
||||
summary: if summary == ReasoningSummaryConfig::None {
|
||||
None
|
||||
} else {
|
||||
Some(summary)
|
||||
},
|
||||
// When Responses Lite is disabled, omit context so Responses uses the default,
|
||||
// which is currently `current_turn`.
|
||||
context: model_info
|
||||
.use_responses_lite
|
||||
.then_some(ReasoningContext::AllTurns),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -871,12 +867,8 @@ impl ModelClient {
|
||||
.then_some(StreamOptions {
|
||||
reasoning_summary_delivery: codex_api::ReasoningSummaryDelivery::SequentialCutoff,
|
||||
});
|
||||
let reasoning = Self::build_reasoning(model_info, effort, summary);
|
||||
let include = if reasoning.is_some() {
|
||||
vec!["reasoning.encrypted_content".to_string()]
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
let reasoning = Some(Self::build_reasoning(model_info, effort, summary));
|
||||
let include = vec!["reasoning.encrypted_content".to_string()];
|
||||
let verbosity = if model_info.support_verbosity {
|
||||
self.state.model_verbosity.or(model_info.default_verbosity)
|
||||
} else {
|
||||
|
||||
@@ -262,7 +262,6 @@ fn test_model_info() -> ModelInfo {
|
||||
"upgrade": null,
|
||||
"base_instructions": "base instructions",
|
||||
"model_messages": null,
|
||||
"supports_reasoning_summaries": false,
|
||||
"support_verbosity": false,
|
||||
"default_verbosity": null,
|
||||
"apply_patch_tool_type": null,
|
||||
|
||||
@@ -952,9 +952,6 @@ pub struct Config {
|
||||
/// using the Responses API. When unset, the model catalog default is used.
|
||||
pub model_reasoning_summary: Option<ReasoningSummary>,
|
||||
|
||||
/// Optional override to force-enable reasoning summaries for the configured model.
|
||||
pub model_supports_reasoning_summaries: Option<bool>,
|
||||
|
||||
/// Optional full model catalog loaded from `model_catalog_json`.
|
||||
/// When set, this replaces the bundled catalog for the current process.
|
||||
pub model_catalog: Option<ModelsResponse>,
|
||||
@@ -1476,7 +1473,6 @@ impl Config {
|
||||
tool_output_token_limit: self.tool_output_token_limit,
|
||||
base_instructions: self.base_instructions.clone(),
|
||||
personality_enabled: self.features.enabled(Feature::Personality),
|
||||
model_supports_reasoning_summaries: self.model_supports_reasoning_summaries,
|
||||
model_catalog: self.model_catalog.clone(),
|
||||
}
|
||||
}
|
||||
@@ -3903,7 +3899,6 @@ impl Config {
|
||||
model_reasoning_effort: cfg.model_reasoning_effort,
|
||||
plan_mode_reasoning_effort: cfg.plan_mode_reasoning_effort,
|
||||
model_reasoning_summary: cfg.model_reasoning_summary,
|
||||
model_supports_reasoning_summaries: cfg.model_supports_reasoning_summaries,
|
||||
model_catalog,
|
||||
model_verbosity: cfg.model_verbosity,
|
||||
chatgpt_base_url: cfg
|
||||
|
||||
@@ -720,14 +720,10 @@ async fn run_review_on_session(
|
||||
¶ms.spawn_config.to_models_manager_config(),
|
||||
)
|
||||
.await;
|
||||
let guardian_reasoning_effort = if model_info.supports_reasoning_summaries {
|
||||
params
|
||||
.reasoning_effort
|
||||
.clone()
|
||||
.or_else(|| model_info.default_reasoning_level.clone())
|
||||
} else {
|
||||
None
|
||||
};
|
||||
let guardian_reasoning_effort = params
|
||||
.reasoning_effort
|
||||
.clone()
|
||||
.or_else(|| model_info.default_reasoning_level.clone());
|
||||
let mut analytics_result =
|
||||
GuardianReviewAnalyticsResult::from_session(GuardianReviewSessionAnalyticsParams {
|
||||
guardian_thread_id: review_session.codex.session.thread_id.to_string(),
|
||||
|
||||
@@ -177,13 +177,9 @@ impl TurnContext {
|
||||
}
|
||||
|
||||
pub(crate) fn effective_reasoning_effort(&self) -> Option<ReasoningEffortConfig> {
|
||||
if self.model_info.supports_reasoning_summaries {
|
||||
self.reasoning_effort
|
||||
.clone()
|
||||
.or_else(|| self.model_info.default_reasoning_level.clone())
|
||||
} else {
|
||||
None
|
||||
}
|
||||
self.reasoning_effort
|
||||
.clone()
|
||||
.or_else(|| self.model_info.default_reasoning_level.clone())
|
||||
}
|
||||
|
||||
pub(crate) fn effective_reasoning_effort_for_tracing(&self) -> String {
|
||||
|
||||
Reference in new issue
Block a user