Skip to content

[AI Gateway] Rename injected transformer provider parameter to provider-id#2684

Merged
Arshardh merged 1 commit into
wso2:multi-provider-routingfrom
Aakashwije:fix/multi-provider-transformer-provider-id
Jul 15, 2026
Merged

[AI Gateway] Rename injected transformer provider parameter to provider-id#2684
Arshardh merged 1 commit into
wso2:multi-provider-routingfrom
Aakashwije:fix/multi-provider-transformer-provider-id

Conversation

@Aakashwije

Copy link
Copy Markdown
Contributor

Purpose

The OpenAI multi-provider transformer policies now use provider-id as the injected parameter identifying their target upstream provider. The Gateway Controller previously injected this value using params["id"], creating a contract mismatch that could prevent transformer policies from selecting and routing to the correct upstream.

This change aligns the Gateway Controller with the transformer policy contract.

Related changes:

Goals

  • Inject the provider upstream name using the provider-id parameter.
  • Keep provider selection and upstream routing consistent across all transformer policies.
  • Preserve the existing resolution behavior where additionalProviders[].as is used when configured, otherwise falling back to additionalProviders[].id.
  • Update tests and samples to reflect the renamed parameter.

Approach

The Gateway Controller’s multi-provider transformer construction has been updated to inject:

params["provider-id"] = name

The existing provider-name resolution remains unchanged:

  • Use additionalProviders[].as when configured.
  • Otherwise, use additionalProviders[].id.

The corresponding unit-test assertion and multi-provider proxy sample documentation were updated to use provider-id.

This change does not affect the UI.

User stories

  • As an API developer, I want multi-provider transformer policies to receive the expected provider identifier so requests are routed to the correct upstream provider.
  • As a platform developer, I want the Gateway Controller and transformer policies to use a consistent parameter contract.
  • As an operator, I want existing additionalProviders[].id and additionalProviders[].as configurations to continue working without changes.

Documentation

No product documentation impact. The parameter is injected internally by the Gateway Controller and is not manually configured when a transformer is attached to an additional provider.

The openai-multi-provider-proxy.yaml sample comments were updated to document the internal provider-id contract.

Automation tests

  • Unit tests

    • Updated TestLLMProviderTransformer_TransformProxy_AdditionalProviderTransformerIsConditional to verify that the resolved provider upstream name is injected through params["provider-id"].
    • The focused Gateway Controller unit test passes.
    • Code coverage was not measured separately for this focused change.
  • Integration tests

    • No new integration tests were added.
    • The change is limited to renaming an internally injected transformer parameter.
    • Existing provider selection, execution conditions, and upstream-name resolution remain unchanged.

Security checks

Samples

Updated the OpenAI multi-provider proxy sample comments to explain that each transformer receives its resolved upstream provider name through provider-id.

No sample configuration fields were renamed:

  • additionalProviders[].id remains unchanged.
  • additionalProviders[].as remains unchanged.
  • Router mappings and selected_provider metadata remain unchanged.

Related PRs

Test environment

  • Go: 1.26.x
  • Operating system: macOS, ARM64
  • JDK: N/A
  • Database: N/A
  • Browser: N/A

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: eb4ac1fd-dd17-4193-8d2a-e6f9cbba7078

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@Arshardh
Arshardh merged commit b5c2b83 into wso2:multi-provider-routing Jul 15, 2026
2 checks passed
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