BloopAI/vibe-kanban · error
OpenCode executor error: {err}
Error message
OpenCode executor error: {err} What it means
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.
Source
Thrown at crates/executors/src/executors/opencode.rs:238
auto_approve,
server_password,
models_cache_key,
commit_reminder,
commit_reminder_prompt,
repo_context,
};
let result = match slash_command {
Some(command) => {
run_slash_command(config, log_writer.clone(), command, cancel_for_task).await
}
None => run_session(config, log_writer.clone(), cancel_for_task).await,
};
let exit_result = match result {
Ok(()) => ExecutorExitResult::Success,
Err(err) => {
let _ = log_writer
.log_error(format!("OpenCode executor error: {err}"))
.await;
ExecutorExitResult::Failure
}
};
let _ = exit_signal_tx.send(exit_result);
});
Ok(SpawnedChild {
child,
exit_signal: Some(exit_signal_rx),
cancel: Some(cancel),
})
}
/// Transform raw model data into ModelInfo structs.
fn transform_models(
&self,
models: &std::collections::HashMap<String, ProviderModelInfo>,View on GitHub (pinned to 4deb7eca8f)
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.
Example fix
// before: executor profile with invalid model OPENCODE_MODEL = "nonexistent-provider/gpt-x" // after OPENCODE_MODEL = "anthropic/claude-sonnet-4" // valid, authenticated provider/model
Defensive patterns
Strategy: try-catch
Validate before calling
// validate model/agent config before starting the task
if (!model.contains('/')) {
return Err("invalid OPENCODE_MODEL, expected provider/model format".into());
} Try / catch
match run_session(config, log_writer.clone(), cancel_for_task).await {
Ok(()) => ExecutorExitResult::Success,
Err(err) => {
log_error(format!("OpenCode executor error: {err}"));
// inspect err: auth failure -> re-auth; rate limit -> retry later; bad model -> fix profile
ExecutorExitResult::Failure
}
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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).
Related errors
- OpenCode startup error: {err}
- result.message || 'Force push failed'
- result.message || 'Push failed'
- Failed to save MCP servers
- Failed to upload attachment: ${errorText}
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/290f279d7fbd71fa.
Report an issue: GitHub.