Repository navigation
feat(studio): L10 duplicate an agent from the detail menu - #1083
Merged
Merged
Conversation
POST /agents { from: { copyOf } } now routes through
server/lifecycle/copy.ts: resolveNextCopyId picks <id>-copy,
<id>-copy-2, ...; the spec is cloned and renamed '<name> copy'
(or body.name), labels and canvas layout copy (sticky notes get
fresh ids), meta is enabled:false with createdFrom copy
provenance, and exactly one kind:'create' version is captured -
versions, drafts, suggestions, traces and sidecars are not
copied. The menu's Duplicate item calls runtimeClient.
duplicateAgent, toasts 'Made a copy: ...' and opens the copy's
canvas. The now-dead copyAgentId helper is removed; copy ids
share lifecycle/agentIds.ts resolveNextCopyId.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
POST /agents { from: { copyOf } }now routes throughserver/lifecycle/copy.ts:resolveNextCopyIdpicks<id>-copy,<id>-copy-2, …; the spec isstructuredCloned and renamed<name> copy(orbody.name, ≤64 chars); labels and canvas layout copy with fresh sticky-note ids; meta isenabled: falsewithcreatedFrom: { kind: 'copy', ref },publishedVersion: null,failureStreak: 0; exactly onekind: 'create'version is captured. Versions, drafts, suggestions, traces, chats, approvals and checkpoints are not copied.runtimeClient.duplicateAgent(agentId)posts the copy request; the header overflow menu's Duplicate item calls it, toastsMade a copy: <name>. It is off until you turn it on.and navigates to the copy's canvas.copyAgentIdhelper — copy ids sharelifecycle/agentIds.tsresolveNextCopyId(spec-file-or-sidecar-dir rule).Test plan
server/__tests__/copyAgent.test.ts— naming sequence, spec/labels/layout copy, meta rules, one version, no copied folders, 404server/__tests__/agentRoutes.create.test.ts+storage/__tests__/agentIds.test.tsupdatedsrc/screens/agentDetail/__tests__/duplicateMenu.test.tsx+ updatedAgentActionsMenu.test.tsxidleVersionsdebounce flake, passes in isolation), client suite 4001 green, typechecks + e2e tsc clean, fallow cleanGenerated with Devin