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

Function computerUseConfigContext

coderd/x/chatd/computer_use.go:26–32  ·  view source on GitHub ↗

computerUseConfigContext lets internal and worker callers read deployment-wide chat settings when they lack an HTTP-derived actor. HTTP handlers always carry an actor, so the AsChatd fallback never elevates user contexts and this function is a no-op in that path. The setting it gates is global and r

(ctx context.Context)

Source from the content-addressed store, hash-verified

24// contexts and this function is a no-op in that path. The setting it gates is
25// global and readable by any authenticated actor, not a back-door.
26func computerUseConfigContext(ctx context.Context) context.Context {
27 if _, ok := dbauthz.ActorFromContext(ctx); ok {
28 return ctx
29 }
30 //nolint:gocritic // Worker contexts may lack an actor.
31 return dbauthz.AsChatd(ctx)
32}
33
34func (p *Server) computerUseProviderAndModelFromConfig(
35 ctx context.Context,

Calls 2

ActorFromContextFunction · 0.92
AsChatdFunction · 0.92

Tested by

no test coverage detected