Skip to content

fix: resolve model names for feature gating - #4520

Merged
akshaydeo merged 1 commit into
devfrom
06-18-fix_resolve_model_names_for_feature_gating
Jun 19, 2026
Merged

fix: resolve model names for feature gating#4520
akshaydeo merged 1 commit into
devfrom
06-18-fix_resolve_model_names_for_feature_gating

Conversation

@TejasGhatte

@TejasGhatte TejasGhatte commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Capability and version gating checks across the Anthropic and Bedrock providers were running against the raw wire model ID, which for deployments like Claude-on-Azure is an opaque deployment name rather than the real model string (e.g. claude-opus-4-8). This caused feature checks (IsAdaptiveOnlyThinkingModel, SupportsAdaptiveThinking, IsFableFamily, SupportsFastMode, etc.) to silently fall through to incorrect behavior for aliased models.

This PR introduces ResolveCanonicalModel to walk the alias hierarchy and return the correct model string for capability gating, then threads it through every affected call site.

Changes

  • Added ResolveCanonicalModel(ctx, fallbackModel) to core/schemas/account.go. It walks ResolvedAlias.Config.ModelNameResolvedAlias.Config.ModelIDfallbackModel, returning the first non-empty tier. This preserves pre-existing behavior when no alias is resolved.
  • All capability/version gating calls in anthropic/chat.go, anthropic/responses.go, anthropic/requestbuilder.go, anthropic/anthropic.go, anthropic/utils.go, bedrock/responses.go, and bedrock/utils.go now resolve a capModel once per function via ResolveCanonicalModel and pass that to the feature-check functions instead of the raw request.Model / bifrostReq.Model.
  • The wire model field (bifrostReq.Model) is intentionally left unchanged everywhere it is used for routing, token limits, or the actual API request body — only the capability gating path is affected.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

go test ./...

To validate the fix end-to-end, configure an Azure-hosted Claude deployment where the deployment name differs from the canonical model string (e.g. deployment ID my-opus-deployment, ModelName: claude-opus-4-8). Send a request with reasoning.max_tokens set and confirm that adaptive thinking is correctly applied rather than falling back to budget_tokens mode. Repeat with temperature and verify it is stripped for Fable/Mythos family models resolved through an alias.

Breaking changes

  • No

Security considerations

None. This change only affects how model strings are resolved for feature gating; no auth, secrets, or PII are involved.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

TejasGhatte commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator Author

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


tejas ghatte seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@TejasGhatte
TejasGhatte marked this pull request as ready for review June 18, 2026 08:31
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 498f9873-6060-4c64-8ddd-6b23ec34f72a

📥 Commits

Reviewing files that changed from the base of the PR and between a46d43b and dd531f5.

📒 Files selected for processing (25)
  • core/internal/llmtests/passthrough_api.go
  • core/providers/anthropic/anthropic.go
  • core/providers/anthropic/chat.go
  • core/providers/anthropic/requestbuilder.go
  • core/providers/anthropic/responses.go
  • core/providers/anthropic/utils.go
  • core/providers/azure/azure.go
  • core/providers/bedrock/mantle.go
  • core/providers/bedrock/responses.go
  • core/providers/bedrock/utils.go
  • core/providers/gemini/chat.go
  • core/providers/gemini/gemini.go
  • core/providers/gemini/gemini_test.go
  • core/providers/gemini/responses.go
  • core/providers/openai/advisor_filter_test.go
  • core/providers/openai/chat.go
  • core/providers/openai/chat_test.go
  • core/providers/openai/openai.go
  • core/providers/openai/responses.go
  • core/providers/openai/responses_marshal_test.go
  • core/providers/openai/responses_test.go
  • core/providers/vertex/utils.go
  • core/providers/vertex/vertex.go
  • core/schemas/account.go
  • core/schemas/account_test.go
🚧 Files skipped from review as they are similar to previous changes (24)
  • core/providers/anthropic/utils.go
  • core/providers/openai/chat_test.go
  • core/providers/openai/responses_marshal_test.go
  • core/providers/vertex/utils.go
  • core/providers/anthropic/anthropic.go
  • core/internal/llmtests/passthrough_api.go
  • core/providers/openai/advisor_filter_test.go
  • core/providers/azure/azure.go
  • core/schemas/account_test.go
  • core/schemas/account.go
  • core/providers/bedrock/mantle.go
  • core/providers/gemini/gemini.go
  • core/providers/gemini/chat.go
  • core/providers/openai/responses_test.go
  • core/providers/anthropic/requestbuilder.go
  • core/providers/bedrock/utils.go
  • core/providers/anthropic/responses.go
  • core/providers/openai/chat.go
  • core/providers/vertex/vertex.go
  • core/providers/anthropic/chat.go
  • core/providers/openai/responses.go
  • core/providers/gemini/responses.go
  • core/providers/gemini/gemini_test.go
  • core/providers/bedrock/responses.go

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Introduced canonical model resolution so model-dependent request shaping uses the resolved alias when available.
  • Bug Fixes

    • Improved consistency across Anthropic/OpenAI/Gemini/Bedrock/Azure/Vertex by basing reasoning/thinking, tool conversion, and parameter filtering on the canonical model.
    • Fixed unsupported-field stripping and raw-body sanitization to align with canonical model handling.
    • Updated fast-mode beta header eligibility and ensured context-aware request conversion for signed payloads.
  • Tests

    • Added precedence coverage for canonical model resolution and updated request-conversion tests for new context-aware converter call patterns.

Walkthrough

Adds a new ResolveCanonicalModel helper in core/schemas/account.go that resolves an alias-configured model name from BifrostContext. This canonical model string is then propagated across providers: Anthropic and Bedrock use it directly for all capability-gating conditionals, and Gemini and OpenAI request converters gain a context parameter to enable downstream use of ResolveCanonicalModel. Azure and Bedrock Mantle also pass context to their OpenAI converters. All test cases are updated to match the new signatures.

Changes

Canonical Model Resolution and Context-Aware Conversion

Layer / File(s) Summary
ResolveCanonicalModel helper and test
core/schemas/account.go, core/schemas/account_test.go
New exported ResolveCanonicalModel(ctx, fallbackModel) resolves the canonical model from BifrostContext alias metadata, preferring ModelName over ModelID, falling back to fallbackModel. Comprehensive table-driven test verifies precedence rules and edge cases.
Anthropic provider canonical model capability gating
core/providers/anthropic/chat.go, core/providers/anthropic/responses.go, core/providers/anthropic/requestbuilder.go, core/providers/anthropic/anthropic.go, core/providers/anthropic/utils.go
ToAnthropicChatRequest and ToAnthropicResponsesRequest compute capModel via ResolveCanonicalModel and use it for all capability checks: adaptive-only thinking suppression, reasoning/thinking path selection, Fable-family behavior, thinking.display defaulting, mid-conversation system support, server-tool normalization, and field stripping. Raw-body passthrough and request builder also resolve canonical model for tool remapping and field stripping.
Bedrock provider Anthropic capability gating
core/providers/bedrock/responses.go, core/providers/bedrock/utils.go
ToBedrockResponsesRequest and convertChatParameters derive capModel via ResolveCanonicalModel and replace all Anthropic capability checks (adaptive-only thinking, adaptive thinking support, Fable-family behavior, reasoning path selection) to gate on canonical model instead of raw request model.
Vertex provider canonical model gating
core/providers/vertex/utils.go, core/providers/vertex/vertex.go
Vertex ChatCompletion and ChatCompletionStream for Anthropic-family models resolve canonical model name and use it for both raw tool-version remapping and unsupported-field stripping. Vertex utils uses ResolveCanonicalModel when stripping unsupported fields from Anthropic-over-Vertex requests.
Gemini request converters context parameter and canonical model gating
core/providers/gemini/chat.go, core/providers/gemini/responses.go, core/providers/gemini/gemini.go, core/providers/gemini/gemini_test.go
ToGeminiChatCompletionRequest and ToGeminiResponsesRequest now accept BifrostContext parameter, derive capModel via ResolveCanonicalModel, and use it for generation parameter conversion and thinking budget validation. All provider callers and test cases pass ctx instead of calling without context.
OpenAI request converters context parameter and canonical model gating
core/providers/openai/chat.go, core/providers/openai/responses.go, core/providers/openai/openai.go, core/providers/openai/chat_test.go, core/providers/openai/responses_test.go, core/providers/openai/advisor_filter_test.go, core/providers/openai/responses_marshal_test.go
ToOpenAIChatRequest, ToOpenAIResponsesRequest, and ToOpenAICompactionRequest now accept BifrostContext parameter, derive capModel via ResolveCanonicalModel, and use it for reasoning effort normalization, reasoning model detection, and provider/family-specific parameter filtering. All handlers and test cases pass ctx into converters.
Azure, Bedrock Mantle, and test context propagation
core/providers/azure/azure.go, core/providers/bedrock/mantle.go, core/internal/llmtests/passthrough_api.go
Azure Responses and Compaction handlers, and Bedrock Mantle Responses paths, now pass ctx into OpenAI request converters enabling context-aware SigV4 signing and conversion. Gemini passthrough test updated to pass ctx matching the new converter signature.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • maximhq/bifrost#2355: Introduced the ResolvedAlias/BifrostContextKeyResolvedAlias context metadata that ResolveCanonicalModel reads from BifrostContext to perform alias resolution.
  • maximhq/bifrost#2787: Changed Anthropic request sanitization around StripUnsupportedFieldsFromRawBody by using model string as capability gate; this PR canonicalizes the model before calling the raw-body stripper.
  • maximhq/bifrost#4224: Modified Anthropic adaptive-only thinking gating logic in chat.go and responses.go; this PR now routes those same model-dependent conditionals through the canonical capModel resolved via ResolveCanonicalModel.

Suggested reviewers

  • akshaydeo
  • danpiths

🐇 A model by any other name might not think right,
So now we resolve aliases before the first byte takes flight.
capModel hops in, canonical and true,
No raw string confusion — just clean paths through!
The rabbit approves: one helper, all gates, hooray! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 67.27% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: resolve model names for feature gating' clearly summarizes the main change—using canonical model names instead of raw wire IDs for feature gating checks across providers.
Description check ✅ Passed The PR description covers all required sections: Summary explains the bug, Changes detail the fix with function signatures, Type of change is marked, Affected areas are checked, How to test is provided, Breaking changes are addressed, and security considerations are noted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-18-fix_resolve_model_names_for_feature_gating

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.2)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
coderabbitai Bot requested review from akshaydeo and danpiths June 18, 2026 08:34
@greptile-apps

greptile-apps Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge. The change is additive and narrows only the capability-gating code path; all wire model fields used for routing and API request bodies are explicitly left unchanged.

ResolveCanonicalModel is nil-safe at every level (nil ctx, nil Config, empty ModelName) and falls back to the existing wire model when no alias is present, preserving pre-refactor behavior for all non-aliased deployments. The eight-case test table covers every precedence tier. All 25 changed files follow the same capModel pattern consistently, and the Gemini context-parameter threading is correct across callers and tests.

No files require special attention.

Important Files Changed

Filename Overview
core/schemas/account.go Adds ResolveCanonicalModel alongside the existing ResolveFamily; nil-ctx/nil-Config/empty-ModelName defensive paths are all correct and covered by the new test table.
core/schemas/account_test.go Adds TestResolveCanonicalModelPrecedence with 8 named cases covering ModelName wins, ModelID fallback, opaque-ID passthrough, nil Config, no alias, and the deliberate exclusion of Key and ModelFamily tiers.
core/providers/anthropic/chat.go capModel computed once and consistently replaces bifrostReq.Model for all capability checks; wire model left untouched for routing.
core/providers/anthropic/responses.go Same capModel pattern applied uniformly across all Responses API capability checks.
core/providers/bedrock/responses.go capModel resolved once for Anthropic-specific thinking/reasoning gating; IsAnthropicModelFamily guard correctly continues using bifrostReq.Model since ResolveFamily already resolves alias via ctx.
core/providers/gemini/responses.go ToGeminiResponsesRequest gains ctx parameter; capModel threads through convertParamsToGenerationConfigResponses correctly.
core/providers/openai/responses.go ToOpenAIResponsesRequest and ToOpenAICompactionRequest gain ctx; capModel used for all reasoning model capability checks.
core/providers/vertex/vertex.go capModel resolved locally for tool version remapping and field stripping; Gemini converters updated to pass ctx.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Incoming Request\nbifrostReq.Model = opaque wire ID] --> B{ctx has\nResolvedAlias?}
    B -- No --> C[fallbackModel\n= bifrostReq.Model]
    B -- Yes --> D{ra.Config.ModelName\nnon-empty?}
    D -- Yes --> E[capModel =\nModelName\ne.g. claude-opus-4-8]
    D -- No --> F{ra.Config.ModelID\nnon-empty?}
    F -- Yes --> G[capModel = ModelID]
    F -- No --> C
    C --> H[capModel = wire model\npre-refactor behavior preserved]
    E --> I[Capability gating checks\nIsAdaptiveOnlyThinkingModel\nSupportsAdaptiveThinking\nIsFableFamily\nSupportsFastMode\netc.]
    G --> I
    H --> I
    A --> J[Wire model unchanged\nfor routing / API body\n/ token limits]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[Incoming Request\nbifrostReq.Model = opaque wire ID] --> B{ctx has\nResolvedAlias?}
    B -- No --> C[fallbackModel\n= bifrostReq.Model]
    B -- Yes --> D{ra.Config.ModelName\nnon-empty?}
    D -- Yes --> E[capModel =\nModelName\ne.g. claude-opus-4-8]
    D -- No --> F{ra.Config.ModelID\nnon-empty?}
    F -- Yes --> G[capModel = ModelID]
    F -- No --> C
    C --> H[capModel = wire model\npre-refactor behavior preserved]
    E --> I[Capability gating checks\nIsAdaptiveOnlyThinkingModel\nSupportsAdaptiveThinking\nIsFableFamily\nSupportsFastMode\netc.]
    G --> I
    H --> I
    A --> J[Wire model unchanged\nfor routing / API body\n/ token limits]
Loading

Reviews (6): Last reviewed commit: "fix: resolve model names for feature gat..." | Re-trigger Greptile

Comment thread core/schemas/account.go
@TejasGhatte
TejasGhatte force-pushed the 06-18-fix_resolve_model_names_for_feature_gating branch 2 times, most recently from 9ffe79f to 063a1ef Compare June 18, 2026 09:47

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
core/providers/gemini/gemini_test.go (1)

356-383: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Assert converter errors before dereferencing result.

Line 356 and Line 398 capture err from ToGeminiChatCompletionRequest(...), but the test continues using result without first asserting require.NoError(t, err).

Suggested fix
 result, err := gemini.ToGeminiChatCompletionRequest(nil, &schemas.BifrostChatRequest{
   ...
 })
+require.NoError(t, err)
+require.NotNil(t, result)

 ...
 result, err := gemini.ToGeminiChatCompletionRequest(nil, &schemas.BifrostChatRequest{
   ...
 })
+require.NoError(t, err)
+require.NotNil(t, result)

As per coding guidelines, **/*.go should follow explicit error handling practices.

Also applies to: 398-414

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/providers/gemini/gemini_test.go` around lines 356 - 383, The test code
captures the error returned from the ToGeminiChatCompletionRequest function
calls but does not assert that the error is nil before dereferencing and using
the result variable. Add require.NoError(t, err) assertions immediately after
each call to ToGeminiChatCompletionRequest (at both line 356 and line 398) to
properly handle and validate the returned error before proceeding with result
usage.

Source: Coding guidelines

🧹 Nitpick comments (2)
core/providers/gemini/gemini_test.go (1)

1146-1147: ⚡ Quick win

Add at least one non-nil context test for canonical model gating.

These updated call sites pass nil context only, so the new context-based canonical-model path is still untested in this suite. Please add one table case that builds a *schemas.BifrostContext with alias model metadata and verifies capability gating uses the canonical model, not the wire/deployment model.

As per coding guidelines, behavior changes should keep deterministic coverage; this PR stack specifically introduces context-aware canonical model resolution for gating.

Also applies to: 1471-1472, 1740-1741, 1848-1849, 2691-2692, 2980-2981, 3523-3524, 3623-3624

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/providers/gemini/gemini_test.go` around lines 1146 - 1147, The test
cases for gemini.ToGeminiChatCompletionRequest only pass nil context, leaving
the context-based canonical model path untested. Add at least one new test case
to the test table that creates a *schemas.BifrostContext with alias model
metadata in tt.input and passes it (non-nil) to the
gemini.ToGeminiChatCompletionRequest function call, then verify the result uses
the canonical model for capability gating rather than the wire or deployment
model. Apply this same pattern to all the mentioned call sites (lines 1146-1147,
1471-1472, 1740-1741, 1848-1849, 2691-2692, 2980-2981, 3523-3524, 3623-3624) to
ensure context-aware canonical model resolution is properly covered.

Source: Coding guidelines

core/providers/openai/responses_test.go (1)

187-187: ⚡ Quick win

Add at least one non-nil ctx canonical-model test path.

All updated call sites pass nil context, so the new alias-driven ResolveCanonicalModel(ctx, ...) branch remains untested here. Please add one focused case where context resolves to a different canonical model and assert gating follows the resolved model, not the raw wire model.
As per coding guidelines, Go behavior changes should keep deterministic test coverage for the changed path.

Also applies to: 246-246, 281-281, 425-425, 546-546, 1681-1681, 1753-1753, 1879-1879

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/providers/openai/responses_test.go` at line 187, The test cases in the
file only call ToOpenAIResponsesRequest with nil context, leaving the
ResolveCanonicalModel(ctx, ...) code path untested. Add at least one new test
case (in addition to the existing tests at lines 187, 246, 281, 425, 546, 1681,
1753, and 1879) where a non-nil context is passed to ToOpenAIResponsesRequest,
configure that context to resolve to a different canonical model than the raw
wire model, and then assert that the gating behavior follows the resolved
canonical model from the context rather than the wire model. This ensures
deterministic test coverage for the new context-driven canonical model
resolution path.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/internal/llmtests/passthrough_api.go`:
- Line 90: In the call to gemini.ToGeminiChatCompletionRequest on line 90,
replace the `nil` argument (first parameter) with the constructed `ctx`
variable. This ensures that context-aware canonical model resolution is properly
performed during the test path instead of being skipped, which allows the test
to catch potential alias-gating regressions.

In `@core/providers/gemini/responses.go`:
- Around line 91-92: The capModel variable assigned from
schemas.ResolveCanonicalModel is not normalized, which causes it to retain
provider prefixes like "google/" that should be stripped before capability
checks. After the line where capModel is assigned, apply the same normalization
logic used for the Gemini request model above (strip the "google/" prefix and
trim whitespace) to ensure capModel is in the correct format for the
supportsThinkingConfig, isGemini3Plus, and multimodal tool-output gating checks.

---

Outside diff comments:
In `@core/providers/gemini/gemini_test.go`:
- Around line 356-383: The test code captures the error returned from the
ToGeminiChatCompletionRequest function calls but does not assert that the error
is nil before dereferencing and using the result variable. Add
require.NoError(t, err) assertions immediately after each call to
ToGeminiChatCompletionRequest (at both line 356 and line 398) to properly handle
and validate the returned error before proceeding with result usage.

---

Nitpick comments:
In `@core/providers/gemini/gemini_test.go`:
- Around line 1146-1147: The test cases for gemini.ToGeminiChatCompletionRequest
only pass nil context, leaving the context-based canonical model path untested.
Add at least one new test case to the test table that creates a
*schemas.BifrostContext with alias model metadata in tt.input and passes it
(non-nil) to the gemini.ToGeminiChatCompletionRequest function call, then verify
the result uses the canonical model for capability gating rather than the wire
or deployment model. Apply this same pattern to all the mentioned call sites
(lines 1146-1147, 1471-1472, 1740-1741, 1848-1849, 2691-2692, 2980-2981,
3523-3524, 3623-3624) to ensure context-aware canonical model resolution is
properly covered.

In `@core/providers/openai/responses_test.go`:
- Line 187: The test cases in the file only call ToOpenAIResponsesRequest with
nil context, leaving the ResolveCanonicalModel(ctx, ...) code path untested. Add
at least one new test case (in addition to the existing tests at lines 187, 246,
281, 425, 546, 1681, 1753, and 1879) where a non-nil context is passed to
ToOpenAIResponsesRequest, configure that context to resolve to a different
canonical model than the raw wire model, and then assert that the gating
behavior follows the resolved canonical model from the context rather than the
wire model. This ensures deterministic test coverage for the new context-driven
canonical model resolution path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e482125-4c12-49d3-ac7f-fb9bd46f9d73

📥 Commits

Reviewing files that changed from the base of the PR and between 9ffe79f and 063a1ef.

📒 Files selected for processing (25)
  • core/internal/llmtests/passthrough_api.go
  • core/providers/anthropic/anthropic.go
  • core/providers/anthropic/chat.go
  • core/providers/anthropic/requestbuilder.go
  • core/providers/anthropic/responses.go
  • core/providers/anthropic/utils.go
  • core/providers/azure/azure.go
  • core/providers/bedrock/mantle.go
  • core/providers/bedrock/responses.go
  • core/providers/bedrock/utils.go
  • core/providers/gemini/chat.go
  • core/providers/gemini/gemini.go
  • core/providers/gemini/gemini_test.go
  • core/providers/gemini/responses.go
  • core/providers/openai/advisor_filter_test.go
  • core/providers/openai/chat.go
  • core/providers/openai/chat_test.go
  • core/providers/openai/openai.go
  • core/providers/openai/responses.go
  • core/providers/openai/responses_marshal_test.go
  • core/providers/openai/responses_test.go
  • core/providers/vertex/utils.go
  • core/providers/vertex/vertex.go
  • core/schemas/account.go
  • core/schemas/account_test.go
🚧 Files skipped from review as they are similar to previous changes (10)
  • core/providers/vertex/utils.go
  • core/providers/anthropic/anthropic.go
  • core/providers/anthropic/utils.go
  • core/schemas/account.go
  • core/providers/anthropic/chat.go
  • core/providers/anthropic/requestbuilder.go
  • core/schemas/account_test.go
  • core/providers/bedrock/utils.go
  • core/providers/bedrock/responses.go
  • core/providers/anthropic/responses.go

Comment thread core/internal/llmtests/passthrough_api.go Outdated
Comment thread core/providers/gemini/responses.go Outdated
@TejasGhatte
TejasGhatte force-pushed the 06-18-fix_resolve_model_names_for_feature_gating branch from 063a1ef to a46d43b Compare June 18, 2026 10:04
@coderabbitai
coderabbitai Bot requested a review from roroghost17 June 18, 2026 10:08
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
@TejasGhatte
TejasGhatte force-pushed the 06-18-fix_resolve_model_names_for_feature_gating branch from a46d43b to 1adaf17 Compare June 18, 2026 10:30
@TejasGhatte
TejasGhatte force-pushed the 06-18-fix_model_id_in_bedrock_batch_request branch from 25b266a to 3af716d Compare June 18, 2026 14:06
@TejasGhatte
TejasGhatte force-pushed the 06-18-fix_resolve_model_names_for_feature_gating branch from 1adaf17 to dd531f5 Compare June 18, 2026 14:06
akshaydeo
akshaydeo previously approved these changes Jun 19, 2026

akshaydeo commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 19, 6:42 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 19, 6:44 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from 06-18-fix_model_id_in_bedrock_batch_request to graphite-base/4520 June 19, 2026 06:43
@akshaydeo
akshaydeo changed the base branch from graphite-base/4520 to dev June 19, 2026 06:43
@akshaydeo
akshaydeo dismissed stale reviews from coderabbitai[bot] and themself June 19, 2026 06:43

The base branch was changed.

@akshaydeo
akshaydeo merged commit 84ef364 into dev Jun 19, 2026
10 of 11 checks passed
@akshaydeo
akshaydeo deleted the 06-18-fix_resolve_model_names_for_feature_gating branch June 19, 2026 06:44
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.

3 participants