Skip to content

POC: chatd uses aibridged routing in OSS#25577

Closed
dannykopping wants to merge 1 commit into
graphite-base/25577from
dk/aibridge-inmemory-host-prefix
Closed

POC: chatd uses aibridged routing in OSS#25577
dannykopping wants to merge 1 commit into
graphite-base/25577from
dk/aibridge-inmemory-host-prefix

Conversation

@dannykopping
Copy link
Copy Markdown
Contributor

@dannykopping dannykopping commented May 21, 2026

This is not a real PR intended to be merged; it's merely a validation that Agents + OSS can target AI Gateway while the HTTP API cannot be accessed directly without a license.

Copy link
Copy Markdown
Contributor Author

dannykopping commented May 21, 2026

@dannykopping dannykopping changed the title feat(coderd/aibridged): rewrite in-process roundtripper path with provider prefix POC: chatd uses aibridged routing in OSS May 21, 2026
@dannykopping dannykopping changed the base branch from dk/aibridge-inmemory-pipe to graphite-base/25577 May 21, 2026 16:34
@dannykopping dannykopping force-pushed the graphite-base/25577 branch from df9c129 to b3dd62e Compare May 21, 2026 16:50
@dannykopping dannykopping force-pushed the dk/aibridge-inmemory-host-prefix branch from 6336792 to add17ab Compare May 21, 2026 16:50
@dannykopping dannykopping changed the base branch from graphite-base/25577 to dk/aibridge-inmemory-pipe May 21, 2026 16:50
@dannykopping dannykopping force-pushed the dk/aibridge-inmemory-host-prefix branch from add17ab to b5981a0 Compare May 21, 2026 18:19
@dannykopping dannykopping force-pushed the dk/aibridge-inmemory-pipe branch 2 times, most recently from b3dd62e to 7aaf647 Compare May 21, 2026 18:19
@dannykopping dannykopping force-pushed the dk/aibridge-inmemory-host-prefix branch 2 times, most recently from b5981a0 to 5b236dd Compare May 21, 2026 18:38
@dannykopping dannykopping force-pushed the dk/aibridge-inmemory-pipe branch 3 times, most recently from 063af1f to c2fa1c4 Compare May 22, 2026 07:12
…vider prefix

Fantasy SDK clients construct upstream URLs like POST https://api.anthropic.com/v1/messages, so the in-process RoundTripper that ships the request to aibridged sees a path of /v1/messages. The aibridge mux dispatches on the provider-prefixed path (/anthropic/v1/messages) just like aibridgeproxyd does on the network path, so a naive request lands in the mux's catch-all and returns 404 'route not supported'.

Add a host -> provider-name lookup to the transport factory. When the request's URL host matches a configured provider's BaseURL host, prepend /{providerName} to the path before invoking the handler. The mapping is built once at daemon startup from the same providers passed to newAIBridgeDaemon, mirroring enterprise/cli/aibridgeproxyd.go's domainsFromProviders.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant