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

Method GetRequestHandler

coderd/aibridged/aibridged.go:144–155  ·  view source on GitHub ↗

GetRequestHandler retrieves a (possibly reused) [*aibridge.RequestBridge] from the pool, for the given user.

(ctx context.Context, req Request)

Source from the content-addressed store, hash-verified

142
143// GetRequestHandler retrieves a (possibly reused) [*aibridge.RequestBridge] from the pool, for the given user.
144func (s *Server) GetRequestHandler(ctx context.Context, req Request) (http.Handler, error) {
145 if s.requestBridgePool == nil {
146 return nil, xerrors.New("nil requestBridgePool")
147 }
148
149 reqBridge, err := s.requestBridgePool.Acquire(ctx, req, s.Client, NewMCPProxyFactory(s.logger, s.tracer, s.Client))
150 if err != nil {
151 return nil, xerrors.Errorf("acquire request bridge: %w", err)
152 }
153
154 return reqBridge, nil
155}
156
157// isShutdown returns whether the Server is shutdown or not.
158func (s *Server) isShutdown() bool {

Callers 1

ServeHTTPMethod · 0.95

Calls 4

NewMCPProxyFactoryFunction · 0.85
NewMethod · 0.65
AcquireMethod · 0.65
ErrorfMethod · 0.45

Tested by

no test coverage detected