filememory/2026-05-04.md
- Updated OpenClaw Codex auth profile to `openai-codex:david.westman@beviable.se`; OAuth was completed successfully via server flow after several expired-code retries.
- Model defaults/policy were moved to Codex-first: primary `openai-codex/gpt-5.5`, lighter fallback `openai-codex/gpt-5.3-codex`; legacy `openai/*` models treated as fallback/manual.
- Added/updated workflow docs for Codex + brain repo sync (`docs/BRAIN-CODEX-SYNC.md`) and enforced local git discipline via hooks in `openclaw-kompis-brain` (`.git/hooks/commit-msg` requiring `Context:` and `.git/hooks/pre-push` requiring clean tree).
- Brain-viewer deployment path learned: static export mode is required for current file-browser architecture (uses `node:fs`/`node:path`), while full edge SSR path failed on Cloudflare Pages due to runtime constraints.
- Cloudflare Worker `brain-metrics-api` deployed at `https://brain-metrics-api.david-westman.workers.dev` and verified returning JSON for:
  - `/api/codex-quota`
  - `/api/openai-credits`
- Key Cloudflare operational notes from today:
  - `wrangler` not globally installed on server; use `npx wrangler ...`.
  - Headless server OAuth browser launch fails (`xdg-open` missing); API-token auth via `CLOUDFLARE_API_TOKEN` is reliable.
  - Cloudflare API token is shown only once at creation; must be stored when created.
  - For Pages + next-on-pages, `nodejs_compat` flag is required.
- Branch/environment workflow established for brain-viewer:
  - `main` production, `staging` pre-prod, `codex/*` feature branches.
  - Work should end with commit+push+PR and commit hash reporting.