diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs
index c8d7d6161..6de069420 100644
--- a/codex-rs/tui/src/app.rs
+++ b/codex-rs/tui/src/app.rs
@@ -4620,13 +4620,7 @@ impl App {
tui.frame_requester().schedule_frame();
}
AppEvent::ResumeSessionByIdOrName(id_or_name) => {
- match crate::lookup_session_target_with_app_server(
- app_server,
- self.config.codex_home.as_path(),
- &id_or_name,
- )
- .await?
- {
+ match crate::lookup_session_target_with_app_server(app_server, &id_or_name).await? {
Some(target_session) => {
return self
.resume_target_session(tui, app_server, target_session)
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index 3d1c8ec60..9fe233044 100644
--- a/codex-rs/tui/src/chatwidget.rs
+++ b/codex-rs/tui/src/chatwidget.rs
@@ -226,7 +226,6 @@ use codex_protocol::request_user_input::RequestUserInputQuestionOption;
use codex_protocol::user_input::ByteRange;
use codex_protocol::user_input::TextElement;
use codex_protocol::user_input::UserInput;
-use codex_rollout::find_thread_name_by_id;
use codex_terminal_detection::Multiplexer;
use codex_terminal_detection::TerminalInfo;
use codex_terminal_detection::TerminalName;
@@ -2186,45 +2185,16 @@ impl ChatWidget {
}
fn emit_forked_thread_event(&mut self, forked_from_id: ThreadId) {
- let app_event_tx = self.app_event_tx.clone();
- let codex_home = self.config.codex_home.clone();
- tokio::spawn(async move {
- let forked_from_id_text = forked_from_id.to_string();
- let send_name_and_id = |name: String| {
- let line: Line<'static> = vec![
- "• ".dim(),
- "Thread forked from ".into(),
- name.cyan(),
- " (".into(),
- forked_from_id_text.clone().cyan(),
- ")".into(),
- ]
- .into();
- app_event_tx.send(AppEvent::InsertHistoryCell(Box::new(
- PlainHistoryCell::new(vec![line]),
- )));
- };
- let send_id_only = || {
- let line: Line<'static> = vec![
- "• ".dim(),
- "Thread forked from ".into(),
- forked_from_id_text.clone().cyan(),
- ]
- .into();
- app_event_tx.send(AppEvent::InsertHistoryCell(Box::new(
- PlainHistoryCell::new(vec![line]),
- )));
- };
-
- match find_thread_name_by_id(&codex_home, &forked_from_id).await {
- Ok(Some(name)) if !name.trim().is_empty() => send_name_and_id(name),
- Ok(_) => send_id_only(),
- Err(err) => {
- tracing::warn!("Failed to read forked thread name: {err}");
- send_id_only();
- }
- }
- });
+ let forked_from_id_text = forked_from_id.to_string();
+ let line: Line<'static> = vec![
+ "• ".dim(),
+ "Thread forked from ".into(),
+ forked_from_id_text.cyan(),
+ ]
+ .into();
+ self.app_event_tx.send(AppEvent::InsertHistoryCell(Box::new(
+ PlainHistoryCell::new(vec![line]),
+ )));
}
fn on_thread_name_updated(&mut self, event: codex_protocol::protocol::ThreadNameUpdatedEvent) {
diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__forked_thread_history_line.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__forked_thread_history_line.snap
deleted file mode 100644
index d089f5963..000000000
--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__forked_thread_history_line.snap
+++ /dev/null
@@ -1,5 +0,0 @@
----
-source: tui/src/chatwidget/tests.rs
-expression: combined
----
-• Thread forked from named-thread (e9f18a88-8081-4e51-9d4e-8af5cde2d8dd)
diff --git a/codex-rs/tui/src/chatwidget/tests/history_replay.rs b/codex-rs/tui/src/chatwidget/tests/history_replay.rs
index 71987e590..80fa79e1d 100644
--- a/codex-rs/tui/src/chatwidget/tests/history_replay.rs
+++ b/codex-rs/tui/src/chatwidget/tests/history_replay.rs
@@ -387,45 +387,6 @@ async fn replayed_user_message_with_only_local_images_does_not_render_history_ce
assert!(!found_user_history_cell);
}
-#[tokio::test]
-async fn forked_thread_history_line_includes_name_and_id_snapshot() {
- let (chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
- let mut chat = chat;
- let temp = tempdir().expect("tempdir");
- chat.config.codex_home =
- codex_utils_absolute_path::AbsolutePathBuf::from_absolute_path(temp.path())
- .expect("temp dir is absolute");
-
- let forked_from_id =
- ThreadId::from_string("e9f18a88-8081-4e51-9d4e-8af5cde2d8dd").expect("forked id");
- let session_index_entry = format!(
- "{{\"id\":\"{forked_from_id}\",\"thread_name\":\"named-thread\",\"updated_at\":\"2024-01-02T00:00:00Z\"}}\n"
- );
- std::fs::write(temp.path().join("session_index.jsonl"), session_index_entry)
- .expect("write session index");
-
- chat.emit_forked_thread_event(forked_from_id);
-
- let history_cell = tokio::time::timeout(std::time::Duration::from_secs(2), async {
- loop {
- match rx.recv().await {
- Some(AppEvent::InsertHistoryCell(cell)) => break cell,
- Some(_) => continue,
- None => panic!("app event channel closed before forked thread history was emitted"),
- }
- }
- })
- .await
- .expect("timed out waiting for forked thread history");
- let combined = lines_to_single_string(&history_cell.display_lines(/*width*/ 80));
-
- assert!(
- combined.contains("Thread forked from"),
- "expected forked thread message in history"
- );
- assert_chatwidget_snapshot!("forked_thread_history_line", combined);
-}
-
#[tokio::test]
async fn forked_thread_history_line_without_name_shows_id_once_snapshot() {
let (chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
diff --git a/codex-rs/tui/src/lib.rs b/codex-rs/tui/src/lib.rs
index 0b6887cdd..7e5d03ecd 100644
--- a/codex-rs/tui/src/lib.rs
+++ b/codex-rs/tui/src/lib.rs
@@ -49,7 +49,6 @@ use codex_protocol::protocol::AskForApproval;
use codex_protocol::protocol::RolloutItem;
use codex_protocol::protocol::RolloutLine;
use codex_protocol::protocol::TurnContextItem;
-use codex_rollout::find_thread_meta_by_name_str;
use codex_rollout::read_session_meta_line;
use codex_rollout::state_db::get_state_db;
use codex_state::log_db;
@@ -509,7 +508,6 @@ fn session_target_from_app_server_thread(
async fn lookup_session_target_by_name_with_app_server(
app_server: &mut AppServerSession,
- codex_home: &Path,
name: &str,
) -> color_eyre::Result