Skip to content

Commit bbc9c21

Browse files
Jasmine ZhangJasmine Zhang
authored andcommitted
fix(workboard): let gateway resolve dispatch scopes
1 parent 46a3442 commit bbc9c21

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

extensions/workboard/src/cli.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ describe("registerWorkboardCli", () => {
143143
expect(after?.metadata?.automation?.dispatchCount).toBeUndefined();
144144
});
145145

146+
it("lets gateway runtime choose dispatch scopes", async () => {
147+
const store = new WorkboardStore(createMemoryStore());
148+
const program = createProgram(store);
149+
gatewayRuntime.callGatewayFromCli.mockResolvedValueOnce({
150+
started: [],
151+
startFailures: [],
152+
});
153+
154+
await program.parseAsync(["workboard", "dispatch"], { from: "user" });
155+
156+
expect(gatewayRuntime.callGatewayFromCli).toHaveBeenCalledWith(
157+
"workboard.cards.dispatch",
158+
expect.objectContaining({ json: false }),
159+
{ boardId: undefined },
160+
{ mode: "cli" },
161+
);
162+
});
163+
146164
it("rejects ambiguous card id prefixes", async () => {
147165
const store = new WorkboardStore(createMemoryStore());
148166
const prefix = await createAmbiguousPrefix(store);

extensions/workboard/src/cli.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ async function callWorkboardGateway(
8888
): Promise<unknown> {
8989
return await callGatewayFromCli(method, options, params, {
9090
mode: "cli",
91-
scopes: ["operator.write", "operator.read"],
9291
});
9392
}
9493

0 commit comments

Comments
 (0)