mirror of
https://github.com/zed-industries/zed.git
synced 2026-12-02 21:40:41 +01:00
65da2c2c6a
This PR removes the `fn name()` default method from the `AgentTool` trait (which just returned `Self::NAME`) and replaces all call sites with direct use of the `NAME` associated constant. This lets us use it as a single source of truth in macros that want to access it at compile time. This PR also replaces hardcoded tool name string literals throughout the codebase with the corresponding `NAME` constants, so tool name references stay in sync if a tool is renamed. Intentionally not changed: - **Display strings** like `"Thinking"` and `"Subagent"` (user-facing UI labels) - **Serde attributes** like `#[serde(rename = "thinking")]` (wire format) - **The test assertion** `assert_eq!(SubagentTool::NAME, "subagent")` (replacing the literal would make it tautological) - **MCP server names** like `"mcp:srv:terminal"` (not tool identifiers) Release Notes: - N/A