Skip to content

fix(opencode): read session fallback model from the real schema#801

Open
EuanTop wants to merge 1 commit into
getagentseal:mainfrom
EuanTop:fix/opencode-session-model
Open

fix(opencode): read session fallback model from the real schema#801
EuanTop wants to merge 1 commit into
getagentseal:mainfrom
EuanTop:fix/opencode-session-model

Conversation

@EuanTop

@EuanTop EuanTop commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • query the real session.model column for SQLite token fallback
  • decode the JSON model object into providerID/id
  • invalidate stale OpenCode and KiloCode zero-result caches
  • update the OpenCode fixture to match the real schema

Context

#394 introduced the session-level fallback using model_id. #404 later introduced the shared OpenCode/KiloCode SQLite parser, and OpenCode was subsequently migrated onto it. Both current schemas store the session model as JSON in model.

The KiloCode parse-version bump only invalidates caches produced before this shared parser correction; normal caching remains enabled afterward.

Fixes #769.

Testing

  • targeted provider/cache tests: 113 passed
  • npm run build:cli
  • npx tsc --noEmit
  • git diff --check

The full suite completed with 2449 passing tests, 5 skipped tests, and 2 existing unrelated failures in tests/cache-refresh-lock.test.ts and tests/cli-durable-totals.test.ts.

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.

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

1 participant