fix(web): require authentication for AskGH Ask APIs
Draft
MS
2mo ago+120+120+012345678901234567890123456789-2-2-0123456789
Require authentication for streaming and blocking Ask requests when EXPERIMENT_ASK_GH_ENABLED=true, returning HTTP 401 before entitlement checks or generation. The blocking gate lives in askCodebase, covering MCP callers too; existing anonymous access behavior is preserved when AskGH is disabled.
Verified with eight endpoint regression cases covering authenticated/anonymous requests with AskGH enabled/disabled, plus targeted ESLint.
Summary by cubic
When EXPERIMENT_ASK_GH_ENABLED is enabled, streaming and blocking Ask requests now require authentication and return HTTP 401 before entitlement checks or generation.
- Gates the blocking path in
askCodebase, which also covers the MCPask_codebasetool and the/api/chat/blockingroute. - Preserves anonymous access when AskGH is disabled.
- Adds regression tests for both endpoints covering authenticated and anonymous requests with the flag on and off.