feat(dashboard): clone profiles from any source

This commit is contained in:
WompaJango 2026-06-13 06:37:06 -07:00 committed by Teknium
parent 3380563d94
commit 28bf8fb47d
31 changed files with 182 additions and 105 deletions

View file

@ -8518,15 +8518,13 @@ async def scan_skill_hub(identifier: str = ""):
class ProfileCreate(BaseModel):
name: str
clone_from: Optional[str] = None
# Backward compatibility for older dashboard/desktop clients. New clients
# send clone_from="default" (or another profile name) explicitly.
clone_from_default: bool = False
clone_all: bool = False
no_skills: bool = False
description: Optional[str] = None
# Explicit source profile to clone from (e.g. duplicating an existing
# profile). When set, it takes precedence over ``clone_from_default``,
# which always sources from "default". ``clone_all`` still selects a full
# state copytree vs. a config/skills/SOUL copy.
clone_from: Optional[str] = None
provider: Optional[str] = None
model: Optional[str] = None
# Profile-builder additions — all optional, all applied best-effort AFTER
@ -8798,10 +8796,16 @@ async def create_profile_endpoint(body: ProfileCreate):
clone = True
clone_from = explicit_source
clone_config = not body.clone_all
elif body.clone_all:
# Preserve the dashboard's historical clone-all behavior: a full-copy
# request with no explicit dropdown source copies from default.
clone = True
clone_from = "default"
clone_config = False
else:
clone = body.clone_from_default or body.clone_all
clone = body.clone_from_default
clone_from = "default" if clone else None
clone_config = body.clone_from_default and not body.clone_all
clone_config = clone
try:
path = profiles_mod.create_profile(
name=body.name,