You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #243, which bundles @workos/skills@0.7.3. The skills explain the required application settings; this PR makes the installer create the sign-in route and configure supported settings itself, rather than relying on its restricted agent to run management commands.
Include the shared AuthKit setup reference directly in the agent prompt. Keep the agent focused on app code and explicitly prohibit bypassing its shell restrictions.
Require a dedicated Next.js /sign-in route using the SDK, separate from the callback. Include missing integration requirements in agent retries and fail validation instead of reporting incomplete code as installed.
Configure Next.js callback, default Sign-out URI, and Initiate login URI through native installer code. Match the app client ID to a unique sandbox environment and its default application, preserve existing URLs/defaults, validate changes, and verify saved settings by reading them back.
Preserve an existing homepage unless --homepage-url explicitly requests a change. Conflicting existing sign-out defaults or initiate-login URLs are left unchanged.
Carry application setup results through the state machine into human and JSON completion output. Distinguish installed code, verified settings, and browser flows still needing tests.
Authentication and scope
With a usable dashboard session, all three URL settings use the same client-ID-matched sandbox application. This step does not launch login.
Without a dashboard session, API-key-only and unclaimed installs register the callback using their sandbox API key, then return immediately without any dashboard writes. The API key is the sole write target in this path. A failed callback registration fails the install instead of leaving sign-in broken behind a success result.
The two write paths are exclusive. Dashboard failures, including partial writes, never fall back to API-key mutations. This avoids splitting one run's settings across environments without removing callback registration for logged-out users.
API-only results report callbackRegistered: true but verified: false. Sign-out URI, Initiate login URI, and any requested homepage still need dashboard setup; browser flows remain untested.
Production environments and non-default applications are not configured automatically.
Native application setup is Next.js App Router-only. The SDK documents App Router support, not a Pages Router equivalent. CLI choices and human/JSON help now advertise only --router app; there is no Pages Router option in the interactive picker. Known Pages-only projects are declined before credential provisioning, including with --force. Explicit --router pages is rejected during argument parsing, and legacy programmatic Pages inputs are guarded too. Mixed-router projects use App Router without modifying the Pages tree. Shared prompt loading applies to other framework installers.
The Next.js post-agent validation still runs with --no-validate so the installer does not configure a missing route.
This does not change logout or the installer's initial credential-selection behavior.
Verification
bun run test: 2,824 tests passed across 163 files with published skills 0.7.3 installed.
bun run typecheck and bun run lint passed.
Formatting passed for the changed source/spec files and validation rules.
Tests cover no pre-agent mutations from mixed credentials, exclusive API-key/dashboard write paths, logged-out callback registration and duplicate handling, fatal callback failures, production/unknown-key refusal, single-application dashboard targeting, early Pages Router refusal, preserving settings, rejected dry runs, concurrent edits, partial writes, read-back mismatches, route validation, and completion reporting.
Regression tests reproduced the missing logged-out callback and unsupported router advertising before the latest fixes. Compiled help advertises only app, and compiled argument parsing rejects --router pages.
Compiled offline command smoke passed, including install, integrate, and dashboard refusing Pages Router with structured unsupported_nextjs_router errors, no login, and no project writes. Authenticated smoke was not run.
End-to-end browser sign-in/sign-out and password-reset/invitation flows have not been verified for this PR. Unit tests use mocked dashboard responses; they do not prove a live dashboard configuration succeeds.
The PR appears safe to merge based on the accepted findings, with no new non-duplicate issue requiring a review comment.
Summary
The latest changes restore callback registration for logged-out sandbox installs while keeping API-key and dashboard mutations mutually exclusive, and align the CLI with the Next.js SDK’s App Router-only support.
Registers and reports the callback through the sandbox API key when no dashboard session exists.
Keeps authenticated URL configuration scoped to the Client-ID-matched sandbox application.
Removes Pages Router from CLI choices and rejects known Pages-only projects before provisioning.
Propagates application-setup verification details through structured completion output.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Validate installed Next.js routes] --> B{Dashboard session available?}
B -->|Yes| C[Match Client ID to one sandbox environment]
C --> D[Configure callback, sign-out, and initiate-login URLs]
D --> E[Read settings back and report verification]
B -->|No| F{Sandbox API key available?}
F -->|Yes| G[Register callback through API key]
G --> H[Report callback registered; remaining settings unverified]
F -->|No| I[Report manual dashboard setup required]
@greptileai Please re-review the latest commit d17ce80. It restores sandbox API-key-only callback registration after validation, keeps API-key and dashboard write paths exclusive, fails installation on callback registration failure, and removes unsupported Pages Router choices from CLI help and the picker. All CI checks pass; the current 3/5 summary still refers to 3366b2a.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #243, which bundles
@workos/skills@0.7.3. The skills explain the required application settings; this PR makes the installer create the sign-in route and configure supported settings itself, rather than relying on its restricted agent to run management commands./sign-inroute using the SDK, separate from the callback. Include missing integration requirements in agent retries and fail validation instead of reporting incomplete code as installed.--homepage-urlexplicitly requests a change. Conflicting existing sign-out defaults or initiate-login URLs are left unchanged.Authentication and scope
callbackRegistered: truebutverified: false. Sign-out URI, Initiate login URI, and any requested homepage still need dashboard setup; browser flows remain untested.--router app; there is no Pages Router option in the interactive picker. Known Pages-only projects are declined before credential provisioning, including with--force. Explicit--router pagesis rejected during argument parsing, and legacy programmatic Pages inputs are guarded too. Mixed-router projects use App Router without modifying the Pages tree. Shared prompt loading applies to other framework installers.--no-validateso the installer does not configure a missing route.Verification
bun run test: 2,824 tests passed across 163 files with published skills 0.7.3 installed.bun run typecheckandbun run lintpassed.bun run buildpassed.workos internal verify-assets --jsonpassed and reported bundled skills 0.7.3.app, and compiled argument parsing rejects--router pages.install,integrate, anddashboardrefusing Pages Router with structuredunsupported_nextjs_routererrors, no login, and no project writes. Authenticated smoke was not run.End-to-end browser sign-in/sign-out and password-reset/invitation flows have not been verified for this PR. Unit tests use mocked dashboard responses; they do not prove a live dashboard configuration succeeds.