-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Groq configure fix #5833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Groq configure fix #5833
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug in the goose configure command for declarative providers (like Groq) that use OpenAI-compatible engines. Previously, when configuring such providers, the CLI would display the base engine's API key environment variable (e.g., OPENAI_API_KEY) instead of the provider-specific one (e.g., GROQ_API_KEY), causing the configuration to fail when the provider-specific key was not set.
Key changes:
- Modified
register_with_nameto update the first config key with the provider-specificapi_key_envfrom the declarative configuration - Added test coverage to verify Groq provider uses
GROQ_API_KEYinstead ofOPENAI_API_KEY
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
crates/goose/src/providers/provider_registry.rs |
Updates config_keys in declarative provider registration to use provider-specific API key environment variable |
crates/goose/src/providers/factory.rs |
Adds test to verify Groq provider has correct config keys with GROQ_API_KEY |
Signed-off-by: neiii <1mrtemeck1@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: neiii <1mrtemeck1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
michaelneale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @neiii - just some nits (other comments) to fix, but also - can you explain more why it needs to set specifically the first key (ie overwrite whatever was there in the config), that seems odd as it would effect config for other providers too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
you're right, this is a rather silly implementation, not sure how I overlooked this. I'm currently debugging another implementation, by the looks of it, Groq is not the only affected provider; any openAI compatible provider is affected, including deepseek, and mistral. I'll update in a bit |
Signed-off-by: neiii <1mrtemeck1@gmail.com>
|
thanks @neiii - let's get groq work here completely. I agree with @michaelneale that blindly copying the key into the first parameter might have side effects though. a better but more involved solution would be to move the api_key out of the config_keys in ProviderMetaData and just have it there as an explicit field. |
|
hey @DOsinga, I pushed a different implementation just as you were writing the message. Now, it gets the position of the OPENAI_API_KEY and then swaps it with the provider's API key. Looks good or would you like more change? In terms of getting Groq fixed completely, quite frankly I'm not sure what's causing the issue, I've went back-and-forth with it for 2 hours yesterday, I'll tinker some more tonight. The requests go through (and it shows on Groq's dashboard), it's just that when Goose is processing them for some reason it sees it as a context overflow and tries to infinitely compress it, causing the requests to spam. I'll tinker some more tonight |
|
ok, thanks for the info, very useful. replacing OPEN_AI_KEY is a good start and helps for this for sure, but custom providers based on Anthropic (not very common to be sure) will run into the same issue. we can leave your solution in place though as for groq, the reason this happens can be either that we have the token count on the models they return wrong so we think we're immediately out of context tokens, or there is something in the reply like "too many" and it is a 500 http error. If you can share a diagnostics report that could be helpful |
|
@DOsinga I checked again with Groq now on a paid plan, the (bigger context) models seem to work, I suppose it was a tier issue (?). Is there anything else blocking for this change to be implemented? |
DOsinga
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, looks good. simplify the tests though
michaelneale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, mostly agree with @DOsinga on final nits, very cool!
Signed-off-by: neiii <1mrtemeck1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Signed-off-by: neiii <1mrtemeck1@gmail.com>
|
@DOsinga compressed the tests and re-added the comment. Anything else? |
Signed-off-by: neiii <1mrtemeck1@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
* origin/main: Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) Enable recipe deeplink parameters for pre-population (#5757) chore: upgrade npm packages (#5951) feat: ActionRequired (#5897) feat(acp): support loading sessions in acp (#5942) docs: add videos to multi-model page (#5938) docs: promote planning guide (#5934)
* main: fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) Enable recipe deeplink parameters for pre-population (#5757)
…nses-streaming * 'main' of github.com:block/goose: blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) Enable recipe deeplink parameters for pre-population (#5757) chore: upgrade npm packages (#5951) feat: ActionRequired (#5897) feat(acp): support loading sessions in acp (#5942) docs: add videos to multi-model page (#5938)
* 'main' of github.com:block/goose: (21 commits) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) added sidebar contextual information for firefox (#5433) docs: council of mine MCP (#5979) docs: nano banana extension (#5977) fix: remove prompt change, read model from config (#5976) ... # Conflicts: # ui/desktop/src/api/sdk.gen.ts # ui/desktop/src/components/bottom_menu/DirSwitcher.tsx
* 'main' of github.com:block/goose: (159 commits) Cleanup: Remove Recipe Key Flow (#6015) chore(deps): bump mdast-util-to-hast from 13.2.0 to 13.2.1 in /documentation (#5963) remove problematic corrupted woff font (#6006) Added search bar / filtering for recipes (#6019) Hide recipe icon in empty chat (#6022) docs: provider and model config (#6008) Show modal selector after configuring a provider (#6005) docs: additional mcp sampling resources (#6020) Flutter PR Code Review (#6011) feat(mcp): elicitation support (#5965) Onboarding detect provider from api key (#5955) Fix PATH on Windows for extensions (#6000) recipe(datahub): Add a recipe for searching & understanding data in DataHub (#5859) fix params not being substituted in activities (#5992) blog: MCP Sampling (#5987) Update Anthropic and Google Gemini models to latest API versions (#5980) docs: chat recall tutorial (#5975) fix: `final assistant content cannot end with trailing whitespace` error from Anthropic (#5967) 5527 multiple file popups (#5905) Groq configure fix (#5833) ...
Summary
Fixed
goose configurecommand for Groq (d) provider. Previously, if thegroq_api_keywas unset, the cli would not ask for it and error out at the end of the setup. That said, I still think there are some issues with how goose handles Groq's conversations, with all of them being stuck on "Context limit reached. Compacting to continue conversation..."Type of Change
AI Assistance
Made with goose :P
Testing
Manual testing + the following:
Screenshots/Demos (for UX changes)
Previously:

Now
