mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Allow per-sample model overrides in thread/sample (#62419)
## Why Clients sampling a thread could only use the source thread's model. ## What changed Add an optional `model` field to the experimental `thread/sample` request. Omitting it or passing `null` inherits the source thread's model. When an override is supplied, the server uses the selected model's capabilities to decide whether to apply the requested reasoning effort. ## Testing Add an app-server integration test that checks model selection and reasoning effort for the overridden sample, then verifies that a subsequent sample and a follow-up turn use the source model. GitOrigin-RevId: f5c54ca3d693d31e1f3e0628a520583330a5d56d
This commit is contained in:
@@ -179,7 +179,11 @@ impl SampleTask {
|
||||
.map_err(|error| internal_error(error.to_string()))?;
|
||||
let model = parent
|
||||
.model_info(
|
||||
options.config.model.as_deref().unwrap_or(&snapshot.model),
|
||||
params
|
||||
.model
|
||||
.as_deref()
|
||||
.or(options.config.model.as_deref())
|
||||
.unwrap_or(&snapshot.model),
|
||||
&options.config.to_models_manager_config(),
|
||||
)
|
||||
.await;
|
||||
@@ -263,6 +267,7 @@ impl SampleTask {
|
||||
text_elements: Vec::new(),
|
||||
}])
|
||||
.with_thread_settings(ThreadSettingsOverrides {
|
||||
model: params.model,
|
||||
effort: effort.map(Some),
|
||||
..Default::default()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user