Skip to content

fix: use default provider and model when provider in session no longer exists#8035

Merged
lifeizhou-ap merged 3 commits intomainfrom
lifei/use-default-provider-when-sesson-provider-deleted
Mar 20, 2026
Merged

fix: use default provider and model when provider in session no longer exists#8035
lifeizhou-ap merged 3 commits intomainfrom
lifei/use-default-provider-when-sesson-provider-deleted

Conversation

@lifeizhou-ap
Copy link
Collaborator

Summary

Fix issue: #7605

Testing

Manual testing.

  1. Update an existing session A including tool call with non existing provider (anthropicccc) => set the current provider to 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 provider opanai and current open ai model.
  2. create an custom provider 302.ai and create a session => Deleted delete the provider. => Load the session => same behaviour as above

Related Issues

Relates to #ISSUE_ID
Discussion: LINK (if any)

Screenshots/Demos (for UX changes)

Before:

After:

@lifeizhou-ap lifeizhou-ap changed the title fix: use default provider and modle when provider in session no longer exists fix: use default provider and model when provider in session no longer exists Mar 20, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1814 to +1817
let fallback_model_name = config
.get_goose_model()
.ok()
.ok_or_else(|| anyhow!("Could not configure fallback provider: missing model"))?;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

@DOsinga DOsinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@lifeizhou-ap lifeizhou-ap added this pull request to the merge queue Mar 20, 2026
Merged via the queue into main with commit 0ace570 Mar 20, 2026
23 checks passed
@lifeizhou-ap lifeizhou-ap deleted the lifei/use-default-provider-when-sesson-provider-deleted branch March 20, 2026 23:01
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…r exists (block#8035)

Signed-off-by: esnyder <elijah.snyder1@gmail.com>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…r exists (block#8035)

Signed-off-by: esnyder <elijah.snyder1@gmail.com>
elijahsgh pushed a commit to elijahsgh/goose that referenced this pull request Mar 21, 2026
…r exists (block#8035)

Signed-off-by: esnyder <elijah.snyder1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants