BloopAI/vibe-kanban · error
OpenCode startup error: {err}
Error message
OpenCode startup error: {err} What it means
In the OpenCode executor's spawn_inner, wait_for_server_url reads the spawned `opencode serve` process's stdout to capture the listening URL. If the server fails to print a valid URL (timeout, crash, or unexpected output), the error is written to the execution log as "OpenCode startup error: {err}" and the task exits with ExecutorExitResult::Failure. The executor never reaches the prompt-running stage.
Source
Thrown at crates/executors/src/executors/opencode.rs:204
let model = self.model.clone();
let model_variant = self.variant.clone();
let agent = self.agent.clone();
let auto_approve = self.auto_approve;
let resume_session_id = resume_session.map(|s| s.to_string());
let models_cache_key = self.compute_models_cache_key();
let cancel_for_task = cancel.clone();
let commit_reminder = env.commit_reminder;
let commit_reminder_prompt = env.commit_reminder_prompt.clone();
let repo_context = env.repo_context.clone();
tokio::spawn(async move {
// Wait for server to print listening URL
let base_url = match wait_for_server_url(server_stdout, Some(log_writer.clone())).await
{
Ok(url) => url,
Err(err) => {
let _ = log_writer
.log_error(format!("OpenCode startup error: {err}"))
.await;
let _ = exit_signal_tx.send(ExecutorExitResult::Failure);
return;
}
};
let config = RunConfig {
base_url,
directory,
prompt: combined_prompt,
resume_session_id,
model,
model_variant,
agent,
approvals,
auto_approve,
server_password,
models_cache_key,View on GitHub (pinned to 4deb7eca8f)
Solutions
- Read the full task log to see the underlying error detail after 'OpenCode startup error:' and fix that root cause.
- Verify the opencode CLI is installed and works: run `opencode --version` (and `opencode serve` manually) in the workspace directory.
- Check the opencode config/auth (~/.config/opencode or project config) and provider API keys for validity.
- Upgrade or reinstall opencode to a compatible version; ensure no other process occupies the port it tries to bind.
- Increase tolerance for slow startup (machine resource limits) or disable conflicting env/profile overrides passed via ExecutionEnv.
Defensive patterns
Strategy: retry
Validate before calling
// before spawning, verify the CLI is available
let out = Command::new("opencode").arg("--version").output()?;
if !out.status.success() {
return Err("opencode CLI missing or not executable; install a compatible version".into());
} Try / catch
match wait_for_server_url(stdout, Some(log_writer)).await {
Ok(url) => url,
Err(err) => {
log_error(format!("OpenCode startup error: {err}"));
// surface err to the user and offer a retry of the task attempt
return;
}
} Prevention
- Pin and verify the opencode CLI version in your environment/image before running tasks.
- Keep opencode config and provider auth valid; test `opencode serve` manually.
- Avoid port conflicts on the machine where tasks execute.
- Check task logs immediately when an attempt fails at startup — the root cause follows this message.
- Provision adequate CPU/memory so the server starts within the timeout.
When it happens
Trigger: wait_for_server_url returns Err when the opencode server process exits early, times out before printing its listening URL, or prints output that doesn't parse as a URL — reached via spawn or spawn_follow_up.
Common situations: OpenCode CLI not installed or wrong version on PATH; opencode fails at startup due to bad config or missing authentication for a provider; port binding conflicts; the process crashes immediately (e.g. unsupported platform or corrupted install); slow startup exceeding the wait timeout.
Related errors
- OpenCode executor error: {err}
- Failed to load orchestrator MCP context from /api/containers
- no OAuth providers configured
- Failed to spawn stdio command: {e}
- Failed to take child stdin
AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29).
Data as JSON: /api/errors/a56b5557adee9f52.
Report an issue: GitHub.