From 6cbb3b96357e4c2874c8ca0afa49627df872aa4f Mon Sep 17 00:00:00 2001
From: Kavi Bidlack <104799865+kbidlack@users.noreply.github.com>
Date: Thu, 19 Mar 2026 09:26:27 -0700
Subject: [PATCH] agent: Don't render Markdown for file names in tool calls
(#49668)
Closes #44184
Closes #45729
Before (incorrect; __init__ is bold):
After (\_\_init\_\_ renders correctly):
Release Notes:
- Agent: Fix rendering of filenames in edit tool header
---
crates/acp_thread/src/acp_thread.rs | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs
index 1a5764eca1b1861aa4c928aa5ede12e18c49e64b..d4e0e16ee1d4e88589250f6b91748ede3197f7ba 100644
--- a/crates/acp_thread/src/acp_thread.rs
+++ b/crates/acp_thread/src/acp_thread.rs
@@ -31,6 +31,7 @@ use task::{Shell, ShellBuilder};
pub use terminal::*;
use text::Bias;
use ui::App;
+use util::markdown::MarkdownEscaped;
use util::path_list::PathList;
use util::{ResultExt, get_default_system_shell_preferring_bash, paths::PathStyle};
use uuid::Uuid;
@@ -246,6 +247,8 @@ impl ToolCall {
) -> Result {
let title = if tool_call.kind == acp::ToolKind::Execute {
tool_call.title
+ } else if tool_call.kind == acp::ToolKind::Edit {
+ MarkdownEscaped(tool_call.title.as_str()).to_string()
} else if let Some((first_line, _)) = tool_call.title.split_once("\n") {
first_line.to_owned() + "…"
} else {
@@ -334,6 +337,8 @@ impl ToolCall {
self.label.update(cx, |label, cx| {
if self.kind == acp::ToolKind::Execute {
label.replace(title, cx);
+ } else if self.kind == acp::ToolKind::Edit {
+ label.replace(MarkdownEscaped(&title).to_string(), cx)
} else if let Some((first_line, _)) = title.split_once("\n") {
label.replace(first_line.to_owned() + "…", cx);
} else {