Restore global agent listing (#1420)

This commit is contained in:
Mohamed Boudra
2026-06-08 23:53:54 +08:00
committed by GitHub
parent a6d0046c97
commit b04ff0e6b8
3 changed files with 38 additions and 6 deletions
+29 -1
View File
@@ -23,11 +23,39 @@ describe("buildAgentLsFetchOptions", () => {
});
});
it("uses the unscoped archived query for -a", () => {
it("fetches global non-archived agents for -g", () => {
expect(buildAgentLsFetchOptions({ global: true })).toEqual({});
});
it("keeps -a within the active scope", () => {
expect(buildAgentLsFetchOptions({ all: true })).toEqual({
scope: "active",
filter: {
includeArchived: true,
},
});
});
it("fetches all global agents for -a -g", () => {
expect(buildAgentLsFetchOptions({ all: true, global: true })).toEqual({
filter: {
includeArchived: true,
},
});
});
it("applies filters to global queries", () => {
expect(
buildAgentLsFetchOptions({
global: true,
label: ["surface=workspace"],
thinking: " medium ",
}),
).toEqual({
filter: {
labels: { surface: "workspace" },
thinkingOptionId: "medium",
},
});
});
});