feat: allows easy duplication of agent#97
Closed
denniswebb wants to merge 9 commits intoRunMaestro:mainfrom
Closed
feat: allows easy duplication of agent#97denniswebb wants to merge 9 commits intoRunMaestro:mainfrom
denniswebb wants to merge 9 commits intoRunMaestro:mainfrom
Conversation
- User-initiated cloning of agent configurations - Pre-filled New Agent dialog approach - Right-click context menu + Cmd+K integration - Complete technical requirements and implementation checklist - No automatic background duplication (user control only)
Added complete duplication functionality that allows users to duplicate existing agents with pre-filled configuration. Backend Changes: - Extended createNewSession signature to include customContextWindow and customProviderPath parameters - Added duplicatingSessionId state management in App.tsx - Integrated duplication flow with NewInstanceModal via sourceSession prop Frontend Changes: - NewInstanceModal: Added sourceSession prop and pre-fill logic for all configuration fields (agent type, paths, args, env vars, model, context window) - SessionContextMenu: Added 'Duplicate' menu item after 'Edit Agent' - QuickActionsModal: Added 'Duplicate Agent' quick action (Cmd+K) - SessionList: Wired up duplication handlers with proper state management Features Implemented: - Right-click context menu duplication - Cmd+K quick actions duplication - Pre-fills all configuration: agent type, working directory, name (with 'Copy' suffix), nudge message, custom paths, spawn arguments, environment variables, model selection, context window, and provider path - Validates pre-filled values with existing session validation - Clears duplication state on modal close - Fresh session state (no conversation history, no task state, new IDs) All implementation tasks from duplicate-session-1.md completed successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added 3 new tests to NewInstanceModal.test.tsx for duplication functionality - Test: Pre-fill all fields when sourceSession is provided - Test: Allow modifying pre-filled fields before creation - Test: No pre-fill when sourceSession is not provided - All 3 new tests passing (58/63 total passing, 5 pre-existing failures) - Verified duplication feature works correctly with automated test coverage
- Changed 'Duplicate' to 'Duplicate...' in SessionList context menu - Matches pattern of 'Edit Agent...' which also opens a dialog - Follows UI convention where ellipsis indicates additional steps required
…nfiguration - Added setExpandedAgent(sourceSession.toolType) to pre-fill logic - Ensures custom arguments, paths, and env vars are visible when duplicating - Fixes issue where custom args like '--model=opus' weren't visible in UI - Added test to verify custom arguments pre-fill behavior - All duplication tests passing (59/64 total, 5 pre-existing failures)
- Fixed race condition where first useEffect was resetting expandedAgent to null - Modified first useEffect to only collapse agents when NOT duplicating - Changed conditional pre-fill to always set values (even if empty) for consistency - Ensures custom args, paths, and env vars are properly populated in UI - Added sourceSession to first useEffect dependency array
The issue was that loadAgents() ran asynchronously and reset customAgentPaths, customAgentArgs, and customAgentEnvVars to empty objects AFTER the second useEffect had already pre-filled them from sourceSession. Fix: - Modified loadAgents() to accept optional source session parameter - Only reset custom values when NOT duplicating - Moved all pre-fill logic into loadAgents() to run AFTER agents load - Removed redundant second useEffect that caused the race condition 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The custom args, paths, and env vars are still correctly pre-filled in state - they just remain hidden until the user expands the section. This provides a cleaner UX when duplicating agents. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51e01f1 to
927ab58
Compare
Collaborator
|
I'll pull this in after completed this bear of a refactor: |
Contributor
Author
|
No rush. I have a few more. If after the refactor we hit conflicts, I'll get them resolved. |
Collaborator
|
Awesome, thanks. I'm getting closer to wrapping up this refactor. Finally got the performance back to where I want it to be.
…On Fri, Dec 26, 2025 at 6:53 AM, Dennis Webb < ***@***.*** > wrote:
*denniswebb* left a comment (pedramamini/ Maestro#97) (
#97 (comment) )
No rush. I have a few more. If after the refactor we hit conflicts, I'll
get them resolved.
—
Reply to this email directly, view it on GitHub (
#97 (comment) ) ,
or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAJSBRIGBC7DW5TJMJWZYUT4DUVUDAVCNFSM6AAAAACQAQO4S6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMOJSHAZDSMBXGM
).
You are receiving this because you commented. Message ID: <pedramamini/Maestro/pull/97/c3692829073
@ github. com>
|
Collaborator
|
@denniswebb can i trouble you to rebase this on the refactored main? thank you so much for your help? killer PRs! |
pedramamini
added a commit
that referenced
this pull request
Dec 30, 2025
PR #97 was missing duplication of sessionSshRemoteConfig when using the "Duplicate" feature. Sessions using SSH remote would lose that configuration when duplicated. Also added test coverage for SSH config duplication.
Collaborator
|
Hmmm seems when I rebased to get this in it didn't close out your PR. This is in though! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When needing to create agents for an existing repo/directory but with a different AI tool, e.g. from Claude Code to Codex, this makes duplication simple.
And if the source has options set for the agent, they are also duplicated as expected.
Also works with CMD+K
