Skip to content

fix(providers): restore dynamic model discovery and current Grok support - #10756

Merged
jbg merged 4 commits into
mainfrom
jbg/fix-grok-model-inventory
Jul 28, 2026
Merged

fix(providers): restore dynamic model discovery and current Grok support#10756
jbg merged 4 commits into
mainfrom
jbg/fix-grok-model-inventory

Conversation

@jbg

@jbg jbg commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • enable inventory refresh for xAI/xAI OAuth and the other API-backed providers that already implement dynamic model discovery but were still registered as static
  • preserve provider-returned models that are newer than the bundled canonical catalog, while continuing to filter known incompatible models
  • update the xAI fallback/default set for Grok 4.5, Grok 4.3, Grok 4.20, and Grok Build, with canonical context/reasoning metadata
  • add model-specific xAI reasoning-effort handling without applying OpenAI Responses API request semantics to Grok Chat Completions

Context

Supersedes #10345.

The immediate Grok failure was not just a stale hardcoded list: the Goose 2.0 inventory registration defaulted refresh off, so xAI's existing /models implementation was never called and the picker always fell back to provider metadata. The same mismatch affected several other providers with dynamic fetch_supported_models implementations.

There was a second forward-compatibility issue: the default recommended-model filter discarded any provider model absent from the bundled canonical registry. This meant a successful API refresh could still hide newly released models until the catalog was regenerated. Unknown models are now retained; known non-text or tool-incompatible models remain filtered.

xAI behavior follows the current reasoning documentation and May 15 retirement guide.

Verification

  • cargo fmt
  • git diff --check
  • added focused unit coverage for inventory preservation, refresh registration, canonical xAI metadata, and Grok request construction
  • build/test suite not run (repository instructions require an explicit request)

@jbg
jbg marked this pull request as ready for review July 28, 2026 03:11

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

Copy link
Copy Markdown

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: 5d4e5a50ee

ℹ️ 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".

}

if !is_reasoning_model {
if !is_reasoning_model && !supports_xai_effort {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve temperature for xAI chat models

When GOOSE_TEMPERATURE or another caller sets model_config.temperature, this condition silently drops it for every Grok 4.5, 4.3, and 3-mini request merely because the model supports reasoning_effort, including requests where no reasoning effort is supplied. These are still Chat Completions models, and the bundled catalog explicitly marks Grok 4.3 and 4.5 as supporting temperature (canonical_models.json lines 160713-160720 and 160744-160751), so the new default Grok 4.5 no longer honors the user's configured sampling behavior; restrict omission to models or parameter combinations that actually reject temperature.

Useful? React with 👍 / 👎.

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

Copy link
Copy Markdown

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: 2d2c87e306

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +153 to +155
Config::global()
.get_param::<bool>(KIMI_CONFIGURED_MARKER)
.unwrap_or(false)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate Kimi refresh on the token, not just the marker

When Kimi Code has been configured once and then removed through the provider-config delete path, KimiCodeProvider::cleanup only deletes kimicode/token.json while the metadata delete path does not remove kimi_code_configured. This new refresh registration therefore keeps reporting Kimi as configured from the stale marker, so an inventory refresh will instantiate the provider and fetch_supported_models falls through to ensure_token, starting the device-code OAuth flow in the refresh path instead of skipping an unconfigured provider; either clear the marker on cleanup/delete or also require the token cache to exist here.

Useful? React with 👍 / 👎.

@michaelneale michaelneale left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think a good approach @jbg - sorry am pushing a few small tweaks to get it green, but I like it.

only downside would be if say grok 4.6 comes out - will detect it, but not the context so will default low to 128k -I guess that is better than just not working.

all I could think would be to somehow default to next known highest one, but that seems clumsy/risky, so probably ok (until there is uniform way to discover that as well)

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

Copy link
Copy Markdown

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: 4da7caab06

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1557 to +1560
|| model_name.starts_with("grok-4.20")
|| model_name.starts_with("grok-4-0709")
|| model_name.starts_with("grok-4-fast-reasoning")
|| model_name.starts_with("grok-4-1-fast-reasoning")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid exposing effort controls for fixed xAI models

For the xAI models matched only by these branches (for example grok-4.20-0309-reasoning and grok-4-0709), supports_xai_reasoning_effort is false, and create_request_with_options only serializes reasoning_effort through that helper's branch. Marking them as is_reasoning_model() feeds the ACP session config (thinking_effort_values), so users can select Low/Medium/High/Max, but the selected value is silently dropped from the request; keep this predicate limited to models whose effort Goose can configure, or add a separate capability for fixed server-side reasoning.

Useful? React with 👍 / 👎.

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