fix: use default provider and model when provider in session no longer exists#8035
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1d06c60a97
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let fallback_model_name = config | ||
| .get_goose_model() | ||
| .ok() | ||
| .ok_or_else(|| anyhow!("Could not configure fallback provider: missing model"))?; |
There was a problem hiding this comment.
Fall back to provider default when model config is missing
In the new fallback branch, resume now hard-fails if GOOSE_MODEL is unset (get_goose_model() returns an error), even when the fallback provider exists and has a default model. This can still break session recovery for users with a valid provider but incomplete/partially migrated config (for example, provider set via env but no persisted model), which is exactly the flow this change is trying to make robust. The fallback path should use the provider’s default model (or attempt it) instead of requiring a separate global model key.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is an unlikely edge case — it requires a valid default provider but no default model configured. Adding provider default model resolution would involve more change than it's worth for this scenario. We can address it if it becomes a real issue.
…r exists (block#8035) Signed-off-by: esnyder <elijah.snyder1@gmail.com>
…r exists (block#8035) Signed-off-by: esnyder <elijah.snyder1@gmail.com>
…r exists (block#8035) Signed-off-by: esnyder <elijah.snyder1@gmail.com>
Summary
Fix issue: #7605
Testing
Manual testing.
openai=> Load the session A and the session messages are displayed in the chat message containers => In datastore, the session provider and model has been changed with current provideropanaiand current open ai model.302.aiand create a session => Deleted delete the provider. => Load the session => same behaviour as aboveRelated Issues
Relates to #ISSUE_ID
Discussion: LINK (if any)
Screenshots/Demos (for UX changes)
Before:
After: