Fix duplicate todo_read display in agent mode

The print_todo_compact() function was missing the call to clear the
streaming hint line before printing the final tool output. This caused
the tool name to appear twice when the hint line wasn't cleared:

  ● todo_read     ● todo_read   | empty

Added the missing handle_hint(ToolParsingHint::Complete) call to match
the behavior of print_tool_compact().
This commit is contained in:
Dhanji R. Prasanna
2026-01-16 06:38:11 +05:30
parent 25d35529e7
commit 637884f84b

View File

@@ -584,6 +584,10 @@ impl UiWriter for ConsoleUiWriter {
fn print_todo_compact(&self, content: Option<&str>, is_write: bool) -> bool {
let tool_name = if is_write { "todo_write" } else { "todo_read" };
// Clear any streaming hint that might be showing
// This ensures we don't duplicate the tool name on the line
self.hint_state.handle_hint(ToolParsingHint::Complete);
let is_agent_mode = self.hint_state.is_agent_mode.load(Ordering::Relaxed);
let tool_color = if is_agent_mode { TOOL_COLOR_AGENT } else { TOOL_COLOR_NORMAL };