Skip to content

Bug: preview channel database path fails when the channel contains a slash #16396

@2asoft

Description

@2asoft

Description

Preview builds derive the channel from the git branch. If that channel contains /, OpenCode uses it directly in the SQLite database filename.
In my case, the installed preview binary reports:
0.0.0-foo/bar-202603061937
and startup tries to open:
/home/aasoft/.local/share/opencode/opencode-foo/bar.db
That turns the database filename into a nested path, and startup fails with:
unable to open database file
This looks related to #16224, but it is a different failure mode. #16224 is about slash-containing preview channels breaking version/plugin flows; this one is the same unsanitized channel reaching the local SQLite filename.

Plugins

None configured (~/.config/opencode/opencode.jsonc has an empty plugin array)

OpenCode version

0.0.0-dev-202603061937 (but with a branch name that has a slash in it, eg foo/bar)

Steps to reproduce

  1. Build or install a preview opencode binary whose channel comes from a branch name containing /, for example foo/bar
  2. Run opencode
  3. Observe startup failure with unable to open database file

Screenshot and/or share link

Error:
Unexpected error, check log file ... unable to open database file

Log excerpt:

INFO  ... service=db path=/home/aasoft/.local/share/opencode/opencode-foo/bar.db opening database

Operating System

Arch Linux

Terminal

Alacritty

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions