Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions codex-rs/tui/src/chatwidget/tests/app_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ use pretty_assertions::assert_eq;
#[tokio::test]
async fn invalid_url_elicitation_is_declined() {
let (mut chat, _app_event_tx, mut rx, _op_rx) = make_chatwidget_manual_with_sender().await;
let thread_id = ThreadId::new();
chat.thread_id = Some(thread_id);
let visible_thread_id = ThreadId::new();
let request_thread_id = ThreadId::new();
chat.thread_id = Some(visible_thread_id);

chat.handle_elicitation_request_now(
codex_app_server_protocol::RequestId::Integer(9),
codex_app_server_protocol::McpServerElicitationRequestParams {
thread_id: thread_id.to_string(),
thread_id: request_thread_id.to_string(),
turn_id: Some("turn-auth".to_string()),
server_name: "payments".to_string(),
request: codex_app_server_protocol::McpServerElicitationRequest::Url {
Expand All @@ -33,7 +34,7 @@ async fn invalid_url_elicitation_is_declined() {
content: None,
meta: None,
},
}) if op_thread_id == thread_id && server_name == "payments"
}) if op_thread_id == request_thread_id && server_name == "payments"
);
}

Expand Down
3 changes: 2 additions & 1 deletion codex-rs/tui/src/chatwidget/tool_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,8 @@ impl ChatWidget {
server_name: params.server_name.clone(),
});

let thread_id = self.thread_id.unwrap_or_default();
let thread_id = ThreadId::from_string(&params.thread_id)
.unwrap_or_else(|_| self.thread_id.unwrap_or_default());
if let Some(params) = crate::bottom_pane::AppLinkViewParams::from_url_app_server_request(
thread_id,
&params.server_name,
Expand Down
Loading