Skip to content

feat(portal): add clone action to agent list#505

Closed
sytone wants to merge 1 commit into
mainfrom
feat/agent-detail-clone
Closed

feat(portal): add clone action to agent list#505
sytone wants to merge 1 commit into
mainfrom
feat/agent-detail-clone

Conversation

@sytone
Copy link
Copy Markdown
Owner

@sytone sytone commented May 22, 2026

Closes #290

Changes

Agents.razor

  • Added 📋 Clone button to each row in the agents table (between Edit and Delete)
  • New CloneAgent(AgentRow) method:
    • _editingId = null — clone always creates a new agent (POST path)
    • AgentId cleared (editable, required)
    • DisplayName pre-filled as Copy of {source display name}
    • Description, ApiProvider, ModelId, SystemPrompt copied from source
    • _originalForm set with empty DisplayName so IsDirty = true — Save button immediately enabled
    • Loads provider models for the copied provider

Tests (4 new in AgentsPageTests.cs)

  • Clone_button_renders_in_agent_row — verifies agents-btn-clone class present in table row
  • Clone_button_opens_form_with_copy_display_name — DisplayName is Copy of Bot One
  • Clone_form_has_empty_agent_id_field — AgentId input is empty and not disabled
  • Clone_form_copies_provider_and_model — provider/model values preserved

341/341 BlazorClient tests pass.

Notes

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
Copy link
Copy Markdown
Owner Author

@sytone sytone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@sytone
Copy link
Copy Markdown
Owner Author

sytone commented May 22, 2026

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 SessionContextProjector, single-path routing. Many in-flight branches touch contracts that are about to change — rebasing later would be more work than rebuilding on the new shape.

If this work is still wanted, refile as a new issue/PR against the post-refactor contracts.

@sytone sytone closed this May 22, 2026
@sytone sytone deleted the feat/agent-detail-clone branch May 22, 2026 18:47
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.

[Portal][Agents] Expand agent editor to full AgentDefinitionConfig -- all fields, sections, clone action

1 participant