fix: centralize model configuration and respect DSAGENT_DEFAULT_MODEL#32
Merged
fix: centralize model configuration and respect DSAGENT_DEFAULT_MODEL#32
Conversation
- Create centralized config.py module with get_default_model() function - Model resolution cascade: explicit param > session > DSAGENT_DEFAULT_MODEL > LLM_MODEL > fallback - Fix session creation to resolve model before saving to database - Remove hardcoded "gpt-4o" defaults from all agent files - Support both DSAGENT_DEFAULT_MODEL and LLM_MODEL env vars for backward compatibility - Update .env.example with configuration documentation This fixes the issue where DSAGENT_DEFAULT_MODEL was ignored in Cloud Run deployments because sessions were saved with model=None. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.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.
Summary
config.pymodule withget_default_model()functionNone)gpt-4odefaults from all agent filesDSAGENT_DEFAULT_MODELandLLM_MODELenv vars for backward compatibilityProblem
When deploying to Cloud Run with
DSAGENT_DEFAULT_MODELset, sessions were still defaulting togpt-4obecause:session.modelwas saved asNonewhen not explicitly provided"gpt-4o"defaults in agent configs took precedenceSolution
Model resolution cascade (highest to lowest priority):
--modelflag)DSAGENT_DEFAULT_MODELenv varLLM_MODELenv var (legacy/CLI compatibility)gpt-4oTest plan
🤖 Generated with Claude Code