Commit 653dfba
feat(deploy): Cloudflare Workers deploy — single Worker serves SPA + API on KV
The directRunner is pure fetch, so the whole app runs serverless on Cloudflare
Workers (no Node host, no codex binary):
- src/backend/cloudflare/kvSessionStore.ts: handleCodexRequestKV wraps the core
handler, hydrating each session's tokens from KV before the request and
flushing back after (Workers are stateless across requests).
- deploy/cloudflare/worker.ts: one Worker — /api/codex/* via the KV handler +
directRunner, everything else falls through to the ASSETS (SPA) binding.
- deploy/cloudflare/wrangler.jsonc: KV binding, SPA assets (run_worker_first
/api/*), custom domain, workers_dev:false.
- deploy/cloudflare/README.md: setup + deploy steps.
Deployed live and verified end-to-end on Cloudflare: SPA serves, /session sets a
KV-backed signed cookie, /login/start returns a real device code from
auth.openai.com via directRunner — no CLI, no Node. 114 tests passing,
main typecheck clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 475467a commit 653dfba
17 files changed
Lines changed: 281 additions & 0 deletions
File tree
- deploy/cloudflare
- .wrangler
- cache
- state/v3
- cache/miniflare-CacheObject
- kv/miniflare-KVNamespaceObject
- src/backend/cloudflare
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 commit comments