From 039abb2ae65fb4d9f6158e6a22e1ab649e4a99e1 Mon Sep 17 00:00:00 2001 From: zLeoAlex Date: Sun, 7 Jun 2026 15:20:51 +0800 Subject: [PATCH] refactor(cache): remove render_core_tool_taxonomy_block, inline to body variant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace the 2 remaining test callers with render_core_tool_taxonomy_body (neither test depends on the ## heading — they check content only). - Delete render_core_tool_taxonomy_block — zero production callers after the previous refactor. --- crates/tui/src/prompts.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/crates/tui/src/prompts.rs b/crates/tui/src/prompts.rs index 032fd07a..6343f7e9 100644 --- a/crates/tui/src/prompts.rs +++ b/crates/tui/src/prompts.rs @@ -816,15 +816,6 @@ pub(crate) fn render_core_tool_taxonomy_body(mode: AppMode) -> String { sentences.join(" ") } -/// Render the full taxonomy block **with** a `## Core Tool Taxonomy` heading. -/// Kept for backward-compatibility with existing callers (tests, diagnostics). -pub(crate) fn render_core_tool_taxonomy_block(mode: AppMode) -> String { - format!( - "## Core Tool Taxonomy\n\n{}", - render_core_tool_taxonomy_body(mode) - ) -} - fn core_taxonomy_tools_for_mode(mode: AppMode) -> Vec<&'static str> { let core_tools = crate::core::engine::default_active_native_tool_names(); core_tools @@ -1606,7 +1597,7 @@ mod tests { #[test] fn plan_prompt_taxonomy_omits_run_tests() { - let taxonomy = render_core_tool_taxonomy_block(AppMode::Plan); + let taxonomy = render_core_tool_taxonomy_body(AppMode::Plan); // Plan taxonomy should omit execution tools (verified at the source). assert!( taxonomy.contains("for discovery") && taxonomy.contains("for git inspection"), @@ -2056,7 +2047,7 @@ mod tests { "base prompt must not contain static CJK priming tokens" ); for mode in [AppMode::Agent, AppMode::Plan, AppMode::Yolo] { - let taxonomy = render_core_tool_taxonomy_block(mode); + let taxonomy = render_core_tool_taxonomy_body(mode); assert!( !contains_cjk(&taxonomy), "tool taxonomy must not contain static CJK priming tokens: {taxonomy:?}"