Add configurable model: CLAUDE_MODEL env var + /model command - #19
Open
Rithvik-katakamm wants to merge 5 commits into
Open
Add configurable model: CLAUDE_MODEL env var + /model command#19Rithvik-katakamm wants to merge 5 commits into
Rithvik-katakamm wants to merge 5 commits into
Conversation
… 4h, MONDAY_SESSION_IDLE_HOURS) Root cause fix for multi-minute replies: the eternal session grew to ~624k tokens and every reply after a >5min texting gap paid a cache-cold re-ingest. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
DAIJIROMATSUOKA
pushed a commit
to DAIJIROMATSUOKA/claude-telegram-bot
that referenced
this pull request
Jul 12, 2026
…2全てapply可・H2に+1行snap補正推奨)
…nders dispatcher delivered out-of-band (last 15 on fresh session, only-new on resume, offset persisted across restarts) — closes the delivery-bypasses-her-brain gap
…te model in code 'fable-5' (not a real ID; claude-fable-5 is) sat in .model-override since 07-17; every bridge query spawned Claude with a nonexistent model and died with 'process exited with code 1' (in=0 out=0), surfacing as Monday erroring on every reply. currentModel() now normalizes aliases (opus/sonnet/haiku/ fable and dash variants) to real IDs and ignores anything unresolvable, falling back to CLAUDE_MODEL — a bad override can no longer take the bridge down. setModel() validates before writing and reports success. Co-Authored-By: Claude Fable 5 <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.
Motivation
The Claude model is currently hardcoded to
claude-sonnet-4-5insrc/session.ts. Anyone wanting a newer/cheaper/stronger model has to patch source. Model choice is also something you naturally want to change from your phone mid-conversation ("this needs opus") without touching the server.Changes
CLAUDE_MODELenv var — sets the default model at deploy time (falls back toclaude-sonnet-4-5, so existing installs are unaffected)./modelcommand — from Telegram:/modelshows the active model,/model <name>switches it for new messages,/model resetreturns to the default. Auth-gated like every other command..model-overridefile (written by/model) →CLAUDE_MODELenv → hardcoded default. Override survives bot restarts; file is gitignored.src/model.tsmodule; one-line change insession.ts(model: currentModel()).Testing
bun run typecheckpasses./model,resetreturns to env default; unauthorized users get the standard rejection.🤖 Generated with Claude Code
https://claude.ai/code/session_011DCk7sXBrPZqBLyN166gey