adding config

This commit is contained in:
Ahmed Ibrahim
2025-07-31 09:44:22 -07:00
parent 961fb2d14f
commit d1275897ab
2 changed files with 16 additions and 11 deletions

View File

@@ -223,6 +223,7 @@ pub(crate) struct Session {
state: Mutex<State>,
codex_linux_sandbox_exe: Option<PathBuf>,
user_shell: shell::Shell,
show_reasoning_content: bool,
}
impl Session {
@@ -722,6 +723,7 @@ async fn submission_loop(
codex_linux_sandbox_exe: config.codex_linux_sandbox_exe.clone(),
disable_response_storage,
user_shell: default_shell,
show_reasoning_content: config.show_reasoning_content,
}));
// Patch restored state into the newly created session.
@@ -1286,15 +1288,18 @@ async fn handle_response_item(
};
sess.tx_event.send(event).await.ok();
}
for item in content {
let text = match item {
ReasoningItemContent::ReasoningText { text } => text,
};
let event = Event {
id: sub_id.to_string(),
msg: EventMsg::AgentReasoningContent(AgentReasoningContentEvent { text }),
};
sess.tx_event.send(event).await.ok();
if sess.show_reasoning_content && content.is_some() {
let content = content.unwrap();
for item in content {
let text = match item {
ReasoningItemContent::ReasoningText { text } => text,
};
let event = Event {
id: sub_id.to_string(),
msg: EventMsg::AgentReasoningContent(AgentReasoningContentEvent { text }),
};
sess.tx_event.send(event).await.ok();
}
}
None
}

View File

@@ -45,8 +45,8 @@ pub enum ResponseItem {
Reasoning {
id: String,
summary: Vec<ReasoningItemReasoningSummary>,
#[serde(default)]
content: Vec<ReasoningItemContent>,
#[serde(default, skip_serializing_if = "Option::is_none")]
content: Option<Vec<ReasoningItemContent>>,
encrypted_content: Option<String>,
},
LocalShellCall {