From e5dbfde7e1230dfc58069c57c7ec1826e24cc4c6 Mon Sep 17 00:00:00 2001 From: Marcus Castro Date: Tue, 10 Feb 2026 12:17:26 -0300 Subject: [PATCH] test(cron): add empty-skills edge case for skill filter coverage Addresses Greptile review feedback: locks in behavior when an agent has skills: [] (explicit empty list), ensuring skillFilter: [] is forwarded to buildWorkspaceSkillSnapshot to filter out all skills. --- .../isolated-agent/run.skill-filter.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/cron/isolated-agent/run.skill-filter.test.ts b/src/cron/isolated-agent/run.skill-filter.test.ts index 6463e4fe818..58444cab38d 100644 --- a/src/cron/isolated-agent/run.skill-filter.test.ts +++ b/src/cron/isolated-agent/run.skill-filter.test.ts @@ -253,4 +253,22 @@ describe("runCronIsolatedAgentTurn — skill filter", () => { // When no skills config, skillFilter should be undefined (no filtering applied) expect(buildWorkspaceSkillSnapshotMock.mock.calls[0][1].skillFilter).toBeUndefined(); }); + + it("passes empty skillFilter when agent explicitly disables all skills", async () => { + resolveAgentSkillsFilterMock.mockReturnValue([]); + + const { runCronIsolatedAgentTurn } = await import("./run.js"); + + const result = await runCronIsolatedAgentTurn( + makeParams({ + cfg: { agents: { list: [{ id: "silent", skills: [] }] } }, + agentId: "silent", + }), + ); + + expect(result.status).toBe("ok"); + expect(buildWorkspaceSkillSnapshotMock).toHaveBeenCalledOnce(); + // Explicit empty skills list should forward [] to filter out all skills + expect(buildWorkspaceSkillSnapshotMock.mock.calls[0][1]).toHaveProperty("skillFilter", []); + }); });