{"record":{"id":"290f279d7fbd71fa","repo":"BloopAI/vibe-kanban","slug":"opencode-executor-error-err","errorCode":null,"errorMessage":"OpenCode executor error: {err}","messagePattern":"OpenCode executor error: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/executors/src/executors/opencode.rs","lineNumber":238,"sourceCode":"                auto_approve,\n                server_password,\n                models_cache_key,\n                commit_reminder,\n                commit_reminder_prompt,\n                repo_context,\n            };\n\n            let result = match slash_command {\n                Some(command) => {\n                    run_slash_command(config, log_writer.clone(), command, cancel_for_task).await\n                }\n                None => run_session(config, log_writer.clone(), cancel_for_task).await,\n            };\n            let exit_result = match result {\n                Ok(()) => ExecutorExitResult::Success,\n                Err(err) => {\n                    let _ = log_writer\n                        .log_error(format!(\"OpenCode executor error: {err}\"))\n                        .await;\n                    ExecutorExitResult::Failure\n                }\n            };\n            let _ = exit_signal_tx.send(exit_result);\n        });\n\n        Ok(SpawnedChild {\n            child,\n            exit_signal: Some(exit_signal_rx),\n            cancel: Some(cancel),\n        })\n    }\n\n    /// Transform raw model data into ModelInfo structs.\n    fn transform_models(\n        &self,\n        models: &std::collections::HashMap<String, ProviderModelInfo>,","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/executors/src/executors/opencode.rs#L220-L256","documentation":"After the OpenCode server starts successfully, spawn_inner runs the session (or slash command) via run_session/run_slash_command. Any Err from these — API failures, HTTP errors against the opencode server, cancelled/failed turns — is logged as \"OpenCode executor error: {err}\" and mapped to ExecutorExitResult::Failure sent over the exit signal, marking the task attempt as failed.","triggerScenarios":"run_session or run_slash_command (reached from spawn or spawn_follow_up) returns Err: the HTTP API calls to the local opencode server fail (connection refused, 4xx/5xx), the model/provider request errors, authentication fails, or the session is aborted with an error.","commonSituations":"Missing or expired provider API key / opencode auth; invalid model id or variant configured for the executor; opencode server rejecting requests (wrong credentials like OPENCODE_SERVER_PASSWORD mismatch); network/proxy issues calling provider APIs; prompt rejected by the model provider (rate limit, context length).","solutions":["Open the task log for the full message after 'OpenCode executor error:' to identify the failing API call or provider error.","Verify provider credentials/auth for the configured model (`opencode auth` or environment API keys) and re-authenticate if expired.","Check the executor's configured model/variant/agent is valid for the installed opencode version; correct it in the task profile settings.","Retry the task if the failure was transient (rate limit, network blip); check provider status.","If the local server connection failed, ensure no firewall/proxy blocks localhost HTTP to the server's base_url."],"exampleFix":"// before: executor profile with invalid model\nOPENCODE_MODEL = \"nonexistent-provider/gpt-x\"\n// after\nOPENCODE_MODEL = \"anthropic/claude-sonnet-4\" // valid, authenticated provider/model","handlingStrategy":"try-catch","validationCode":"// validate model/agent config before starting the task\nif (!model.contains('/')) {\n    return Err(\"invalid OPENCODE_MODEL, expected provider/model format\".into());\n}","typeGuard":null,"tryCatchPattern":"match run_session(config, log_writer.clone(), cancel_for_task).await {\n    Ok(()) => ExecutorExitResult::Success,\n    Err(err) => {\n      log_error(format!(\"OpenCode executor error: {err}\"));\n      // inspect err: auth failure -> re-auth; rate limit -> retry later; bad model -> fix profile\n      ExecutorExitResult::Failure\n    }\n}","preventionTips":["Keep provider API keys/opencode auth current; re-authenticate before long-running tasks.","Validate configured model ids and variants against the provider list before launching.","Watch for rate limits and add spacing/retries for bulk task runs.","Confirm no local firewall/proxy blocks HTTP to the opencode server's base_url.","Read the executor log detail after 'OpenCode executor error:' to target the exact failing call."],"tags":["opencode","executor","api-error","session"],"backgroundTag":"agent-execution-failed","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}