mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
## Description Implements request routing for the AI Bridge Proxy. After MITM decryption, requests to known AI providers (Anthropic, OpenAI) are rewritten to the corresponding aibridged endpoint, while requests to unknown hosts are passed through to their original destination. ## Changes * Add `CoderAccessURL` configuration option for specifying the Coder deployment URL * Add `handleRequest` to route decrypted requests based on target host * Route known AI providers (Anthropic and OpenAI) to AI Bridge specific endpoint. * Passthrough requests to unknown hosts directly to their original destination * Inject Coder session token (from https://github.com/coder/coder/pull/21342) as `Authorization: Bearer` header for aibridged * Add tests for routing and passthrough behavior Depends on: https://github.com/coder/coder/pull/21342 Closes: https://github.com/coder/internal/issues/1181