Skip to content

Pull requests list [AI Gateway] Rename injected transformer provider parameter to providerId #2690

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

Pull requests list [AI Gateway] Rename injected transformer provider parameter to providerId #2690
Arshardh merged 1 commit into
wso2:multi-provider-routingfrom
Aakashwije:fix/multi-provider-transformer-provider-id-camelcase

Conversation

@Aakashwije

Copy link
Copy Markdown
Contributor

Purpose

PR #2684 renamed the injected multi-provider transformer parameter from id to provider-id. However, transformer policy parameters follow camelCase naming conventions, and the expected parameter name is providerId.

This follow-up corrects the parameter contract so transformer policies can reliably identify and route requests to the selected upstream provider.

Follow-up to #2684.

Goals

  • Rename the injected transformer parameter from provider-id to providerId.
  • Align the Gateway Controller and transformer policies on the camelCase parameter contract.
  • Preserve the existing provider selection and upstream routing behavior.
  • Update the relevant unit test and sample comments.

Approach

The Gateway Controller now injects the resolved provider upstream name using:

params["providerId"] = name

The existing provider-name resolution behavior remains unchanged:

  • Use additionalProviders[].as when configured.
  • Otherwise, use additionalProviders[].id.
  • Execute the transformer only when its provider is selected.

The corresponding unit-test assertion and multi-provider proxy sample comments were also updated to use providerId.

This change does not affect the UI.

User stories

  • As an API developer, I want transformer policies to receive the provider identifier using the expected parameter name so requests are routed correctly.
  • As a platform developer, I want the Gateway Controller and transformer policies to use a consistent camelCase parameter contract.
  • As an operator, I want existing multi-provider configurations to continue working without configuration changes.

Documentation

N/A — providerId is injected internally by the Gateway Controller and is not a user-configured API field.

The comments in the openai-multi-provider-proxy.yaml sample were updated to describe the corrected internal contract.

Automation tests

  • Unit tests

    • Updated TestLLMProviderTransformer_TransformProxy_AdditionalProviderTransformerIsConditional to verify that the resolved provider name is injected through params["providerId"].
    • 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 correcting the name of an internally injected transformer parameter.
    • Provider selection, execution conditions, and upstream-name resolution remain unchanged.

Security checks

Samples

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

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: 0031a7fa-e331-4e5e-a222-6e53e8160fec

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 238e5ef 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