diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index ffdbb2c..7919d4d 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -37,7 +37,10 @@ struct PendingToolUse { tool_input: serde_json::Value, } -const SEARCH_TOOLS: [&str; 5] = ["Read", "Glob", "Grep", "WebSearch", "WebFetch"]; +// "Monitor" added in Claude Code v2.1.98 — it streams events and is observational in nature, +// so it maps to the Searching character state. It may appear as name "Monitor" in tool_use +// blocks (confirmed by CLI source inspection; it is a local_bash with kind="monitor" internally). +const SEARCH_TOOLS: [&str; 6] = ["Read", "Glob", "Grep", "WebSearch", "WebFetch", "Monitor"]; const CODING_TOOLS: [&str; 3] = ["Edit", "Write", "NotebookEdit"]; fn detect_wsl() -> bool { @@ -2756,6 +2759,11 @@ mod tests { get_tool_state("WebFetch"), CharacterState::Searching )); + // Monitor tool added in v2.1.98 — observational/streaming, maps to Searching + assert!(matches!( + get_tool_state("Monitor"), + CharacterState::Searching + )); } #[test]