diff --git a/src-tauri/src/wsl_bridge.rs b/src-tauri/src/wsl_bridge.rs index e8e4725..120de9f 100644 --- a/src-tauri/src/wsl_bridge.rs +++ b/src-tauri/src/wsl_bridge.rs @@ -1082,17 +1082,37 @@ fn process_json_line( stats.write().increment_code_blocks(); } + let is_prompt_too_long = text.starts_with("Prompt is too long"); + let _ = app.emit( "claude:output", OutputEvent { - line_type: "assistant".to_string(), + line_type: if is_prompt_too_long { + "error".to_string() + } else { + "assistant".to_string() + }, content: text.clone(), tool_name: None, conversation_id: conversation_id.clone(), - cost: message_cost.clone(), // Include cost with assistant text + cost: message_cost.clone(), parent_tool_use_id: parent_tool_use_id.clone(), }, ); + + if is_prompt_too_long { + let _ = app.emit( + "claude:output", + OutputEvent { + line_type: "compact-prompt".to_string(), + content: String::new(), + tool_name: None, + conversation_id: conversation_id.clone(), + cost: None, + parent_tool_use_id: None, + }, + ); + } } ContentBlock::Thinking { thinking } => { state = CharacterState::Thinking; diff --git a/src/lib/components/Terminal.svelte b/src/lib/components/Terminal.svelte index ebd682b..9933d3c 100644 --- a/src/lib/components/Terminal.svelte +++ b/src/lib/components/Terminal.svelte @@ -1,6 +1,7 @@