Skip to content

opencode: SQLite token fallback selects model_id but the session column is model #769

Description

@iamtoruk

Found during the 0.9.18 issue audit: tryQuerySessionTokens selects model_id from the session table (src/providers/sqlite-session-parser.ts:48) but the real OpenCode schema names the column model, so the fallback query throws against a real opencode.db. It only fires when per-message parsing yields zero tokens, which is why #675's fix works regardless, but the fallback is dead as written. One-line query fix plus a schema-accurate fixture test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions