Skip to content

feat(ui): add agent deletion controls - #430

Open
jayesh9747 wants to merge 2 commits into
truefoundry:mainfrom
jayesh9747:feat/agent-library-delete
Open

feat(ui): add agent deletion controls#430
jayesh9747 wants to merge 2 commits into
truefoundry:mainfrom
jayesh9747:feat/agent-library-delete

Conversation

@jayesh9747

@jayesh9747 jayesh9747 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #429

Changes

  • Add a delete action and confirmation dialog to each Agents Library row when the server exposes deleteAgent.
  • Preserve existing chats while clearing stale active-agent and history-filter state after deletion.
  • Wire the bundled TrueForge adapter to the existing agents list and DELETE /api/v1/agents/{agent_id} SDK routes.
  • Keep custom servers capability-safe by omitting deleteAgent when no callback is provided.
  • Add the required UI package changeset and update the server-contract documentation.

How was this tested?

  • pnpm test:trueforge-ui — 130 test files / 847 tests passed, including package build and export smoke tests.
  • pnpm --filter @truefoundry/trueforge-ui typecheck
  • pnpm --filter @truefoundry/trueforge-ui lint
  • pnpm format:check

Checklist

  • Tests added for success, cancellation, failure, unsupported hosts, adapter routing, and idempotency.
  • No hand-edits to generated OpenAPI or SDK code.
  • Documentation and changeset updated.

Note

Medium Risk
Deletes are destructive and touch shell navigation state after removal; behavior is gated on optional server support and covered by tests, but wrong adapter logic could remove the wrong backend resource.

Overview
Adds agent deletion to the Agents Library when the host server exposes deleteAgent: a trash action per row, a confirmation dialog, success/error feedback, and a list refresh via invalidateAgentsList. After a successful delete, the UI clears a matching history filter and navigates away if the deleted agent was active (draft or library home depending on composer mode).

createTrueFoundryServer no longer installs a stub that throws when deleteAgent is omitted—it only attaches the method when a callback is provided, matching custom-server behavior where missing optional ports hide controls instead of failing at runtime.

The bundled TrueForge builder adapter implements deleteAgent by resolving the agent id from the list API and calling DELETE /api/v1/agents/{id} (no-op if the name is already gone). Docs and the BYO checklist now state that deleteAgent is invoked from the library when present.

Reviewed by Cursor Bugbot for commit 44c4a65. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 44c4a65

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@truefoundry/trueforge-ui Minor
frontend Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 041b993. Configure here.

Comment thread packages/trueforge-ui/src/atoms/AgentsLibrary.tsx Outdated
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.

Add delete controls for saved agents in the Agents Library

1 participant