TypeError crash on /v1/messages anonymous-fallback path: 'Cannot read private member #state'
Author: schienbizCreated Sep 29, 2026Updated Sep 29, 2026
Summary
POST /v1/messages?beta=true crashes with a 500 when a request falls through to the anonymous path (REQUIRE_API_KEY=false, no valid bearer, zero providers configured).
Repro
- Fresh install from source at commit
a13e82d(v3.8.51),npm install,npm run dev - No providers configured (
omniroute providers list→ "No providers configured") omniroute launch --profile <name> -p "<any prompt>"(Claude Code client), or anyPOST /v1/messages?beta=truewith an invalid/missing bearer
Observed
Server log:
[clientApiPolicy] invalid bearer presented to /api/v1/messages but REQUIRE_API_KEY=false — falling through to anonymous (key_id=key_auth)
⨯ TypeError: Cannot read private member #state from an object whose class did not declare it
at withDeadlineSignal (open-sse/utils/earlyStreamKeepalive.ts:341:22)
at deadlineAdmittedHandler (src/app/api/v1/messages/route.ts:100:46)
339 | const token = `dl-${Date.now().toString(36)}-${(deadlineTokenSeq += 1)}`;
340 | headers.set(DEADLINE_TOKEN_HEADER, token);
> 341 | const wrappedReq = new Request(request, { signal: combined, headers });
| ^
342 | deadlineControllers.set(combined, deadlineController);
343 | deadlineTokenByController.set(deadlineController, token);
POST /v1/messages?beta=true 500 in 43msClient-side: the CLI-launched Claude Code process just hangs (no output, exits only on external timeout) instead of surfacing this error — likely retrying against a 500 with no backoff cap visible to the caller.
Expected
Either a graceful error response (e.g. "no provider configured" 4xx) instead of a 500 crash, or at minimum the private-field access in withDeadlineSignal should not throw for this code path.
Environment
- OmniRoute 3.8.51 (commit
a13e82d9850a8e94f7c0e5a4b83c7ae444cf0ea9) - Node v24.19.0, macOS (darwin arm64)
- Source build (not npm/Docker package)
Source: diegosouzapw/OmniRoute