diff --git a/crates/g3-cli/src/agent_mode.rs b/crates/g3-cli/src/agent_mode.rs index 148df85..98745ef 100644 --- a/crates/g3-cli/src/agent_mode.rs +++ b/crates/g3-cli/src/agent_mode.rs @@ -139,29 +139,36 @@ pub async fn run_agent_mode( let readme_content_opt = read_project_readme(&workspace_dir); let memory_content_opt = read_project_memory(&workspace_dir); - // Show what was loaded - let readme_status = if readme_content_opt.is_some() { - "✓" - } else { - "·" - }; - let agents_status = if agents_content_opt.is_some() { - "✓" - } else { - "·" - }; - let memory_status = if memory_content_opt.is_some() { - "✓" - } else { - "·" - }; - // Always print status line (part of minimal output) - print!( - "{} {} README {} AGENTS.md {} Memory{}\n", - crossterm::style::SetForegroundColor(crossterm::style::Color::DarkGrey), - readme_status, agents_status, memory_status, - crossterm::style::ResetColor - ); + // Read include prompt early so we can show it in the status line + let include_prompt = read_include_prompt(include_prompt_path.as_deref()); + + // Build status line showing only what was loaded (in load order) + let mut loaded_items: Vec = Vec::new(); + if readme_content_opt.is_some() { + loaded_items.push("README".to_string()); + } + if agents_content_opt.is_some() { + loaded_items.push("AGENTS.md".to_string()); + } + if let Some(path) = &include_prompt_path { + if include_prompt.is_some() { + let filename = path.file_name().map(|s| s.to_string_lossy().to_string()).unwrap_or_else(|| "prompt".to_string()); + loaded_items.push(filename); + } + } + if memory_content_opt.is_some() { + loaded_items.push("Memory".to_string()); + } + // Print status line only if something was loaded + if !loaded_items.is_empty() { + let status_str = loaded_items.iter().map(|s| format!("✓ {}", s)).collect::>().join(" "); + print!( + "{} {}{}\n", + crossterm::style::SetForegroundColor(crossterm::style::Color::DarkGrey), + status_str, + crossterm::style::ResetColor + ); + } // Get language-specific prompts (same mechanism as normal mode) let language_content = get_language_prompts_for_workspace(&workspace_dir); @@ -188,9 +195,6 @@ pub async fn run_agent_mode( system_prompt }; - // Read include prompt if specified - let include_prompt = read_include_prompt(include_prompt_path.as_deref()); - // Combine all content for the agent's context let combined_content = combine_project_content( agents_content_opt, diff --git a/crates/g3-cli/src/interactive.rs b/crates/g3-cli/src/interactive.rs index c0f14bf..bae3391 100644 --- a/crates/g3-cli/src/interactive.rs +++ b/crates/g3-cli/src/interactive.rs @@ -102,11 +102,8 @@ pub async fn run_interactive( // Check what was loaded let has_agents = content.contains("Agent Configuration"); let has_readme = content.contains("Project README"); - let has_memory = content.contains("Project Memory"); - - let readme_status = if has_readme { "✓" } else { "·" }; - let agents_status = if has_agents { "✓" } else { "·" }; - let memory_status = if has_memory { "✓" } else { "·" }; + let has_include_prompt = content.contains("Included Prompt"); + let has_memory = content.contains("=== Project Memory"); // Extract project name if README is loaded let project_name = if has_readme { @@ -119,12 +116,31 @@ pub async fn run_interactive( if let Some(name) = project_name { print!("{}>> {}{}\n", SetForegroundColor(Color::DarkGrey), name, ResetColor); } - print!( - "{} {} README | {} AGENTS.md | {} Memory{}\n", - SetForegroundColor(Color::DarkGrey), - readme_status, agents_status, memory_status, - ResetColor - ); + + // Build status line showing only what was loaded (in load order) + let mut loaded_items: Vec<&str> = Vec::new(); + if has_readme { + loaded_items.push("README"); + } + if has_agents { + loaded_items.push("AGENTS.md"); + } + if has_include_prompt { + loaded_items.push("prompt"); + } + if has_memory { + loaded_items.push("Memory"); + } + // Print status line only if something was loaded + if !loaded_items.is_empty() { + let status_str = loaded_items.iter().map(|s| format!("✓ {}", s)).collect::>().join(" "); + print!( + "{} {}{}\n", + SetForegroundColor(Color::DarkGrey), + status_str, + ResetColor + ); + } } // Display workspace path diff --git a/crates/g3-cli/tests/streaming_markdown_test.rs b/crates/g3-cli/tests/streaming_markdown_test.rs index c3dbb3d..a417bfa 100644 --- a/crates/g3-cli/tests/streaming_markdown_test.rs +++ b/crates/g3-cli/tests/streaming_markdown_test.rs @@ -1910,7 +1910,7 @@ fn test_code_fence_no_trailing_newline() { let mut fmt = StreamingMarkdownFormatter::new(skin); // Note: no newline after closing ``` - let input = "Done!\n\n```\n>> agent mode | fowler\n-> ~/src/g3\n ✓ README | ✓ AGENTS.md | ✓ Memory\n```"; + let input = "Done!\n\n```\n>> agent mode | fowler\n-> ~/src/g3\n ✓ README ✓ AGENTS.md ✓ Memory\n```"; let mut output = String::new(); for ch in input.chars() {