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:
@@ -153,6 +153,22 @@ describe("fn pi extension tool copy guardrails", () => {
|
||||
expect(guidelines).toMatch(/soft.?delete/i);
|
||||
expect(guidelines).not.toMatch(/permanent|cannot be recovered|cannot be undone|deleted immediately|irrecoverable/i);
|
||||
});
|
||||
|
||||
it("describes fn_agent_stop as allowing error-state agents to be paused (FN-6018)", () => {
|
||||
const api = createMockAPI();
|
||||
kbExtension(api);
|
||||
|
||||
const tool = api.tools.get("fn_agent_stop") as
|
||||
| { description?: string; promptGuidelines?: string[] }
|
||||
| undefined;
|
||||
|
||||
expect(tool).toBeDefined();
|
||||
|
||||
const guidelines = (tool?.promptGuidelines ?? []).join(" ");
|
||||
expect(guidelines).toMatch(/running, active, or in error/i);
|
||||
expect(guidelines).toMatch(/idle.*already-paused/i);
|
||||
expect(guidelines).not.toMatch(/idle, 'error', or already-paused/i);
|
||||
});
|
||||
});
|
||||
|
||||
// Audited in FN-3189: this exhaustive suite is expensive (~62s) and stale
|
||||
|
||||
@@ -3592,9 +3592,9 @@ export default function kbExtension(pi: ExtensionAPI) {
|
||||
"Transitions the agent from running/active to paused state.",
|
||||
promptSnippet: "Stop (pause) a running Fusion agent",
|
||||
promptGuidelines: [
|
||||
"Use to pause an agent that is currently running or active",
|
||||
"Use to pause an agent that is currently running, active, or in error",
|
||||
"Stopped agents can be resumed with fn_agent_start",
|
||||
"Agents in 'idle', 'error', or already-paused state cannot be stopped",
|
||||
"Agents in 'idle' or already-paused state cannot be stopped",
|
||||
],
|
||||
parameters: Type.Object({
|
||||
id: Type.String({ description: "Agent ID to stop (e.g., agent-abc123)" }),
|
||||
|
||||
Reference in New Issue
Block a user