refactor(cache): remove render_core_tool_taxonomy_block, inline to body variant

- 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.
This commit is contained in:
zLeoAlex
2026-06-07 15:20:51 +08:00
parent 12167b39c3
commit 039abb2ae6
+2 -11
View File
@@ -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:?}"