MCPcopy Index your code
hub / github.com/coder/coder / RegisterInMemoryAIBridgedHTTPHandler

Method RegisterInMemoryAIBridgedHTTPHandler

coderd/aibridged.go:40–50  ·  view source on GitHub ↗

RegisterInMemoryAIBridgedHTTPHandler mounts [aibridged.Server]'s HTTP router onto [API]'s router, so that requests to aibridged will be relayed from Coder's API server to the in-memory aibridged. This also registers an in-process [agplaibridge.TransportFactory] so that chatd can route coder-agent L

(srv http.Handler)

Source from the content-addressed store, hash-verified

38// the entitlement check stays on the HTTP route for external callers, while
39// in-process coder-agent traffic is the explicit carve-out.
40func (api *API) RegisterInMemoryAIBridgedHTTPHandler(srv http.Handler) {
41 if srv == nil {
42 panic("aibridged cannot be nil")
43 }
44
45 api.aibridgedHandler = http.StripPrefix("/api/v2/aibridge", srv)
46
47 factory := aibridged.NewTransportFactory(api.aibridgedHandler)
48 var asInterface agplaibridge.TransportFactory = factory
49 api.AIBridgeTransportFactory.Store(&asInterface)
50}
51
52// CreateInMemoryAIBridgeServer creates a [aibridged.DRPCServer] and returns a
53// [aibridged.DRPCClient] to it, connected over an in-memory transport.

Callers 6

ServerMethod · 0.80
startTestAIBridgeDaemonFunction · 0.80
TestAIBridgeRoutingFunction · 0.80
TestAIBridgeRateLimitingFunction · 0.80
TestAIBridgeAllowBYOKFunction · 0.80

Calls 2

NewTransportFactoryFunction · 0.92
StoreMethod · 0.45

Tested by 5

startTestAIBridgeDaemonFunction · 0.64
TestAIBridgeRoutingFunction · 0.64
TestAIBridgeRateLimitingFunction · 0.64
TestAIBridgeAllowBYOKFunction · 0.64