FN-6018: allow stopping and deleting failed agents

Let failed agents be stopped and deleted consistently across the dashboard and agent lifecycle.

- allow agents in the error state to transition to paused and cover the new lifecycle path in core tests
- expose delete controls for failed agents in the agents list and mobile detail view with dashboard regression coverage
- update CLI stop-tool guidance and add a patch changeset for the published package

Files changed:
 .changeset/fn-6018-agent-error-stop-delete.md      |  7 ++++
 packages/cli/src/__tests__/extension.test.ts       | 16 ++++++++
 packages/cli/src/extension.ts                      |  4 +-
 packages/core/src/__tests__/agent-store.test.ts    | 16 ++++++++
 packages/core/src/types.ts                         |  2 +-
 .../dashboard/app/components/AgentDetailView.tsx   |  4 ++
 packages/dashboard/app/components/AgentsView.tsx   |  2 +-
 .../__tests__/AgentDetailView.core.test.tsx        | 24 +++++++++++-
 .../app/components/__tests__/AgentsView.test.tsx   | 44 +++++++++++++++++++++-
 9 files changed, 112 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6018

Fusion-Task-Lineage: 40159b9b-4d14-4f1e-9bd9-d018e54db7ee
This commit is contained in:
gsxdsm
2026-06-08 09:33:29 -07:00
parent 84330f7dc9
commit 60eb2ec995
9 changed files with 112 additions and 7 deletions

View File

@@ -1669,6 +1669,22 @@ describe("AgentStore", () => {
expect(updated.state).toBe("active");
});
it("error → paused transition succeeds", async () => {
const agent = await createReadyAgent(store, "ErrorToPaused");
await store.updateAgentState(agent.id, "active");
await store.updateAgentState(agent.id, "error");
const updated = await store.updateAgentState(agent.id, "paused");
expect(updated.state).toBe("paused");
});
it("error → idle transition succeeds", async () => {
const agent = await createReadyAgent(store, "ErrorToIdle");
await store.updateAgentState(agent.id, "active");
await store.updateAgentState(agent.id, "error");
const updated = await store.updateAgentState(agent.id, "idle");
expect(updated.state).toBe("idle");
});
it("rejects active → terminated transition", async () => {
const agent = await createReadyAgent(store, "ActiveToTerminated");
await store.updateAgentState(agent.id, "active");

View File

@@ -5501,7 +5501,7 @@ export const AGENT_VALID_TRANSITIONS: Record<AgentState, AgentState[]> = {
active: ["idle", "running", "paused", "error"],
running: ["idle", "active", "paused", "error"],
paused: ["idle", "active"],
error: ["idle", "active"],
error: ["idle", "active", "paused"],
};
/**