feat(browser): cross-platform node_path config for npx resolution
Adds [browser].node_path config option so camoufox-browser can use an explicit npx path (essential for nvm/fnm/asdf users). Resolution order (cross-platform): 1. config.browser.node_path — explicit user override 2. 'npx.cmd' on Windows, 'npx' on Linux/macOS — PATH lookup Changes: - BrowserSection config: added node_path: Option<String> - AgentConfig: now carries browser section (was dropped in From<GyandootConfig>) - browser_manager::init_browser(node_path): accepts optional path - All call sites updated (run(), init_session(), subagents, tests) - Error messages now hint at browser.node_path config
This commit is contained in:
@@ -193,7 +193,7 @@ impl AgentLoop {
|
||||
// ── Auto-init Camoufox and register browser tools ──────────────
|
||||
{
|
||||
let mut tool_executor = self.tool_executor.lock().await;
|
||||
match crate::browser_manager::init_browser().await {
|
||||
match crate::browser_manager::init_browser(self.config.browser.node_path.as_deref()).await {
|
||||
crate::browser_manager::BrowserInitResult::Ready(client) => {
|
||||
info!("Camoufox browser ready — registering web_search and web_browse tools");
|
||||
crate::browser_tools::register_browser_tools(&mut tool_executor, client.clone());
|
||||
@@ -400,7 +400,7 @@ impl AgentLoop {
|
||||
// Browser init
|
||||
{
|
||||
let mut tool_executor = self.tool_executor.lock().await;
|
||||
match crate::browser_manager::init_browser().await {
|
||||
match crate::browser_manager::init_browser(self.config.browser.node_path.as_deref()).await {
|
||||
crate::browser_manager::BrowserInitResult::Ready(client) => {
|
||||
info!("Camoufox browser ready — registering web_search and web_browse tools");
|
||||
crate::browser_tools::register_browser_tools(&mut tool_executor, client.clone());
|
||||
@@ -902,7 +902,7 @@ mod tests {
|
||||
use super::*;
|
||||
use gyandoot_core::config::IdentitySection;
|
||||
use gyandoot_core::{
|
||||
config::AgentConfig, config::KanbanRootConfig, config::MemoryRootConfig,
|
||||
config::AgentConfig, config::BrowserSection, config::KanbanRootConfig, config::MemoryRootConfig,
|
||||
config::PlatformRootConfig, config::ProviderRootConfig, config::SecurityRootConfig,
|
||||
config::SkillsRootConfig, Message, MessageRole, Role, ToolCall, ToolDefinition,
|
||||
};
|
||||
@@ -921,6 +921,7 @@ mod tests {
|
||||
kanban: KanbanRootConfig::default(),
|
||||
skills: SkillsRootConfig::default(),
|
||||
identity: IdentitySection::default(),
|
||||
browser: BrowserSection::default(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user