Retain TUI delegation prompts in thread model history (#61210)

## What changed

Set `retain: true` on tool outputs submitted when TUI dynamic tools start a turn, requesting retention of delegation prompts in the thread's model history.

## Testing

Update session lifecycle assertions to require `retain: true` for both `create_thread` and `send_message_to_thread` requests.

GitOrigin-RevId: 095d0f6f687a67fbf0b5ffd98539f764d32e2acc
This commit is contained in:
Won Park
2026-11-13 00:26:39 +00:00
committed by copyberry
parent 6242064da0
commit f562a7b3e2
2 changed files with 3 additions and 1 deletions
@@ -3276,6 +3276,7 @@ async fn check_dynamic_tool_requests(
serde_json::json!({
"name": "create_thread",
"namespace": "codex_tui",
"retain": true,
"output": format!(
"<codex_delegation>\n <source_thread_id>{creation_source}</source_thread_id>\n <input>Check &lt;main&gt; &amp; report</input>\n</codex_delegation>"
)
@@ -3361,6 +3362,7 @@ async fn check_dynamic_tool_requests(
serde_json::json!({
"name": "send_message_to_thread",
"namespace": "codex_tui",
"retain": true,
"output": format!(
"<codex_delegation>\n <source_thread_id>{thread_id}</source_thread_id>\n <input>Follow &lt;up&gt; &amp; report</input>\n</codex_delegation>"
)
+1 -1
View File
@@ -1271,7 +1271,7 @@ async fn start_turn(
// Older app-server/TUI versions are intentionally unsupported:
// preserving tool authority takes precedence over legacy fallback.
tool_output: Some(Box::new(TurnToolOutput {
retain: false,
retain: true,
name: tool.to_string(),
namespace: Some(NAMESPACE.to_string()),
output: FunctionCallOutputBody::Text(prompt),