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)
| 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. |
| 26 | func 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 | |
| 34 | func (p *Server) computerUseProviderAndModelFromConfig( |
| 35 | ctx context.Context, |
no test coverage detected