Fix dl5 pairing and CF Access cookie flow#102
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e18e7e2806
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bbdf232c3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f0be53beb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b334f3bbff
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
/api/auth/sessionand can show the pairing prompt.Root Cause
isHostedStaticApp()treated every*.pages.devorigin as hosted-static when no backend URL was compiled into the bundle. Onhttps://dl5-5uq.pages.dev, that bypassedresolveInitialServerAuthGateState(), so a fresh unpaired browser rendered the hosted static empty-state instead of the server-backed pairing prompt. The current deployed build also registers a service worker, but the live baseline showed the app never called/api/auth/session; the route gate made the wrong first-load decision before auth.Proof So Far
Current deployed dl5 baseline from a fresh Chromium context through CF Access service-token cookie:
{ "href": "https://dl5-5uq.pages.dev/", "hasPairingInput": false, "projectRows": 0, "swController": true, "bodyText": "Code ALPHA Search Ctrl+K Scheduled PROJECTS No projects yet Settings T3 Code (Alpha) Connect an environment to get started Add a reachable backend manually to start working from this browser. Add environment Toggle Sidebar" }Screenshot:
/tmp/dl5-regression-baseline/dl5-current-1783416001851.pngThe post-merge proof script is included at
e2e/dl5-real-browser-proof.mjs; after deployment it should prove unpaired prompt, pairing with a minted token, and already-paired app load/projects.Validation
vp test apps/web/src/hostedPairing.test.tsvp test packages/client-runtime/src/authorization/layer.test.ts packages/client-runtime/src/connection/resolver.test.ts packages/client-runtime/src/connection/onboarding.test.ts apps/desktop/src/ipc/methods/cloudflareAccess.test.tsvp run typecheckvp check(passes; existing unrelated mobile lint warnings remain)scripts/factory/precommit-gate.sh --prepare(PASS: static checks + clean Codex gpt-5.5 autoreview)e18e7e280Supersedes #93.