Skip to content

Add durable authenticated preview handoff#2164

Open
3mdistal wants to merge 4 commits into
mainfrom
codex/protected-preview-desktop-handoff
Open

Add durable authenticated preview handoff#2164
3mdistal wants to merge 4 commits into
mainfrom
codex/protected-preview-desktop-handoff

Conversation

@3mdistal

Copy link
Copy Markdown
Contributor

What changed

  • adds a credential-free agentnative://open?app=<id>&preview=<exact-origin> handoff for durable hosted review candidates
  • stores a Vercel Shareable Link credential locally with Electron safeStorage, bound to one exact HTTPS origin
  • bootstraps the protected deployment in a sandboxed hidden window, verifies the exact origin and session, and opens the candidate without replacing the app's persisted local-dev configuration
  • adds a bounded localhost OAuth doorway for renewing an app session when needed, with strict request/response header allowlists and post-run cookie cleanup
  • makes clear/remove/reset revoke preview access and partition cookies with epoch-guarded, fail-closed concurrency behavior
  • queues startup deep links until Electron, app configuration, and the renderer listener are ready, then drains them sequentially
  • extends Frame routing for the protected-preview OAuth exchange without making every preview own port 8080

Why

Agent Native candidate previews need stable hosted links that can be reviewed days later without keeping an app dev server alive or registering every Vercel preview as a Google OAuth callback. Framework Desktop becomes the trusted authenticated review surface while the hosted candidate remains durable and exact-revision addressable.

Security boundary

  • only Vercel Shareable Links are accepted; broad automation-bypass credentials are not
  • the credential is exact-origin bound and never appears in the public descriptor
  • preview navigation is blocked when origin, credential epoch, session partition, bootstrap result, or session proof is stale or inconclusive
  • browser cookies and authorization headers are not forwarded through the localhost OAuth doorway
  • stale or partial cookie writes are purged before navigation can proceed

Verification

  • full local CI parity passed after rebasing onto current main: pnpm build, pnpm verify:pack, pnpm typecheck, pnpm lint, pnpm knip, and non-PTY pnpm test
  • focused Desktop suite: 49/49 passed
  • focused protected-preview and OAuth-doorway tests passed
  • independent native-app QA passed two complete cold starts against the exact hosted Content candidate
  • on both passes the authenticated fixture was visible, ports 8080 and 8083 stayed free, persisted Content config remained localhost:8083/dev, and shutdown left ports 3334/8080/8083 free

Known unrelated behavior

Frame's existing AgentPanel Router error and an inactive Clips localhost:8094 connection warning remain visible in development logs. Neither blocks candidate review and neither is changed here.

@netlify

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Visual recap — not generated

The recap was suppressed because the diff matched a secret/credential pattern. No plan was published.

Reason: high-confidence secret in diff.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

@netlify

This comment has been minimized.

builder-io-integration[bot]

This comment was marked as outdated.

@builder-io-integration builder-io-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Builder reviewed your changes and has a few items to flag 🟡

Review Details

Incremental Code Review Summary

Reviewed the latest PR update, including the OAuth doorway registration handoff and its new concurrency tests. The change correctly reserves a registration before listener startup, shares the in-flight listener promise, and prevents an older unregister callback from removing a newer registration. The focused doorway suite now covers concurrent startup and unregister-during-registration behavior, and the implementation is sound for this delta.

No new reportable issues were identified in the latest commit. Previously reported issues remain unchanged and were not reposted. The prior doorway-registration cleanup comment was verified fixed and resolved before this review.

Risk remains high overall because the PR changes authenticated preview sessions, OAuth routing, and protected proxy behavior.

🧪 Browser testing: Attempted after review, but all test cases were blocked by unavailable browser automation tools; Electron-only flows could not be attached in this environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants