Skip to content

fix(core): validate public session model switches#31012

Merged
kitlangton merged 1 commit into
devfrom
fix/session-switch-model-validation
Jun 5, 2026
Merged

fix(core): validate public session model switches#31012
kitlangton merged 1 commit into
devfrom
fix/session-switch-model-validation

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • validate public Session model switches against the Session's exact Location catalog after plugin boot
  • reject unavailable models and explicit unknown variants with typed public errors before durable mutation
  • preserve Session.NotFoundError and keep SessionV2.switchModel as the durable event operation

Tests

  • available model and variant succeeds
  • missing and disabled models reject without mutation
  • exact Location catalog is used
  • unknown variant rejects without mutation
  • missing Session preserves Session.NotFoundError

Verification

  • bun run test test/public-opencode.test.ts (isolated database)
  • bun typecheck (packages/core)
  • pre-push full workspace typecheck (22 packages)
  • bunx prettier --write on changed files
  • git diff --check

@kitlangton kitlangton merged commit 025e1ac into dev Jun 5, 2026
12 checks passed
@kitlangton kitlangton deleted the fix/session-switch-model-validation branch June 5, 2026 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant