Feat: add duplicate action to agent list (#14769)#14856
Conversation
|
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 (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a React Query-based ChangesAgent Duplication Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches⚔️ Resolve merge conflicts
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 `@web/src/hooks/use-agent-request.ts`:
- Around line 253-279: The mutationFn in useDuplicateAgent currently only shows
success and can fail silently; wrap the agentService.getAgent and
agentService.createAgent calls in a try/catch, explicitly check for missing
source (detail?.data) and non-success create responses (data?.code !== 0) and
call message.error with a translated error message (use i18n.t) in those
branches, ensure the catch logs the error and shows message.error, and return
null on failure so callers know the duplication failed; reference the
mutationFn, agentService.getAgent, agentService.createAgent, and
useDuplicateAgent when making the changes.
In `@web/src/locales/en.ts`:
- Line 2438: The translation key copyOfAgentName currently uses title case for
the parenthetical text; update the value of copyOfAgentName to use sentence case
by changing the parenthesis from '(Copy)' to '(copy)' so the string becomes
'{{name}} (copy)' to match the sentence case convention used in
src/locales/en.ts.
🪄 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: 593ce1ff-085b-42a3-ad3a-6cab5ab260f3
📒 Files selected for processing (4)
web/src/hooks/use-agent-request.tsweb/src/locales/en.tsweb/src/locales/zh.tsweb/src/pages/agents/agent-dropdown.tsx
closes #14769
What problem does this PR solve?
Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR.
Type of change