Default agent ls to active scope

This commit is contained in:
Mohamed Boudra
2026-04-22 12:52:52 +07:00
parent fc86ce2a5f
commit 9a39ba4be0
2 changed files with 80 additions and 32 deletions
@@ -0,0 +1,33 @@
import { describe, expect, it } from "vitest";
import { buildAgentLsFetchOptions } from "./ls.js";
describe("buildAgentLsFetchOptions", () => {
it("fetches active agents by default", () => {
expect(buildAgentLsFetchOptions({})).toEqual({
scope: "active",
});
});
it("keeps label and thinking filters within the active scope", () => {
expect(
buildAgentLsFetchOptions({
label: ["surface=workspace"],
thinking: " medium ",
}),
).toEqual({
scope: "active",
filter: {
labels: { surface: "workspace" },
thinkingOptionId: "medium",
},
});
});
it("uses the unscoped archived query for -a", () => {
expect(buildAgentLsFetchOptions({ all: true })).toEqual({
filter: {
includeArchived: true,
},
});
});
});