Skip to content

feat: validate duplicate provider names in NewRequestBridge#240

Merged
ssncferreira merged 3 commits intomainfrom
ssncf/feat-validate-provider-names
Mar 31, 2026
Merged

feat: validate duplicate provider names in NewRequestBridge#240
ssncferreira merged 3 commits intomainfrom
ssncf/feat-validate-provider-names

Conversation

@ssncferreira
Copy link
Copy Markdown
Contributor

@ssncferreira ssncferreira commented Mar 30, 2026

Description

Adds validation to NewRequestBridge to prevent registering multiple providers with the same name. Duplicate names would cause route prefix conflicts and ambiguous metrics, logs, and circuit breaker behavior.

Changes

  • Add validateProviders() that rejects duplicate provider names at startup
  • Add table-driven tests covering valid configurations and duplicate name detection

Related to: #152

Disclaimer: initially produced by Claude Opus 4.6, heavily modified and reviewed by @ssncferreira .

Copy link
Copy Markdown
Contributor Author

ssncferreira commented Mar 30, 2026

@ssncferreira ssncferreira force-pushed the ssncf/feat-validate-provider-names branch from a55b2af to d210136 Compare March 30, 2026 18:31
@ssncferreira ssncferreira force-pushed the ssncf/fix-interceptor-provider branch from 15350e0 to 4a69340 Compare March 30, 2026 18:32
@ssncferreira ssncferreira force-pushed the ssncf/feat-validate-provider-names branch from d210136 to e33dbcd Compare March 30, 2026 18:43
@ssncferreira ssncferreira marked this pull request as ready for review March 30, 2026 18:44
@ssncferreira ssncferreira requested review from Copilot, dannykopping and pawbana and removed request for Copilot March 30, 2026 19:14
@ssncferreira ssncferreira force-pushed the ssncf/feat-validate-provider-names branch 2 times, most recently from 71c69d3 to 30d306a Compare March 31, 2026 10:48
Copy link
Copy Markdown
Collaborator

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

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

The timing for this is funny because I have to look into https://linear.app/codercom/issue/AIGOV-157/spike-to-understand-if-there-is-a-simple-way-to-handle-multi-api-key which may require multiple providers of the same name, but I'll have to find a way around this.

Copy link
Copy Markdown
Contributor Author

ssncferreira commented Mar 31, 2026

Merge activity

  • Mar 31, 2:32 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Mar 31, 2:36 PM UTC: Graphite rebased this pull request as part of a merge.
  • Mar 31, 2:37 PM UTC: @ssncferreira merged this pull request with Graphite.

@ssncferreira ssncferreira changed the base branch from ssncf/fix-interceptor-provider to graphite-base/240 March 31, 2026 14:34
@ssncferreira ssncferreira changed the base branch from graphite-base/240 to main March 31, 2026 14:35
@ssncferreira ssncferreira force-pushed the ssncf/feat-validate-provider-names branch from 7d0c198 to b1c6f3f Compare March 31, 2026 14:36
@ssncferreira ssncferreira merged commit 519b082 into main Mar 31, 2026
5 checks passed
ssncferreira added a commit to coder/coder that referenced this pull request Mar 31, 2026
… upstreams (#23811)

## Description

Adds support for multiple Copilot provider instances to route requests to different Copilot upstreams (individual, business, enterprise). Each instance has its own name and base URL, enabling per-upstream metrics, logs, circuit breakers, API dump, and routing.

## Changes

* Add Copilot business and enterprise provider names and host constants
* Register three Copilot provider instances in aibridged (default, business, enterprise)
* Update `defaultAIBridgeProvider` in `aibridgeproxy` to route new Copilot hosts to their corresponding providers

## Related

* Depends on: coder/aibridge#240
* Closes: coder/aibridge#152

Note: documentation changes will be added in a follow-up PR.

_Disclaimer: initially produced by Claude Opus 4.6, heavily modified and reviewed by @ssncferreira ._
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