diff --git a/agents/scout.md b/agents/scout.md index 8aeed88..c7a0a01 100644 --- a/agents/scout.md +++ b/agents/scout.md @@ -103,13 +103,9 @@ You have access to WebDriver browser automation tools for web research. **How to use WebDriver:** 1. Call `webdriver_start` to begin a browser session 2. Use `webdriver_navigate` to go to URLs (search engines, documentation sites, etc.) -3. **IMPORTANT**: Always use `webdriver_get_page_source` with `save_to_file` parameter to save the page HTML to disk -4. Read the saved HTML file with `read_file` to extract the information you need -5. Call `webdriver_quit` when done +3. Use all the standard webdriver navigation tools to scan and explore websites +3. Call `webdriver_quit` when done **Best practices:** -- Do NOT use `webdriver_screenshot` or try to decode page content visually - always save HTML to disk and read it -- Save pages to the `tmp/` subdirectory (e.g., `tmp/search_results.html`) -- Parse the HTML text content to find what you need -- For search engines, look for result links and titles in the HTML -- Close the WebDriver session when you're done to free resources \ No newline at end of file +- Do NOT use Google, prefer DuckDuckGo, Brave Search or Bing in that order. +- If you're struggling to navigate sites, try saving pages to the `tmp/` subdirectory (e.g., `tmp/search_results.html`), then parse the HTML to find what you need diff --git a/crates/g3-cli/src/lib.rs b/crates/g3-cli/src/lib.rs index 6c55118..f872a06 100644 --- a/crates/g3-cli/src/lib.rs +++ b/crates/g3-cli/src/lib.rs @@ -433,6 +433,7 @@ pub async fn run() -> Result<()> { cli.config.as_deref(), cli.quiet, cli.new_session, + cli.task.clone(), ) .await; } @@ -445,6 +446,7 @@ pub async fn run() -> Result<()> { cli.config.as_deref(), cli.quiet, cli.new_session, + cli.task.clone(), ) .await; } @@ -653,6 +655,7 @@ async fn run_agent_mode( config_path: Option<&str>, _quiet: bool, new_session: bool, + task: Option, ) -> Result<()> { use g3_core::get_agent_system_prompt; use g3_core::find_incomplete_agent_session; @@ -821,10 +824,16 @@ async fn run_agent_mode( // Fresh start - the agent prompt should contain instructions to start working immediately "Begin your analysis and work on the current project. Follow your mission and workflow as specified in your instructions." }; + // Use provided task if available, otherwise use the default initial_task + let final_task = task.as_deref().unwrap_or(initial_task); - let _result = agent.execute_task(initial_task, None, true).await?; + let _result = agent.execute_task(final_task, None, true).await?; - output.print("\n✅ Agent mode completed"); + // Don't print completion message for scout agent - it needs the last line + // to be the report file path for the research tool to read + if agent_name != "scout" { + output.print("\n✅ Agent mode completed"); + } Ok(()) }