fix(install): repair Auth0 and project setup flow - #24
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds Auth0 organization handling, refactors internal API routing between proxy and management URLs, updates agent handoff execve lookup behavior, and bumps the package version. ChangesAuth0 Organization ID
Internal API Client Routing
Agent Handoff Execve Gating
Package Version
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/lib/auth/__tests__/pkce-flow.test.ts (1)
49-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider adding a negative test for the omitted
organizationparam.Existing tests only cover the case where
organizationIdis set. Add a case assertingorganizationis absent from the authorization URL whenorganizationIdis not configured, to guard the conditional inpkce-flow.ts(Line 75-78) against future regressions.✅ Suggested additional test
+ test('omits organization from authorization URL when not configured', async () => { + const service = new PKCEFlowService({ + domain: 'example.auth0.com', + clientId: 'client-id', + audience: 'https://example.auth0.com/api/v2/', + scope: 'openid profile email offline_access', + }); + + try { + const { authUrl } = await service.startAuthFlow(); + expect(new URL(authUrl).searchParams.has('organization')).toBe(false); + } finally { + service.abort(); + } + });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lib/auth/__tests__/pkce-flow.test.ts` around lines 49 - 64, Add a negative test for PKCEFlowService authorization URL generation to verify the conditional organization parameter handling. Extend the existing pkce-flow test suite with a case that creates PKCEFlowService without organizationId, calls startAuthFlow(), and asserts that new URL(authUrl).searchParams does not contain organization. Use PKCEFlowService and startAuthFlow as the key symbols so the test guards the conditional in pkce-flow.ts against regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/lib/auth/__tests__/pkce-flow.test.ts`:
- Around line 49-64: Add a negative test for PKCEFlowService authorization URL
generation to verify the conditional organization parameter handling. Extend the
existing pkce-flow test suite with a case that creates PKCEFlowService without
organizationId, calls startAuthFlow(), and asserts that new
URL(authUrl).searchParams does not contain organization. Use PKCEFlowService and
startAuthFlow as the key symbols so the test guards the conditional in
pkce-flow.ts against regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2c7f8a88-e0ea-4a81-9fcc-bb9c0ded52be
📒 Files selected for processing (4)
src/lib/auth/__tests__/pkce-flow.test.tssrc/lib/auth/config.tssrc/lib/auth/pkce-flow.tssrc/lib/auth/types.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/api/internal-client.ts`:
- Line 7: The management API URL is still hardcoded to the production default,
which can diverge from the Console environment used by getInternalApiClient().
Update the internal client configuration so managementBaseUrl is derived from
the same environment override as CONSOLE_URL, or is explicitly plumbed through
config at the same call sites; use the existing getInternalApiClient and
DEFAULT_MANAGEMENT_API_URL symbols to locate the fallback and replace it with
the matching environment-aware value.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 3e2f7b08-1c87-421e-acf2-db84ac927191
📒 Files selected for processing (2)
src/lib/api/__tests__/internal-client.test.tssrc/lib/api/internal-client.ts
Summary
Fixes
clix installauthentication and project setup failures in production.Details
The bundled production Auth0 client now includes the required Clix organization ID in the PKCE authorization URL, so Auth0 no longer rejects CLI login with
parameter organization is required for this client.Project setup now reads member, organization, and organization project data directly from
https://management-api.clix.so, matching the backend split where management routes moved out ofinternal-api.Runtime project APIs, including project details and sender config updates, still use the existing Console internal API proxy so runtime setup behavior is unchanged.
Also fixes a CI-only handoff test failure by avoiding
process.execvewhen tests inject a fake spawner, and bumps the package version to1.1.3for release.Related Issues
N/A
How to Validate
bun run build.bun run check.bun test.bun test src/lib/auth/__tests__/pkce-flow.test.ts src/lib/api/__tests__/internal-client.test.ts src/lib/services/__tests__/organization-projects.test.ts src/lib/services/__tests__/agent-handoff.test.ts.bun run install:localand confirmclix --versionprints1.1.3.samples/BasicApp, runDEBUG=projects-fetch clix installand confirm it reaches the project selection screen.Pre-Merge Checklist
Code Quality
bun run build)bun run typecheck)bun run lint)bun test)Documentation
Commit Standards
Platform Validation
Summary by CodeRabbit
New Features
Bug Fixes
Chores