Add Claude model picker and dynamic API port#17
Merged
Conversation
Settings page gains a "Claude Model" dropdown (Default / Opus 4.7 / Sonnet 4.6 / Haiku 4.5) that writes SEAM_ANALYSIS_MODEL to .env. pocket-run.sh forwards it to claude -p as --model when set, so users can pick the model used for recording analysis without editing the script. Default keeps Claude Code's own choice. The API server now falls back to an OS-assigned port when 3001 is busy, writes its actual port to .seam/api-port, and the Vite dev server reads that file to proxy /api → the API. CORS is widened to any localhost origin. All hardcoded http://localhost:3001 fetch URLs become relative /api/... paths so the dashboard works regardless of which port the API ended up on. This unblocks running multiple worktrees in parallel. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
SEAM_ANALYSIS_MODELin.env.scripts/pocket-run.shreads it and forwards as--modelto bothclaude -pcalls (analyze loop + pull-debug fallback). Empty/unset = no flag = Claude Code default..seam/api-port, and the Vite dev server reads that file to proxy/api→ the API. Hardcodedhttp://localhost:3001URLs in the dashboard become relative/api/...paths. CORS widened to any localhost origin. This unblocks running multiple worktrees in parallel.Why
The
#15RFC discussion calls out that model choice has a real cost/quality impact (Sonnet 4.6 catches subtle commitments that Haiku misses; Opus is overkill). Making this user-configurable from the dashboard is the lowest-friction way to get there. The dynamic-port work fell out of trying to verify the picker in a preview while another worktree had 3001 — without it, parallelnpm run devsessions just collide.Test plan
npm run format:check && npm run lint && npm test— 101/101 TS, 51/51 Python, no new lint errors.envgotSEAM_ANALYSIS_MODEL=claude-sonnet-4-6and the Save button disabled/api/settingscorrectlyNotes for reviewer
MODEL_OPTIONSinSettingsPage.tsx) is hardcoded against the lineup current as of this branch (Opus 4.7 / Sonnet 4.6 / Haiku 4.5). Future Claude releases will need this list updated. Considered fetching from the Anthropic API but it requires a key and adds runtime complexity for a list that changes a few times a year — happy to revisit.analysisModelsetting; per-tier can be added when those scripts exist.🤖 Generated with Claude Code