mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
Use lightweight settings for app-server thread metadata (#63990)
## Why Enriching loaded thread results builds a full configuration snapshot, including an execution permission profile, just to read display settings. ## What changed Read the configured model, reasoning effort, environment selections, and session source directly from the loaded thread when enriching results. The environment data still includes the working directory and runtime workspace roots. ## Testing Extend the core test to verify that reading display settings matches the configured snapshot's display fields without triggering a model lookup. Extend the app-server test to verify that thread reads and lists return explicit runtime workspace roots. GitOrigin-RevId: f7053554fdb0f02bebb51b4cafda2ef39e6e81a5
This commit is contained in:
@@ -2405,6 +2405,18 @@ impl Session {
|
||||
configuration.thread_config_snapshot(configuration.environments.clone())
|
||||
}
|
||||
|
||||
pub(crate) async fn thread_view_settings(&self) -> crate::ThreadViewSettings {
|
||||
let state = self.state.lock().await;
|
||||
let configuration = &state.session_configuration;
|
||||
let collaboration = &configuration.step_settings.collaboration_mode;
|
||||
crate::ThreadViewSettings {
|
||||
model: collaboration.model().to_string(),
|
||||
reasoning_effort: collaboration.reasoning_effort(),
|
||||
environments: configuration.environments.iter().map(Into::into).collect(),
|
||||
session_source: configuration.session_source.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn thread_config_snapshot(&self) -> ThreadConfigSnapshot {
|
||||
self.resume_config_snapshot().await.0
|
||||
}
|
||||
|
||||
@@ -444,6 +444,24 @@ async fn thread_metadata_and_goal_recording_do_not_resolve_the_selected_model()
|
||||
assert_eq!(local.model, MODEL_B);
|
||||
assert_eq!(local.service_tier.as_deref(), Some("unsupported"));
|
||||
|
||||
let view = tokio::select! {
|
||||
settings = session.thread_view_settings() => settings,
|
||||
_ = lookup.started.notified() => panic!("list settings requested model info"),
|
||||
};
|
||||
assert_eq!(
|
||||
view,
|
||||
crate::ThreadViewSettings {
|
||||
model: local.model.clone(),
|
||||
reasoning_effort: local.reasoning_effort.clone(),
|
||||
environments: local
|
||||
.environment_selections()
|
||||
.iter()
|
||||
.map(Into::into)
|
||||
.collect(),
|
||||
session_source: local.session_source.clone(),
|
||||
},
|
||||
);
|
||||
|
||||
let update = UserGoalUpdate::Set {
|
||||
objective: Some("Keep the existing tests".into()),
|
||||
status: None,
|
||||
|
||||
Reference in New Issue
Block a user