Skip to content

session list crashes on legacy sessions with modelID key (expected id) #26435

@AndroidRadish

Description

@AndroidRadish

Description

After upgrading opencode, session list fails with Expected string, got undefined.
Root cause: session.ts:fromRow line 84 does ModelID.make(row.model.id) but old DB stores {"providerID":"opencode","modelID":"big-pickle"} — modelID wasn't migrated to id.
Single bad row kills the entire list.
Fix: add row.model.id ?? row.model.modelID fallback, and wrap listByProject row parsing in try/catch.

Plugins

No response

OpenCode version

1.14.31→1.14.41

Steps to reproduce

Have any old session record in opencode.db where model column contains {"providerID":"opencode","modelID":"..."} instead of {"id":"...","providerID":"opencode"}. Run opencode session list → crash.

Screenshot and/or share link

No response

Operating System

Windows11

Terminal

Powershell 7.6.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions