Skip to content

OpenCode fails to start: "no such column: project_id" - #519

Merged
balazsotakomaiya merged 2 commits into
mainfrom
althar/opencode-fails-to-start-no-such-column-project-i
Nov 2, 2026
Merged

balazsotakomaiya merged 2 commits into
mainfrom
althar/opencode-fails-to-start-no-such-column-project-i

Conversation

@balazsotakomaiya

Copy link
Copy Markdown
Contributor
Reviewed by Claude Sonnet 5.5 in 1 pass, at 7cccb03

Why

A review on OpenCode stopped with "OpenCode couldn't start. The agent stopped: no such column: project_id." The error is OpenCode's, from its own database. OpenCode 2's workspace_domain migration rebuilds the workspace table without project_id. OpenCode 1.x still updates that column when it opens a repository, so a 1.x OpenCode on a data folder that 2.x (or its beta) has migrated fails on every start in a repository (anomalyco/opencode#42170). That is the case here: the data folder was migrated by the 2.x beta, and OpenCode was later put back on stable 1.18.31.

What changed

  • When an agent exits with that error, the stuck card now says what's wrong and the way out, instead of the bare SQLite error: OpenCode's database was moved on by OpenCode 2, this OpenCode is 1.x, so install OpenCode 2 (its docs give the installer for each platform).
  • Althar's own download of OpenCode now takes the newest published 2.x release rather than GitHub's latest. A download can be limited to a line of releases by the start of its tag (line: 'v2.'). In that case Althar lists the repository's releases and takes the newest one on that line that is neither a draft nor a prerelease.

How I went about it

GitHub's latest OpenCode release is still on the 1.x line (v1.19.5), which has the same bug. It also lacks auth list --standalone --format json, which the adapter already uses for OpenCode 2. So a download of "latest" would have given a build that doesn't fit the adapter and can't open a migrated data folder. The card points at OpenCode 2's docs rather than naming a command: neither opencode upgrade nor 1.x's installer moves to 2 (the installer refuses a 2.x version), and 2's installer differs by platform. Nothing touches the person's database. Moving it aside would lose their history in OpenCode, and OpenCode 2 opens it as it is.

How it was checked

  • Reproduced the error by running OpenCode 1.18.31's opencode acp in a repository on a copy of the affected database. On an empty data folder it starts.
  • OpenCode 2.2.5 starts an ACP session on the same copy, keeping its existing sessions and messages. After updating, it also starts on the real data folder, and a prompt to a model runs.
  • OpenCode 2.2.5 answers the adapter's auth list --standalone --format json; 1.18.31 exits 1 on it.
Reviewed by Claude Sonnet 5.5 in 1 pass, at 7cccb03

Built by Claude Opus 5.5 · Reviewed by Claude Sonnet 5.5

Opened by Althar.

balazsotakomaiya and others added 2 commits November 2, 2026 18:07
…ad 2.x

OpenCode 2's workspace_domain migration drops workspace.project_id, which
OpenCode 1.x still updates on opening a repository, so it stops with 'no
such column: project_id' (anomalyco/opencode#42170). The stuck card now
says what's wrong and how to update to version 2, and Althar's own
download of OpenCode takes the newest 2.x release rather than GitHub's
latest, which is still 1.x.

Co-authored-by: Althar <[email protected]>
1.x's upgrade and installer refuse a 2.x version, so the card points at
OpenCode 2's docs, which give its installer for each platform.

Co-authored-by: Althar <[email protected]>
@balazsotakomaiya
balazsotakomaiya added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 70d2ee5 Nov 2, 2026
28 checks passed
@balazsotakomaiya
balazsotakomaiya deleted the althar/opencode-fails-to-start-no-such-column-project-i branch November 2, 2026 19:44
ninemate pushed a commit to ninemate/althar that referenced this pull request Nov 3, 2026
The conflict was a disagreement: AltharIDE#519 moved Althar's OpenCode download to 2.x
and told people to install OpenCode 2, while this branch starts no session on
2.x. Run on 2.2.5, Althar's MCP switch-off still doesn't stop the person's
servers starting and a rejected command still ends the turn, so the gate stays
and the download stays on 1.x (`line` goes). For a data folder 2.x has migrated,
the card now points at another account, a home of its own. The findings are in
docs/plans/opencode-2.md.

Co-authored-by: Althar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant