feat: show MCP tool calls in TUI (#836)
Adds logic for the `McpToolCallBegin` and `McpToolCallEnd` events in `codex-rs/tui/src/chatwidget.rs` so they get entries in the conversation history in the TUI. Building on top of https://github.com/openai/codex/pull/829, here is the result of running: ``` cargo run --bin codex -- 'what is the weather in san francisco tomorrow' ``` 
This commit is contained in:
@@ -328,6 +328,25 @@ impl ChatWidget<'_> {
|
||||
.record_completed_exec_command(call_id, stdout, stderr, exit_code);
|
||||
self.request_redraw()?;
|
||||
}
|
||||
EventMsg::McpToolCallBegin {
|
||||
call_id,
|
||||
server,
|
||||
tool,
|
||||
arguments,
|
||||
} => {
|
||||
self.conversation_history
|
||||
.add_active_mcp_tool_call(call_id, server, tool, arguments);
|
||||
self.request_redraw()?;
|
||||
}
|
||||
EventMsg::McpToolCallEnd {
|
||||
call_id,
|
||||
success,
|
||||
result,
|
||||
} => {
|
||||
self.conversation_history
|
||||
.record_completed_mcp_tool_call(call_id, success, result);
|
||||
self.request_redraw()?;
|
||||
}
|
||||
event => {
|
||||
self.conversation_history
|
||||
.add_background_event(format!("{event:?}"));
|
||||
|
||||
Reference in New Issue
Block a user