{"record":{"id":"3b72647a4c563cb4","repo":"aaif-goose/goose","slug":"e-3b7264","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/goose/src/acp/provider.rs","lineNumber":886,"sourceCode":"    ) -> Self {\n        Self {\n            config,\n            goose_mode,\n            prompt_response_tx: Arc::new(Mutex::new(None)),\n            pending_tool_updates,\n            context_size,\n        }\n    }\n\n    async fn spawn(\n        self,\n        mut rx: mpsc::Receiver<ClientRequest>,\n        init_tx: oneshot::Sender<Result<InitializeResponse>>,\n    ) {\n        let child = match spawn_acp_process(&self.config).await {\n            Ok(c) => c,\n            Err(e) => {\n                let _ = init_tx.send(Err(anyhow::anyhow!(\"{e}\")));\n                tracing::error!(\"failed to spawn ACP process: {e}\");\n                return;\n            }\n        };\n\n        match self.run_with_child(child, &mut rx, init_tx).await {\n            Ok(()) => tracing::debug!(\"ACP protocol loop exited cleanly\"),\n            Err(e) => tracing::error!(error = %e, \"ACP protocol loop error\"),\n        }\n    }\n\n    async fn run_with_child(\n        self,\n        mut child: Child,\n        rx: &mut mpsc::Receiver<ClientRequest>,\n        init_tx: oneshot::Sender<Result<InitializeResponse>>,\n    ) -> Result<()> {\n        let stdin = child.stdin.take().context(\"no stdin\")?;","sourceCodeStart":868,"sourceCodeEnd":904,"githubUrl":"https://github.com/aaif-goose/goose/blob/3810898a7447ec3299be72e223d3570a7aabf0ab/crates/goose/src/acp/provider.rs#L868-L904","documentation":"The error body is the raw message from spawn_acp_process ('failed to spawn ACP process' plus OS detail), forwarded over the init channel so the ACP provider's initialize future fails instead of hanging. spawn_acp_process builds the child command from config.command/config.args with piped stdio, prepends the command's parent dir to PATH (for npm adapters), applies env_remove/env, then calls cmd.spawn() — so this error means the process itself never started.","triggerScenarios":"config.command points to a binary that does not exist (ENOENT), is not executable (EACCES), is a directory, or PATH lookup fails because the command lives in a directory absent from PATH and has no explicit parent dir (e.g. bare 'node' resolved from a GUI environment whose PATH omits it).","commonSituations":"Using an ACP agent installed via npx/pnpm where the bin dir is not on the desktop app's PATH, a typo in the command path, a script missing its shebang or execute bit, or running on a machine where the agent was never installed.","solutions":["Verify the binary resolves and runs in the same context: 'which <command>' and execute it manually with the configured args","Use an absolute path for config.command (e.g. /usr/local/bin/my-agent or the real path under node_modules/.bin)","Ensure the file is executable and, for scripts, has a valid shebang (chmod +x, #!/usr/bin/env node)","Install the missing agent package or point config.command at the correct installed location"],"exampleFix":"# before\ncommand: my-acp-agent\nargs: []\n\n# after\ncommand: /home/user/.npm-global/bin/my-acp-agent\nargs: []","handlingStrategy":"validation","validationCode":"use std::path::Path;\nuse which::which; // or manual PATH scan\n\nfn agent_command_available(command: &str) -> bool {\n    command.contains('/') && Path::new(command).is_file()\n        || which(command).is_ok()\n}\n\nassert!(\n    agent_command_available(&config.command),\n    \"ACP agent command '{}' not found; install it or use an absolute path\",\n    config.command\n);","typeGuard":null,"tryCatchPattern":"match provider.initialize().await {\n    Ok(_) => {}\n    Err(e) if e.to_string().contains(\"failed to spawn ACP process\") => {\n        eprintln!(\"agent binary missing or not executable: {e}\");\n        std::process::exit(127); // command-not-found convention, no retry\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Prefer absolute paths for config.command","Smoke-test the agent command with its args before wiring it into goose","For npm-based agents, install globally and point at the real bin path"],"tags":["process","spawn","acp","config","path"],"backgroundTag":null,"analyzedSha":"3810898a7447ec3299be72e223d3570a7aabf0ab","analyzedAt":"2026-08-16T10:14:26.282Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}