From cce7c0d469112f90fa73aaae60d4773aa802456c Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 3 Jun 2026 14:45:15 -0700 Subject: [PATCH] Address PR review feedback (#1362) - Cover the non-dry-run import warning path with a test (greptile P2): the warning is spread into both the dryRun and persist responses but was only exercised via dryRun. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/__tests__/routes-agent-import.test.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/packages/dashboard/src/__tests__/routes-agent-import.test.ts b/packages/dashboard/src/__tests__/routes-agent-import.test.ts index 1f12bf6382..82f9997ff4 100644 --- a/packages/dashboard/src/__tests__/routes-agent-import.test.ts +++ b/packages/dashboard/src/__tests__/routes-agent-import.test.ts @@ -384,6 +384,23 @@ describe("POST /api/agents/import", () => { expect(body.warnings[0]).toContain("executor"); }); + it("includes the custom-role warning on a live (non-dry-run) import too (issue #1261)", async () => { + mockListAgents.mockResolvedValue([]); + + const response = await postImport(app, { + manifest: "---\nname: YAML Agent\n---\nInstructions", + }); + + expect(response.status).toBe(200); + const body = response.body as any; + // Live import actually persists the agent... + expect(body.created).toHaveLength(1); + // ...and still surfaces the warning (the path the dry-run test can't cover). + expect(Array.isArray(body.warnings)).toBe(true); + expect(body.warnings[0]).toContain("custom"); + expect(body.warnings[0]).toContain("executor"); + }); + it("does not warn when an eligible executor agent already exists", async () => { mockListAgents.mockResolvedValue([ { id: "exec-1", name: "Executor", role: "executor", state: "idle", metadata: {} },