Problem
The brokered token endpoint POST /v1/orb/token (brokerOrbToken) mints a fresh GitHub installation token on every call — no server-side cache. GitHub installation tokens are valid ~1h, so minting that often throttles GitHub's token-creation endpoint. Measured live from the VPS: /v1/orb/token takes 16-20s (3rd sequential mint timed out), while /health is 0.57s and the secret/relay are valid.
The engine aborts the broker call at 10s (BROKER_TIMEOUT_MS), so it can never complete a throttled mint → orb_broker_degraded_serving_cached_token (cache hit) or, once the cache lapses (container restart), orb_broker_unavailable — which blocks reviews. A vicious cycle: each timeout → retry → another mint → harder throttle.
Fix
- Server-side token cache on the enrollment row (
cached_token_json, encrypted at rest), so GitHub is minted at most once per install per ~hour and the cache survives engine restarts.
- Timeout headroom so the one cold transition mint completes and populates the cache.
Fixed in the linked PR.
Problem
The brokered token endpoint
POST /v1/orb/token(brokerOrbToken) mints a fresh GitHub installation token on every call — no server-side cache. GitHub installation tokens are valid ~1h, so minting that often throttles GitHub's token-creation endpoint. Measured live from the VPS:/v1/orb/tokentakes 16-20s (3rd sequential mint timed out), while/healthis 0.57s and the secret/relay are valid.The engine aborts the broker call at 10s (
BROKER_TIMEOUT_MS), so it can never complete a throttled mint →orb_broker_degraded_serving_cached_token(cache hit) or, once the cache lapses (container restart),orb_broker_unavailable— which blocks reviews. A vicious cycle: each timeout → retry → another mint → harder throttle.Fix
cached_token_json, encrypted at rest), so GitHub is minted at most once per install per ~hour and the cache survives engine restarts.Fixed in the linked PR.