feat(portal): add clone action to agent list#505
Conversation
Adds a Clone button to each agent row in the Agents management page.
Clicking Clone opens the add form pre-populated from the source agent
with AgentId cleared (editable) and DisplayName set to 'Copy of {name}'.
Provider, Model, Description, and SystemPrompt are all copied across.
isDirty is forced true so the Save button is immediately enabled.
4 new bunit tests; 341/341 pass.
Closes #290
sytone
left a comment
There was a problem hiding this comment.
Farnsworth Review — PR #505
CI: ✅ All checks passing (build-and-test, CodeQL, CodePatterns, TruffleHog)
Merge conflicts: ✅ Clean (MERGEABLE)
Conventional commit title: ✅ feat(portal): add clone action to agent list
Test coverage:
- ✅ Clone button renders in table row
- ✅ DisplayName pre-filled as
Copy of {source} - ✅ AgentId cleared (editable, not disabled)
- ✅ Provider and model preserved
- 341/341 BlazorClient tests pass
Spec completeness vs #290: Implements the Clone action. Remaining #290 scope (Soul, Access Controls, Runtime, Tool Policy sections) is correctly deferred pending #494 (AgentDetailPanel) merge.
Notes: Clean, minimal implementation. _originalForm set with empty DisplayName forces IsDirty=true immediately — correct behaviour for clone-to-create path.
LGTM. Ready to merge.
|
Closing as part of a planned hard-reset of the in-flight branch set so the new domain-model refactor can land on a clean trunk. Audit verdict: keep Rationale: Portal/UI. The new plan (in session state) reshapes core types: Citizen (User+Agent union), Vogen-generated value objects, ThreadId removed in favour of composite ChannelAddress, mark-not-delete compaction, centralised If this work is still wanted, refile as a new issue/PR against the post-refactor contracts. |
Closes #290
Changes
Agents.razorCloneAgent(AgentRow)method:_editingId = null— clone always creates a new agent (POST path)AgentIdcleared (editable, required)DisplayNamepre-filled asCopy of {source display name}Description,ApiProvider,ModelId,SystemPromptcopied from source_originalFormset with empty DisplayName soIsDirty = true— Save button immediately enabledTests (4 new in
AgentsPageTests.cs)Clone_button_renders_in_agent_row— verifiesagents-btn-cloneclass present in table rowClone_button_opens_form_with_copy_display_name— DisplayName isCopy of Bot OneClone_form_has_empty_agent_id_field— AgentId input is empty and not disabledClone_form_copies_provider_and_model— provider/model values preserved341/341 BlazorClient tests pass.
Notes