From 7c9333e9db6c608dba4ebf5948235d2320d189af Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Sat, 2 May 2026 09:56:53 -0700 Subject: [PATCH] Document goal-started thread materialization --- .../src/codex_message_processor/thread_goal_handlers.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codex-rs/app-server/src/codex_message_processor/thread_goal_handlers.rs b/codex-rs/app-server/src/codex_message_processor/thread_goal_handlers.rs index 2e2880393e..3cdb86cd43 100644 --- a/codex-rs/app-server/src/codex_message_processor/thread_goal_handlers.rs +++ b/codex-rs/app-server/src/codex_message_processor/thread_goal_handlers.rs @@ -60,6 +60,8 @@ impl CodexMessageProcessor { if let Some(objective) = objective && running_thread.is_some() { + // `/goal` can be the first interaction on a lazily-created thread. Materialize the + // rollout now so thread list/resume can discover it on disk. if let Err(err) = self.thread_store.persist_thread(thread_id).await { self.send_internal_error( request_id, @@ -84,6 +86,9 @@ impl CodexMessageProcessor { .as_deref() .is_none_or(|message| message.trim().is_empty()) { + // Thread previews come from the first user message. If the first interaction was a + // goal command, seed that command into the rollout so the resume picker has a + // stable preview without changing threads that already have user history. let item = RolloutItem::EventMsg(EventMsg::UserMessage(UserMessageEvent { message: format!("/goal {objective}"), images: None,