Files
orca/cloud/infra
Neil 919b6259bb feat(cloud): CODEX-RELAY chatgpt.com egress through a Cloud Run relay
chatgpt.com answers Cloudflare Workers' egress with a 403 "Unable to load site" page, so Codex via
the Orca account could never get an answer through the egress proxy (#767 made that a printed
error). Cloud Run's egress is answered normally (probed, then deleted).

- cloud/apps/chatgpt-relay: a dependency-free Node relay. chatgpt.com only, the same Codex path
  pinning as the Worker (shared sandbox-control/src/codex-paths.ts), SSE streamed chunk by chunk,
  no WebSocket upgrades, hop and Cloud Run headers dropped, logs without headers, bodies or queries.
- Cloud Run IAM authenticates the Worker: one invoker service account (run.invoker on the relay
  only); the Worker mints a Google ID token for the relay URL and sends it in
  X-Serverless-Authorization, so the swapped ChatGPT Authorization passes through untouched.
- sandbox-control: CHATGPT_RELAY_URL + CHATGPT_RELAY_SERVICE_ACCOUNT route the egress proxy's
  chatgpt.com fetches through the relay; unset, chatgpt.com goes direct as before. A relay
  sign-in failure answers Codex a 503 JSON detail instead of reaching chatgpt.com.
- cloud/infra/chatgpt-relay: Terraform (staging backend applied; production is a runbook step).
2026-11-15 00:21:38 -08:00
..