Skip to content

fix(desktop): align team agent deletion feedback - #4740

Open
SmithLabsLLC wants to merge 1 commit into
block:mainfrom
SmithLabsLLC:fix/team-agent-delete-feedback
Open

fix(desktop): align team agent deletion feedback#4740
SmithLabsLLC wants to merge 1 commit into
block:mainfrom
SmithLabsLLC:fix/team-agent-delete-feedback

Conversation

@SmithLabsLLC

@SmithLabsLLC SmithLabsLLC commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • Block deletion of managed-agent instances while their persona is still in an agent team.
  • Show the same actionable team-membership error from the agent card and profile settings.
  • Check team membership before provider shutdown and enforce it again at the backend boundary.
  • Clarify the cleanup order when a team cannot be deleted because instances still reference it.

Problem

Deleting a running built-in agent from the card could report only that it was assigned to a managed agent, even when team membership was the blocker. Deleting the same agent from profile settings could then show a success toast while the team kept the persona visible.

Implementation

  • Prioritize the team-membership guard for persona removal.
  • Fresh-load teams before either frontend managed-agent deletion path.
  • Reject managed-agent deletion under the backend store lock before process, key, archive, or provider cleanup.
  • Keep deletion available after the persona has been removed from all current teams.

Manual test

  1. Add a running agent to a team.
  2. Try Delete from the agent card's three-dot menu.
  3. Confirm the toast says to remove the agent from every team first.
  4. Open the agent profile, use the settings gear, and confirm deletion.
  5. Confirm the same error appears, no success toast appears, and the agent still exists.
  6. Remove the persona from all teams and confirm managed-agent deletion works normally.

Testing

  • Rust persona validation tests: 8 passed
  • Rust managed-agent deletion tests: 2 passed
  • Rust team deletion message test: 1 passed
  • Managed-agent control action tests: 7 passed
  • TypeScript type-check and E2E production build: passed
  • Playwright regression covering both deletion entry points: passed
  • Focused Biome, Rust formatting, file-size, pixel-text, public-key truncation, and diff checks: passed

The full repository-wide just ci release suite was not run locally; focused change-specific checks passed and upstream CI will run on this reviewed commit.

Screenshots

Agent card

Before: the card reports only the managed-agent assignment.

before-card

After: the card reports the current team membership and required cleanup.

after-card

Profile settings

Before: profile deletion reports success even though the team keeps the persona visible.

before-profile

After: profile deletion reports the same team-membership blocker and leaves the agent intact.

after-profile

Related work

No exact duplicate issue or pull request was found. Issues #4591 and #3085 discuss related team cleanup problems but not this two-entry-point deletion inconsistency.

Deferred

  • The pre-existing retired-persona edge case is outside this focused fix.
  • Internal error-string deduplication can be handled separately if the message becomes a broader API contract.

Signed-off-by: Smith Labs LLC <232409717+SmithLabsLLC@users.noreply.github.com>
@SmithLabsLLC
SmithLabsLLC requested a review from a team as a code owner August 4, 2026 16:08
@SmithLabsLLC

Copy link
Copy Markdown
Author

Before and after screenshots

Agent card

Before: the card reports only the managed-agent assignment.

before-card

After: the card reports the current team membership and required cleanup.

after-card

Profile settings

Before: profile deletion reports success even though the team keeps the persona visible.

before-profile

After: profile deletion reports the same team-membership blocker and leaves the agent intact.

after-profile

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