Mid-conversation config deploys can change the model between turns. The model is resolved once at module load from env vars (botConfig.modelId) and every turn reads it from that singleton — but if the Vercel function instance recycles between turns in the same thread, the new instance picks up updated env vars and switches models.
readChatConfig() runs once at module load, stored in a module-level chatConfig const (packages/junior/src/chat/config.ts)
- Every turn references
botConfig.modelId directly with no per-session override
- A config deploy that changes
AI_MODEL will affect in-flight conversations on their next turn if the function cold-starts
The model should be captured at conversation start and reused for every subsequent turn in that conversation, so a config change only affects new conversations.
Action taken on behalf of David Cramer.
Mid-conversation config deploys can change the model between turns. The model is resolved once at module load from env vars (
botConfig.modelId) and every turn reads it from that singleton — but if the Vercel function instance recycles between turns in the same thread, the new instance picks up updated env vars and switches models.readChatConfig()runs once at module load, stored in a module-levelchatConfigconst (packages/junior/src/chat/config.ts)botConfig.modelIddirectly with no per-session overrideAI_MODELwill affect in-flight conversations on their next turn if the function cold-startsThe model should be captured at conversation start and reused for every subsequent turn in that conversation, so a config change only affects new conversations.
Action taken on behalf of David Cramer.