mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
Allow callers to set the thread source for sampling (#56364)
## What changed Add optional `threadSource` to `thread/sample` requests and apply it to the ephemeral fork. Keep `thread_sample` as the default when omitted. ## Testing Extend sampling tests to assert that turn metadata includes the supplied thread source and retains the default when no source is provided. GitOrigin-RevId: 8ea941c932267e3bcb9e6b086764ac2795d6edef
This commit is contained in:
@@ -213,7 +213,12 @@ impl SampleTask {
|
||||
model.supports_reasoning_effort_updates && options.config.model_provider.is_openai()
|
||||
});
|
||||
options.session_source = Some(SessionSource::Custom("thread_sample".to_string()));
|
||||
options.thread_source = Some(ThreadSource::Feature("thread_sample".to_string()));
|
||||
options.thread_source = Some(
|
||||
params
|
||||
.thread_source
|
||||
.map(Into::into)
|
||||
.unwrap_or_else(|| ThreadSource::Feature("thread_sample".to_string())),
|
||||
);
|
||||
options.parent_trace = trace.clone();
|
||||
if cancellation.is_cancelled() {
|
||||
return Err(internal_error("sample canceled"));
|
||||
|
||||
Reference in New Issue
Block a user