chore(dashboard): reuse existing claude creds when migrating demo agent fixes NV-7856#11343
Conversation
|
PR author is not in the allowed authors list. |
✅ Deploy Preview for dashboard-v2-novu-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an IntegrationDropdown component, widens GenerationStatus step labels to ReactNode, and refactors DemoClaudeUpgradePanel to support selecting an existing Anthropic integration or creating inline credentials before migrating demo agents. ChangesAgent Anthropic Integration and Upgrade Flow
Sequence Diagram(s)sequenceDiagram
participant User
participant DemoUpgradePanel
participant IntegrationDropdown
participant MigrationService
User->>DemoUpgradePanel: Open dialog
DemoUpgradePanel->>DemoUpgradePanel: Load real Anthropic integrations
alt Has real integrations
DemoUpgradePanel->>DemoUpgradePanel: Auto-select latest
DemoUpgradePanel->>IntegrationDropdown: Display dropdown with selection
User->>IntegrationDropdown: (Optional) change selection
IntegrationDropdown->>DemoUpgradePanel: onSelectIntegration()
else No real integrations
DemoUpgradePanel->>DemoUpgradePanel: Show inline credentials form
User->>DemoUpgradePanel: Enter API key & workspace
end
User->>DemoUpgradePanel: Click "Setup agent"
alt Path A: Reuse selected integration
DemoUpgradePanel->>MigrationService: Migrate with selected integration id
else Path B: Inline credentials
DemoUpgradePanel->>MigrationService: Verify credentials, create AGENT integration
MigrationService->>DemoUpgradePanel: Return new integration id
DemoUpgradePanel->>MigrationService: Migrate with new integration id
end
MigrationService->>User: Migration complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@apps/dashboard/src/components/agents/demo-claude-upgrade-panel.tsx`:
- Around line 262-266: The current isBusy variable combines
upgradeMutation.isPending and verifyMutation.isPending which causes the
migration UI (GenerationStatus and primary CTA loading) to show when only
verification is running; change the logic so migration-related UI uses only
upgradeMutation.isPending (e.g., create a migrationBusy or use
upgradeMutation.isPending directly) while verification continues to
independently disable form controls via verifyMutation.isPending; update
references to isBusy (and canMigrate/dropdownStatus if they rely on it) so
verifyMutation.isPending no longer drives migration progress UI—apply the same
separation in the similar block around the code handling lines 375-389 and keep
identifiers upgradeMutation, verifyMutation, isBusy, canMigrate,
isSetupCredentialsReady, dropdownStatusFor, verifyStatus, and
hasUsableSelectedIntegration in mind when locating the changes.
- Around line 56-57: The effect that opens the demo upgrade dialog is treating
an empty realAnthropicIntegrations as "no creds" even while
useFetchIntegrations() is still loading; update the logic in the open effect
(the useEffect that reads integrations/realAnthropicIntegrations and sets
credentialsPanelVisible) to first check the fetch's loaded flag (e.g.,
isLoading/isFetched/status from useFetchIntegrations) and only decide to show
the inline setup when integrations have finished loading; additionally add a
loading state/UI while integrations are pending and make the same loaded-check
change for the related branch handling lines ~102-117 so existing Anthropic
credentials can be auto-selected once the query resolves.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4b279335-fea2-4aae-a402-7282518c277c
📒 Files selected for processing (3)
apps/dashboard/src/components/agents/connectors/integration-dropdown.tsxapps/dashboard/src/components/agents/demo-claude-upgrade-panel.tsxapps/dashboard/src/components/onboarding/connect-agent/generation-status.tsx
|
Actionable comments posted: 0 |
What changed? Why was the change needed?
Agents - Reuse existing Claude credentials when migrating an agent that used demo creds.
What changed
When migrating agents that previously used demo Claude (Anthropic) credentials, the UI now prefers reusing an existing real Anthropic integration instead of creating new demo/duplicate creds. A new IntegrationDropdown lets users pick a non-demo Anthropic integration; the DemoClaudeUpgradePanel then either migrates the agent using the selected integration ID or validates inline credentials, creates a new active AGENT integration, and migrates with that ID. This prevents credential duplication and simplifies migrating demo agents to users' own Anthropic accounts.
Affected areas
dashboard: Added an IntegrationDropdown component to list and select existing (non-demo) integrations; updated DemoClaudeUpgradePanel to support two migration flows (reuse selected integration or create-from-inline credentials), adjusted dialog copy/flow and CTA labels, and added status/validation UI. Also broadened GenerationStep.text to ReactNode to allow richer onboarding status labels.
Key technical decisions
Testing
No automated tests were added; manual verification is required for integration selection, credential validation, both migration paths, and the updated dialog flow.
Screenshots
Screen.Recording.2026-05-28.at.18.05.57.mov
Screen.Recording.2026-05-28.at.18.25.35.mov