Skip to content

fix: use the Void Cloudflare login in dev and unblock self-hosted platform onboarding - #424

Merged
cpojer merged 12 commits into
mainfrom
fix/onboarding-auth-and-platform
Oct 14, 2026
Merged

cpojer merged 12 commits into
mainfrom
fix/onboarding-auth-and-platform

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Problem

Two onboarding reports, checked against the code and with live runs.

1. void/ai local dev stops with edge-preview error 10000

void connect / void cloudflare login ──▶ cf store        ✓ valid     ← void cloudflare status reads this
vp dev (direct Cloudflare, void/ai)  ──▶ Wrangler store  ✗ stale or another user
                                       └─ /workers/subdomain/edge-preview → 10000 → dev exits

Since login moved to the cf CLI, the Cloudflare Vite plugin and Wrangler's getPlatformProxy still read Wrangler's store, because Void never set CLOUDFLARE_CF_AUTH. Logging in again through Void did not help. Only CLOUDFLARE_API_TOKEN worked.

2. Self-hosted platform onboarding dead ends

install ── AI Gateway 500 ──▶ resume refuses the gateway: "not owned … resume the owning installation"
        ── 10089 ───────────▶ "enable Analytics Engine" (the dashboard page may have no switch)
        ── success ─────────▶ /setup → provider → "Login failed … check the provider configuration"
                                   (no code, nothing logged, no command can change the saved settings)
uninstall ── project Zero Trust on + no admin ──▶ "run zero-trust disable" ──▶ needs an admin  ✗ stuck

The installer also rejected Entra ID group policies that the platform accepts, kept a rejected or deleted policy pick on resume, and asked for 9 pasted values on a minimal install.

The account plan did not cause the login failure or the blocked uninstall. Every plan-gated step runs before auth init and the Zero Trust step.

What this PR changes

vp dev / preview / build (direct Cloudflare app)
  plugin start ──▶ CLOUDFLARE_CF_AUTH + keychain ──▶ remote session reads the cf store (the void cloudflare login)
                   CLOUDFLARE_API_TOKEN still wins
first admin login fails
  page: error code + hint + callback URL      Worker log: the code
  void platform repair --auth-config <file>   (or a question in an interactive repair) ──▶ new settings + new code

uninstall, no platform user, Zero Trust on
  CLI ──signed installer request──▶ /internal/platform/app-access/turn-off
        └─ turns project Zero Trust off only while no user exists; reports a user who appears meanwhile → CLI stops
AI Gateway 500 then resume ──▶ still refuses a gateway with no ownership record, and says what to do: delete it and rerun, or use another name
10089                       ──▶ the error links to "If Cloudflare rejects Analytics Engine" in the docs
Access policy pick          ──▶ one shared company-identity check (installer = platform), re-asks on a bad or deleted pick
create mode                 ──▶ "Allow my company's email domain" creates the policy
interactive install         ──▶ generates the JWT signing key and the project encryption key (env values still win)

Decisions

Topic Decision
Which Cloudflare login dev uses The void cloudflare login session, for every direct Cloudflare app, so user-written remote bindings use it too. CLOUDFLARE_API_TOKEN still wins.
Dev when the remote session cannot sign in No startup check and no "continue without AI". The error comes from inside Cloudflare's plugin, and a check adds 0.4–1 s to every start. An interactive terminal can sign in; the docs name void cloudflare login.
Login methods in Access policies A login_method rule counts as company identity only for a company identity provider that is also one of the selected identity providers and whose required settings name one tenant (Entra ID, Okta, OneLogin, PingOne, Centrify, Google Workspace, or Cloudflare restricted to account members). One-time PIN, public logins, and generic OIDC or SAML logins do not; a Require rule such as Emails ending in fixes such a policy. A Cloudflare Account Member rule also counts. Entra ID group and authentication context rules count only for a selected identity provider.
AI Gateway and Analytics Engine Both stay required.
Generated keys Interactive installs only. Headless installs still pass the keys, because a short-lived runner loses its recovery data.
Uninstall without an admin Only the computer that holds the installation's setup authority can turn Zero Trust off, and only while no platform user exists.

Known limits

Testing

Check Result
Live: void@ packed from this branch, valid Void login, stale Wrangler token, no CLOUDFLARE_API_TOKEN main: dev exits with 10000. This branch: dev ready, /api/ai 200 with a real completion. astro build with a prerendered page: main exits 1, this branch builds.
Regression tests Each new test fails with its fix reverted.
vp run check, vp lint, vp fmt --check pass
vp run test --base origin/main 707 files pass

🤖 Generated with Claude Code

https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

Brooooooklyn and others added 4 commits October 14, 2026 23:12
…nd builds

`void connect` and `void cloudflare login` save the Cloudflare login with
the cf CLI. The Cloudflare Vite plugin and Wrangler's getPlatformProxy read
Wrangler's own login store unless CLOUDFLARE_CF_AUTH is set. So `vp dev` of
a direct Cloudflare app that imports void/ai stopped at startup with
edge-preview error 10000 when Wrangler's login was stale or belonged to
another user, while `void cloudflare status` said the user was signed in.

When the plugin starts for a direct Cloudflare app, select the cf store and
the OS keychain, as the Void CLI does. This covers dev, vite preview, astro
preview and builds that open a remote session. CLOUDFLARE_API_TOKEN still
wins. The D1 read replication error now points to `void cloudflare login`.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
…s Engine failures

An AI Gateway create that failed with a server error could still create the
gateway. Resume then refused the gateway as not owned and told the user to
resume the owning installation, which they were already doing. The planner
now accepts a same-named gateway that was created just after this
installation's create intent, and the refusal says to delete the gateway in
the dashboard and rerun.

A Worker upload that fails with Analytics Engine error 10089 now links to a
docs section that explains how to turn Analytics Engine on. Before the
database is claimed, a resume takes a corrected VOID_PLATFORM_DATABASE_URL,
and a failure tells the user how to choose another database.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
The installer and the platform kept separate lists of Access rules that
count as a company identity, and the installer rejected Entra ID groups and
authentication contexts. One shared check now serves both. A login method
counts only when its identity provider is a company directory, so One-time
PIN and public logins do not count.

A rejected or deleted policy pick no longer sticks on resume: the picker
checks the pick and asks again. Create mode can create an Allow policy for
the company email domain. Interactive installs generate the JWT signing key
and the project encryption key and keep them in the encrypted recovery data.
Environment values still win, and headless installs still require them. The
credentials docs list each credential and why it is needed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
…ll without an administrator

When the first administrator sign-in failed, the page said only that login
failed, nothing was logged, and no command could change the saved login
settings: repair sent the same settings again, and `config auth recover`
needs an administrator. With project Zero Trust on, uninstall also refused,
because only an administrator can turn Zero Trust off.

- `void platform repair --auth-config <file>`, or a question in an
  interactive repair, replaces the login settings while setup is pending.
- The login failure page shows a safe error code, a hint and the expected
  callback URL, and the Worker logs the code. The default GitHub setup route
  shows the same page. Install and repair print the callback URL with the
  setup code.
- Uninstall turns project Zero Trust off through a signed installer route
  while no platform user exists, and stops if a user appears meanwhile.
- The install progress no longer links to /setup before the platform is ready.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T19:09:29.886560Z e3247dc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://fix-onboarding-auth-and-platform-void-cloud.voidzero-docs.workers.dev (commit e3247dc)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://52609da0-void-cloud.voidzero-docs.workers.dev e3247dc 2026-10-14T19:06:23.657Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9fd52d74-void-cloud.voidzero-docs.workers.dev b288169 2026-10-14T18:38:03.890Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://b5029455-void-cloud.voidzero-docs.workers.dev 82647d8 2026-10-14T18:01:01.844Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://1360df2c-void-cloud.voidzero-docs.workers.dev ce916cd 2026-10-14T17:28:01.753Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4b20b2bd-void-cloud.voidzero-docs.workers.dev 6d20f5f 2026-10-14T16:35:34.864Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://fa12d87c-void-cloud.voidzero-docs.workers.dev 6264c8d 2026-10-14T15:47:28.643Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://885c7427-void-cloud.voidzero-docs.workers.dev 07c2876 2026-10-14T15:21:13.018Z Visit the dashboard ↗

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6264c8ddea

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/platform-install-auth.ts Outdated
Brooooooklyn added a commit that referenced this pull request Oct 14, 2026
…et (#431)

## Problem

`packages/void/test/unit/db-request-pool.test.ts` failed on Windows CI
(PR #424, `test (windows-latest, unit)`):

```
FAIL  unit-pglite  packages/void/test/unit/db-request-pool.test.ts > void/db postgresql across requests
Error: Hook timed out in 10000ms.
 ❯ packages/void/test/unit/db-request-pool.test.ts:133:3
```

```
beforeAll (default hook timeout 10s)
  └─ new PGlite() + first exec ──▶ cold WASM start on Windows CI > 10s ──▶ timeout
```

## What this PR changes

The hook waits for `pglite.waitReady` and gets 30s on Windows.
`runner-pg.test.ts` and `db-export-roundtrip.test.ts` use the same
pattern. Query and test deadlines stay unchanged.

## Testing

| Check | Result |
| --- | --- |
| `vp test run packages/void/test/unit/db-request-pool.test.ts` (macOS)
| 6 passed |
| Windows CI | this PR (label `test: windows`) |

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Brooooooklyn and others added 2 commits October 14, 2026 12:33
The repair login file was checked against de-duplicated login kinds. With
two connections of one kind, such as two OIDC providers, a file could drop,
add or rename a connection. The pending setup reset then deleted and
recreated the login connections without it, and a renamed administrator
connection moved the first administrator to another connection.

The file must now list the same connection IDs and kinds as the saved
setup; a missing ID means the install default. The error names the
installed connection IDs. The interactive repair already keeps every saved
connection.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8da1fe5574

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/platform/src/access-policy.ts Outdated
… identity

Cloudflare's generic OpenID Connect and SAML connectors accept any provider,
including ones with public sign-up; Cloudflare's own OIDC example points at
consumer Google. A policy whose only rule is a login method for such a
provider could admit anyone, while the installer called it company-only.

Count a login method only when its identity provider type names one tenant
in its required settings: Entra ID, Okta, OneLogin, PingOne, Centrify,
Google Workspace, or the Cloudflare login restricted to account members.
A policy with a generic login still passes with a Require rule such as
Emails ending in the company domain, and the setup guide says so. The
platform server's check is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ce916cd8c2

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/platform-cloudflare.ts Outdated
Comment thread packages/platform/src/access-policy.ts
Brooooooklyn and others added 2 commits October 15, 2026 01:59
…p record

Resume reused a same-named AI Gateway when it was created within a few
minutes after this installation's create intent. A creation time is not an
ownership record: if the installer stopped before its create request, a
gateway made by someone else in that window was recorded as installer-owned,
and --purge-resources could later delete it. The AI Gateway API has no field
that could carry an ownership marker.

Remove the time-window check, so the planner fails closed again. The refusal
now says that Void cannot tell whether this installation created the
resource, and gives the two ways forward: delete it and rerun the command if
an earlier failed attempt made it, or choose another installation name.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
…y identity

An Access policy that allows only the members of one Cloudflare account was
rejected by both the installer and project Zero Trust, because the shared
company-identity check did not know the cloudflare_account_member rule.

Accept it when account_id is missing, which Cloudflare defines as the
account that owns the policy, or is a 32-hex account ID. Other shapes stay
rejected. The setup guide lists account members among the rules that count.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 82647d8edc

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/void/src/cli/platform-access-provision.ts Outdated
…provider

The Access applications offer only the identity providers picked for the
install. A policy whose only identity proof is a login method for another
provider admits nobody, so administrators were locked out of a new platform.
Check login method rules against the selected providers, and say which rule
is wrong when that is the only problem.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b2881698d6

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/platform/src/access-policy.ts
Comment thread platform/packages/api/src/platform-app-access.ts
… for a selected provider

These rules name the Entra ID provider that proves them. When that provider
is not one of the selected identity providers, the Access applications do
not offer it at sign-in, and a policy that relies on the rule admits nobody.
Check them like login method rules. Okta, Google Workspace, SAML and GitHub
organization rules keep their current behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0123r5HnanmW2VUrZ7VWDufH
@cpojer
cpojer merged commit 0bad1ad into main Oct 14, 2026
24 checks passed
@cpojer
cpojer deleted the fix/onboarding-auth-and-platform branch October 14, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants