From a5aceebc01937d092111c725a4a1d4924dcac63d Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 12 Apr 2026 18:20:39 +0100 Subject: [PATCH] test(gateway): share bearer agents list invoke --- src/gateway/tools-invoke-http.test.ts | 43 +++++++++++---------------- 1 file changed, 17 insertions(+), 26 deletions(-) diff --git a/src/gateway/tools-invoke-http.test.ts b/src/gateway/tools-invoke-http.test.ts index d231b7770ab..4a56a92006a 100644 --- a/src/gateway/tools-invoke-http.test.ts +++ b/src/gateway/tools-invoke-http.test.ts @@ -337,6 +337,21 @@ const invokeAgentsListAuthed = async (params: { sessionKey?: string } = {}) => sessionKey: params.sessionKey, }); +const invokeAgentsListBearer = async () => + await postToolsInvoke({ + port: sharedPort, + headers: { + authorization: "Bearer secret", + "content-type": "application/json", + }, + body: { + tool: "agents_list", + action: "json", + args: {}, + sessionKey: "main", + }, + }); + const invokeToolAuthed = async (params: { tool: string; args?: Record; @@ -453,19 +468,7 @@ describe("POST /tools/invoke", () => { method: "token", }); - const res = await postToolsInvoke({ - port: sharedPort, - headers: { - authorization: "Bearer secret", - "content-type": "application/json", - }, - body: { - tool: "agents_list", - action: "json", - args: {}, - sessionKey: "main", - }, - }); + const res = await invokeAgentsListBearer(); const body = await expectOkInvokeResponse(res); expect(body.result).toEqual({ ok: true, result: [] }); @@ -802,19 +805,7 @@ describe("POST /tools/invoke", () => { method: "token", }); - const res = await postToolsInvoke({ - port: sharedPort, - headers: { - authorization: "Bearer secret", - "content-type": "application/json", - }, - body: { - tool: "agents_list", - action: "json", - args: {}, - sessionKey: "main", - }, - }); + const res = await invokeAgentsListBearer(); const body = await expectOkInvokeResponse(res); expect(body.result).toEqual({ ok: true, result: [] });