Conversation
|
| ${ | ||
| config.metadata.integration === 'nextjs' | ||
| ? ` | ||
| Create a dedicated /sign-in GET route in the App Router using getSignInUrl() from @workos-inc/authkit-nextjs and redirect(await getSignInUrl()) from next/navigation. Keep the OAuth callback using handleAuth() separate. The Initiate login URI is the app origin plus /sign-in, NEVER the callback URI. Read existing files before editing; do not replace an unrelated existing sign-in flow. Keep /sign-in public and follow the SDK README for PKCE cookie handling. | ||
| ` |
There was a problem hiding this comment.
Pages Router is a supported and detected Next.js mode, but this instruction always tells the agent to create an App Router /sign-in route. The new validation rule also accepts only {,src/}app/sign-in/route.*, so a correct Pages Router implementation is rejected and the installation fails, or the agent must add an unwanted App Router tree. Please make the prompt and validation depend on the detected router and support the equivalent Pages Router route.
Knowledge Base Used:
- Application installation workflows
- Installer orchestration and project mutation
- Agent and skills workflows
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/agent-runner.ts
Line: 343-347
Comment:
**Pages Router installs fail**
Pages Router is a supported and detected Next.js mode, but this instruction always tells the agent to create an App Router `/sign-in` route. The new validation rule also accepts only `{,src/}app/sign-in/route.*`, so a correct Pages Router implementation is rejected and the installation fails, or the agent must add an unwanted App Router tree. Please make the prompt and validation depend on the detected router and support the equivalent Pages Router route.
**Knowledge Base Used:**
- [Application installation workflows](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/cli/-/docs/application-installation.md)
- [Installer orchestration and project mutation](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/cli/-/docs/installer-orchestration.md)
- [Agent and skills workflows](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/cli/-/docs/agent-and-skills-workflows.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| .join('\n')}`, | ||
| ); | ||
| } | ||
| applicationSetup = await configureAuthkitApplication(applicationSetup, credentials?.clientId ?? ''); |
There was a problem hiding this comment.
Credentials target different environments
The API key and Client ID are resolved independently and are never verified as a pair. For example, a run can combine an explicit API key with a project Client ID, or read the two values from different env files. The callback is then registered in the environment selected by the API key, while this call matches the Client ID through the dashboard session and can update a different sandbox application. This can distribute one installation's URL settings across two environments and add a callback to an unrelated application. Please verify the credential pair before either mutation or use one verified environment identity for all writes.
Knowledge Base Used:
- Application installation workflows
- Authentication and configuration lifecycle
- Configuration and environment management
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/lib/run-with-core.ts
Line: 394
Comment:
**Credentials target different environments**
The API key and Client ID are resolved independently and are never verified as a pair. For example, a run can combine an explicit API key with a project Client ID, or read the two values from different env files. The callback is then registered in the environment selected by the API key, while this call matches the Client ID through the dashboard session and can update a different sandbox application. This can distribute one installation's URL settings across two environments and add a callback to an unrelated application. Please verify the credential pair before either mutation or use one verified environment identity for all writes.
**Knowledge Base Used:**
- [Application installation workflows](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/cli/-/docs/application-installation.md)
- [Authentication and configuration lifecycle](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/cli/-/docs/authentication-and-configuration.md)
- [Configuration and environment management](https://app.greptile.com/workos/-/custom-context/knowledge-base/workos/cli/-/docs/configuration-and-environment-management.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
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
--no-validateso the installer does not configure a missing route.Verification
bun run test: 2,807 tests passed across 162 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.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.