feat: add PostHog-gated model switching to chat - #38
Draft
burnedinthesky wants to merge 7 commits into
Draft
Conversation
Support selecting between two LLM models (GPT OSS 120b / Gemma 4 31b) and
thread the chosen model id through the chat send path down to the backend's
`model` field.
A PostHog flag `force-model-selection` drives the behavior:
- a model id -> force that model, no selector
- "none" -> show a selector in the composer bar, switch freely, persist
the choice to localStorage
- absent/other-> hide the selector and omit `model` (backend default)
`useModelSelection` degrades to an "off" default outside its provider, so the
shared chat components (used by the edu-mode course chat) keep working with no
selector and no model sent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The floating `version: 11` resolved to pnpm 11.12.0, whose self-installer
crashes in pnpm/action-setup ("Cannot use 'in' operator to search for
'integrity' in undefined"), failing every CI job at the Install pnpm step.
Pin to 11.9.0 (matches local dev) to avoid the broken release.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
burnedinthesky
marked this pull request as draft
September 8, 2026 09:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of changes
Purpose
The two models:
gpt-oss-120bgemma-4-31B-itIDs match the sciedu-llm ALLOWED_MODELS allowlist exactly (note the capital B in
gemma-4-31B-it; a mismatch is rejected with 400).Additional Information
Feature flag: force-model-selection
Read with useFeatureFlagVariantKey; resolves to one of three modes:
Changes
Notes and follow-ups
Test
pnpm lint and pnpm build pass. Locally, override the flag in the console:
🤖 Generated with Claude Code