Description
Description
GET /api/session?limit=5000&order=desc crashes with HTTP 500 (err_de187102), leaving the web UI session list completely empty.
Interestingly, limit=1000 returns 200 OK.
Log output (~/.local/share/opencode/log/opencode.log):
EffectDrizzleQueryError: Failed query: select ... from "session" order by "session"."time_created" desc, "session"."id" desc limit ?
params: 5000 (cause: Cause([Fail(Error: Path is not absolute: http://localhost:3333/L2hvbWUvamFuL3Byb2plY3RzL2hpcHBvY2FjdHVz/session/ses_13416c6c1ffeuwjo0B1mxirCjT)]))
Cause
An older session row in SQLite had a client URL stored in path/directory instead of a local filesystem path (likely from an old web copy-paste/fork action).
Because queries are ordered time_created DESC:
limit=1000 never touched that older row -> returned 200.
limit=5000 reached the corrupt row -> Drizzle isAbsolute(path) check failed -> crashed the whole query.
Suggested fix
Catch/ignore isAbsolute failures during session list hydration instead of blowing up the entire query for a single bad row.
Workaround for affected users
# Find bad entries:
sqlite3 ~/.local/share/opencode/opencode.db "SELECT id, path FROM session WHERE path LIKE 'http%';"
# Fix path (decode base64 part of the URL):
sqlite3 ~/.local/share/opencode/opencode.db "UPDATE session SET path='/path/to/project', directory='/path/to/project' WHERE id='<session_id>';"
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Linux CachyOS
Terminal
COSMIC Terminal
Description
Description
GET /api/session?limit=5000&order=desccrashes with HTTP 500 (err_de187102), leaving the web UI session list completely empty.Interestingly,
limit=1000returns200 OK.Log output (
~/.local/share/opencode/log/opencode.log):Cause
An older session row in SQLite had a client URL stored in
path/directoryinstead of a local filesystem path (likely from an old web copy-paste/fork action).Because queries are ordered
time_created DESC:limit=1000never touched that older row -> returned 200.limit=5000reached the corrupt row -> DrizzleisAbsolute(path)check failed -> crashed the whole query.Suggested fix
Catch/ignore
isAbsolutefailures during session list hydration instead of blowing up the entire query for a single bad row.Workaround for affected users
Plugins
No response
OpenCode version
No response
Steps to reproduce
No response
Screenshot and/or share link
No response
Operating System
Linux CachyOS
Terminal
COSMIC Terminal