Repository navigation
refactor: replace 8 Drop-built pieces with what ViteHub already ships - #267
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Important
The proxy refactor creates two sessions on the first request and leaves one active after sign-out. It also rewrites the GitHub account on ordinary authenticated reads. Existing DROP_HOST settings can silently select a different deployment target.
Approach: Using ViteHub’s built-ins makes sense, but the proxy integration needs to preserve one session per sign-in and the host migration needs to prevent silent retargeting.
Reviewed changes across auth, realtime, build setup, deployment, and MCP documentation.
- Proxy sign-in: Traced membership checks, GitHub identity caching, cookie propagation, and sign-out through Drop’s mounted Auth routes.
- Realtime presence: Checked the presence-only room and the prebuilt client served to review sites.
- Build and deployment: Checked Nuxt type generation, the dev runner, Forge release metadata, and host selection for Docker, Deno, Cloudflare, Vercel, and Netlify.
- MCP: Checked the documentation boundary between Drop’s toolkit and ViteHub’s MCP conventions.
58 focused tests passed. The VPS build succeeded, and HTTP checks with mocked GitHub responses and real SQLite confirmed the auth regressions on the built app.
gpt-6.2-sol(high) | 𝕏
Latest result Pull request merged. Final answersSession Pull request merged. Session Pass interrupted; current webhook state retained. Session Pass interrupted; current webhook state retained. |
There was a problem hiding this comment.
Important
The legacy VPS override works for standalone builds, but a conflicting provider marker still makes the build fail, contrary to the migration guide and the new test.
Reviewed changes in 572fbdc since the prior Pullfrog review.
- Carried the proxy session forward. Verified on the built VPS app that both
/api/meand/api/auth/get-sessioncreate one session on first sign-in and leave none after sign-out. - Skipped unchanged GitHub token writes. Verified zero account updates when the token matched and one update when it rotated.
- Restored the legacy host override. Verified that
DROP_HOST=vpsalone produces the Node preset, then checked how the override interacts with ViteHub’s provider detection.
All 55 focused auth and deployment tests passed. The provider conflict surfaced in a full Nuxt build, not in the configuration test.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
ℹ️ No P0 or P1 findings remain; one dev reload edge case is noted inline.
Reviewed changes in 62b1b3b since the prior Pullfrog review.
- Shared the legacy host override with ViteHub. Verified that a full Nuxt build with
DROP_HOST=vps VERCEL=1and noVITEHUB_HOSTnow completes with thenode-serverpreset. - Waited for the presence cursor to settle. Verified that the browser test still checks the original coordinates and tolerance.
- Scoped the Doctor exception to one comment. The repository’s Doctor check reported no warnings or errors.
All 12 focused deployment and presence browser tests passed; the changed cursor test also passed three additional runs.
gpt-6.2-sol(high) | 𝕏
62b1b3b to
1f184eb
Compare
There was a problem hiding this comment.
Important
The shared proxy-auth plugin lets separate browsers inherit the same Drop session. Signing out in one invalidates the other browser’s session.
Approach: Reusing forwardAuth() still makes sense, but deduplicating a sign-in should not make separate browsers share a session.
Reviewed changes since the prior Pullfrog review at 62b1b3b.
- Shared proxy state. Checked the process-wide
forwardAuth()instance and its new parallel sign-in test against a separate-browser sign-out case. - Dropped two changes during the rebase. Checked the restored cursor assertion and confirmed Doctor passes without the previous exception.
All 32 focused auth and deployment tests passed, as did three runs of the presence browser suite. The separate-browser sign-out check failed with the shared plugin and passed with independent plugin state.
gpt-6.2-sol(high) | 𝕏
1f184eb to
282ef8a
Compare
There was a problem hiding this comment.
Important
Separate browsers now keep separate sessions, but overlapping first requests for a new GitHub member can still fail with 403.
Approach: Keep session reuse scoped to each sign-in, but coordinate first-time account creation across requests.
Reviewed changes since the previous Pullfrog review at 1f184eb.
- Restored per-instance proxy auth. Checked that the middleware still carries the session cookie through the request, and traced how the new plugin lifetime affects simultaneous first sign-ins.
- Replaced the shared-session test. Verified that signing out of one browser leaves the other browser’s session valid.
All 50 checked-in tests in the focused auth and deployment suites passed, and pnpm run doctor was clean. A separate concurrency check through the proxy middleware reproduced the 403 using SQLite and mocked GitHub responses.
gpt-6.2-sol(high) | 𝕏
282ef8a to
17ae195
Compare
There was a problem hiding this comment.
Important
The new lock fixes concurrent account creation, but it also serializes session reads for members who are already signed in.
Approach: Coordinate first-time provisioning across requests while keeping browser sessions separate and established-session reads concurrent.
Reviewed changes since the prior Pullfrog review at 282ef8a.
- Added a per-identity sign-in queue. Checked its scope on both first sign-in and ordinary requests with a valid session.
- Added an overlapping-request regression test. Verified that both requests receive session cookies and provision one user and one GitHub account through separate Auth instances.
All 51 focused auth and deployment tests passed, and pnpm run doctor reported no warnings or errors.
gpt-6.2-sol(high) | 𝕏
Drop had its own Better Auth plugin for proxy sign-in: a proxySignIn
endpoint, its own session and account writes, and a middleware that
called it. vite-hub/auth/forward does the same through forwardAuth():
it reads the forwarded header, asks verify() for the identity, and
creates or reuses the user, account and session.
proxyAuth() is now forwardAuth({ header, verify }). verify returns null
when proxy mode is off, so the header signs nobody in then, and null
for a non-member. A membership check that fails (401, 403 or GitHub
down) becomes an APIError with the same status. verify keeps the
GitHub identity for 5 minutes per token, because forwardAuth calls it
on every request that carries the header and the profile and email
lookups are 2 GitHub calls.
The middleware keeps what Better Auth can't do from a hook: it answers
403 GITHUB_MEMBERSHIP_REQUIRED for a non-member, clears the proxy
cookie on sign-out, and turns a refused sign-in into a 403. After
sessionOf() it puts the new session cookie into the request's cookie
header and removes the forwarded token header, so the handlers after it
read the session from the cookie and don't run forwardAuth again. The
request headers are immutable on Deno, so it replaces them with a copy.
proxyAuth() still makes a plugin per auth lookup. forwardAuth reuses
the session it made for an identity in the same plugin, so one plugin
for the process would give a second browser of the same GitHub user the
first browser's session, and signing out in one would end both. The
lock that forwardAuth keeps for parallel first sign-ins is per plugin
too, so two overlapping first requests could both insert the user and
one got a 403 on user.email. Until the GitHub account exists, the
middleware runs the sign-in one at a time per GitHub identity, which
keeps one user and one account. Once it exists, requests don't wait on
each other.
verify passes the token as accessToken only when it differs from the
one stored on the GitHub account, because forwardAuth writes the
account whenever it gets one. A rotated token is still stored for the
membership checks.
The tests now sign in through the handler and the middleware, and add
cases for the header without proxy mode, one session per first request
through sign-out, separate sessions for two browsers of one user, one
user for overlapping first requests, no waiting once the account
exists, and account writes only on a rotated token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The presence definition faked a document: a "drop-presence" kind that loaded an empty body and threw on save, plus persistence: false. ViteHub's document: false is the presence-only definition: rooms carry awareness and no document, authorize is asked only for read, and editor, history and persistence become type errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review.js loads /review-presence.js on other sites. Drop built that
file itself: a Vite plugin bundled scripts/review-presence-entry.ts
into a virtual module on every build. @vite-hub/realtime already ships
the same client prebuilt as client/browser.js, one ES module with Yjs
inside and no imports, and its docs say to serve its text.
The route now imports it with ?raw and keeps the same headers
(text/javascript, CORS *, CORP cross-origin). The build script, its
entry and the virtual module's type are gone.
The import is written `import { default as ... }` because oxlint's
import/default rule resolves the ?raw specifier to browser.js, sees no
default export, and fails. The named form is the same import and
passes, without a disable comment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ViteHub's Nuxt module sets devServer.runner to "node-worker" for the Cloudflare host (devServer.runner ??= NITRO_DEV_RUNNER || "node-worker" at c3cfab6), so Drop's own setting repeated it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ViteHub's module writes its types during nuxt prepare. With .nuxt and .vitehub deleted, nuxt prepare alone gives the same .nuxt type files, and pnpm typecheck passes. vitehub types prepare only added dev runtime files under .vitehub, which nuxt dev writes anyway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…uild The release commit came from 4 env names. readForgeBuild from @vite-hub/forge/build/node reads VITEHUB_BUILD_COMMIT first, then each CI and host's commit variable (Vercel, Workers Builds, Netlify, GitHub Actions and others), then git. A local build now logs its HEAD instead of an empty commit. @vite-hub/forge was only a transitive dependency, so it becomes a direct one at the same pinned URL as the other ViteHub packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…DROP_HOST Drop chose its host from DROP_HOST, which every host config had to set, while ViteHub detects the same host from VITEHUB_HOST, the Nitro preset and each host's own build variables (WORKERS_CI, NETLIFY, VERCEL, DENO_DEPLOY). Two names for one choice could disagree, and ViteHub fails the build when VITEHUB_HOST doesn't match its plan. deployment() now calls detectHost() and maps ViteHub's "node" to Drop's "vps". Without a detected host it still falls back to vps when DROP_DATABASE_URL is set, else cloudflare. Vercel and Netlify drop DROP_HOST because their build variables are enough. Deno and the Dockerfile, which have none, set VITEHUB_HOST=deno and VITEHUB_HOST=node at build time, and Deno's predeploy migration sets VITEHUB_HOST=deno. pnpm run deploy builds with VITEHUB_HOST=cloudflare, so a .env with DROP_DATABASE_URL still builds for Cloudflare. Nothing read DROP_HOST at runtime, so the Docker runtime stage loses it. The self-host docs and .env.example name VITEHUB_HOST. A build that still sets DROP_HOST keeps its host: without VITEHUB_HOST, deployment() reads DROP_HOST as VITEHUB_HOST, with vps as node, so a DROP_HOST=vps build without DROP_DATABASE_URL doesn't turn into a Cloudflare build. nuxt.config.ts then sets VITEHUB_HOST to that host, so ViteHub's build checks see the same one. An unknown DROP_HOST fails the build. The self-host docs say how to switch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
server/mcp/tools and server/mcp/prompts look like ViteHub's mcp folder layout, but Drop registers them by hand with nitro-mcp-toolkit and doesn't enable ViteHub's mcp feature. One line in AGENTS.md says so, so an agent doesn't write vite-hub/mcp tools there. Moving the folder would touch every tool import while other PRs are open, so it stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17ae195 to
28de5e2
Compare
There was a problem hiding this comment.
✅ No new issues found. No P0 or P1 findings remain.
Reviewed changes since the prior Pullfrog review at 17ae195.
- Scoped the proxy sign-in queue to first-time provisioning. Verified that requests for an existing GitHub account no longer wait on Drop’s queue, while overlapping first sign-ins still create one user and one GitHub account.
- Added a concurrency regression test. Verified that both requests for an existing account can enter session lookup before either finishes.
All 52 focused auth and deployment tests passed. pnpm run doctor reported no warnings or errors.
gpt-6.2-sol(high) | 𝕏

Drop still did 8 things that ViteHub at
c3cfab6already does: proxy sign-in, a fake presence document, a build step for the presence client, the dev runner, a second types step, the build commit, the host choice, and nothing told agents thatserver/mcpisn't ViteHub's MCP. These are findings 10, 12, 14, 15, 16, 17, 19 and 36 of the Drop × ViteHub audit. Each one is its own commit.proxyAuth()is nowforwardAuth()fromvite-hub/auth/forward. Itsverifyreturnsnullwhen proxy mode is off, so the header signs nobody in then. It also returnsnullfor a non-member, and keeps the GitHub identity for 5 minutes per token, sinceforwardAuthasks on every request that carries the header. It passes the token asaccessTokenonly when it differs from the one on the GitHub account, becauseforwardAuthwrites the account whenever it gets one.proxyAuth()still makes a plugin per auth lookup, becauseforwardAuthreuses the session it made for an identity in its plugin: one plugin per process would give a second browser of the same GitHub user the first one's session, and signing out in one would end both. Its lock for parallel first sign-ins is per plugin too, so until the GitHub account exists, the middleware runs the sign-in one at a time per GitHub identity. Overlapping first requests used to both insert the user, and one got a 403. Once the account exists, requests don't wait on each other. The middleware still answers 403GITHUB_MEMBERSHIP_REQUIREDto non-members and clears the proxy cookie on sign-out. After it signs someone in, it puts the session cookie into the request and removes the token header, so the handlers after it read that one session and don't sign in again.document: false, ViteHub's presence-only definition./review-presence.jsserves@vite-hub/realtime/client/browser.jsas text, soscripts/review-presence*.tsand thevirtual:review-presenceplugin go. The import readsimport { default as … } from "…?raw"because oxlint'simport/defaultresolves the?rawpath tobrowser.jsand finds no default export.devServer.runner ??= "node-worker"for Cloudflare.postinstallis justnuxt prepare. With.nuxtand.vitehubdeleted, it writes the same.nuxttypes asnuxt prepare && vitehub types prepare.release.commitcomes fromreadForgeBuild()in@vite-hub/forge/build/node, now a direct dependency at the pinned URL. It readsVITEHUB_BUILD_COMMIT, then each host's commit variable, then git, so a local build logs its HEAD.deployment()callsdetectHost()and mapsnodetovps. Vercel and Netlify need nothing, because ViteHub reads their own build variables. Deno's build and predeploy, the Dockerfile build stage andpnpm run deploysetVITEHUB_HOST. Without either, a build withDROP_DATABASE_URLstill picks VPS, and any other build picks Cloudflare. An oldDROP_HOSTstill works whileVITEHUB_HOSTis unset:vpsreads asnode, andnuxt.config.tspasses the result on asVITEHUB_HOSTso ViteHub's build checks agree. An unknown value fails the build. The self-host docs say to switch toVITEHUB_HOST.AGENTS.mdsaysserver/mcp/toolsandpromptsusenitro-mcp-toolkit. I left the folder where it is, because moving it would touch every tool import while other PRs are open.Checked
pnpm typecheck,pnpm run doctor(clean), lint and format on the changed files, andpnpm buildfor Cloudflare. The built route carries the client as a string literal, and the Worker's release commit is the git HEAD.nuxt devrunning withoutdevServer.runner, two tabs of one signed-in owner on a local site loaded the realreview.js, got presence tickets, imported/review-presence.jsacross origins (text/javascript,Access-Control-Allow-Origin: *) and joined the samedocument: falseroom over WebSocket. A made-up ticket gets 403.auth/proxy-sign-in(member sign-in through the header, non-member 403, banned user, sign-out, no sign-in without proxy mode, one session for a first request and none left after sign-out, separate sessions for two browsers of one user, one user for overlapping first requests, no waiting once the account exists, account writes only on a rotated token),auth/content-headers,auth/content-error,auth/members-only-review,review/presence,deploy/config(includingDROP_HOST),deploy/cli-migrations,deploy/deploy-cloudflare,content-origin/runtime,viewer/presence-activity,mcp/handoffs. The session, account-write andDROP_HOSTcases fail on the PR's first head.review/presence-browserfails about 1 run in 2 on "cursor at the heading's middle". It looks like it reads the cursor's transform before the cursor settles. That test uses its own stand-in client, and this PR doesn't touch it orreview.js.I didn't build for Vercel, Netlify, Deno or Docker, and didn't try proxy sign-in behind a real oauth2-proxy.
🤖 Generated with Claude Code