Skip to content

feat(studio): L10 duplicate an agent from the detail menu - #1083

Merged
LinuxDevil merged 1 commit into
mainfrom
fb-l10-duplicate
Nov 12, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
fb-l10-duplicate

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • POST /agents { from: { copyOf } } now routes through server/lifecycle/copy.ts: resolveNextCopyId picks <id>-copy, <id>-copy-2, …; the spec is structuredCloned and renamed <name> copy (or body.name, ≤64 chars); labels and canvas layout copy with fresh sticky-note ids; meta is enabled: false with createdFrom: { kind: 'copy', ref }, publishedVersion: null, failureStreak: 0; exactly one kind: '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, toasts Made a copy: <name>. It is off until you turn it on. and navigates to the copy's canvas.
  • Removed the dead copyAgentId helper — copy ids share lifecycle/agentIds.ts resolveNextCopyId (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, 404
  • server/__tests__/agentRoutes.create.test.ts + storage/__tests__/agentIds.test.ts updated
  • src/screens/agentDetail/__tests__/duplicateMenu.test.tsx + updated AgentActionsMenu.test.tsx
  • Server suite 1577/1578 (one known idleVersions debounce flake, passes in isolation), client suite 4001 green, typechecks + e2e tsc clean, fallow clean

Generated with Devin

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>
@LinuxDevil
LinuxDevil merged commit b51e74d into main Nov 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant