




















@@ -240,17 +240,14 @@ describe("Codex app-server elicitation bridge", () => {
240240content: null,
241241_meta: null,
242242});
243-expect(mockCallGatewayTool).toHaveBeenCalledWith(
244-"plugin.approval.request",
245-expect.any(Object),
246-expect.objectContaining({
247-description: expect.stringContaining("App: GitHub"),
248-}),
249-{ expectFinal: false },
250-);
251-const approvalRequest = mockCallGatewayTool.mock.calls[0]?.[2] as {
243+const approvalRequestCall = mockCallGatewayTool.mock.calls[0];
244+expect(approvalRequestCall?.[0]).toBe("plugin.approval.request");
245+expect(approvalRequestCall?.[1]).toStrictEqual({ timeoutMs: 130_000 });
246+expect(approvalRequestCall?.[3]).toStrictEqual({ expectFinal: false });
247+const approvalRequest = approvalRequestCall?.[2] as {
252248description: string;
253249};
250+expect(approvalRequest.description).toContain("App: GitHub");
254251expect(approvalRequest.description).toContain("Tool: Create pull request");
255252expect(approvalRequest.description).toContain("Repository: openclaw/openclaw");
256253});
@@ -811,19 +808,16 @@ describe("Codex app-server elicitation bridge", () => {
811808},
812809_meta: null,
813810});
814-expect(mockCallGatewayTool).toHaveBeenCalledWith(
815-"plugin.approval.request",
816-expect.any(Object),
817-expect.objectContaining({
818-title: expect.any(String),
819-description: expect.any(String),
820-}),
821-{ expectFinal: false },
822-);
823-const approvalRequest = mockCallGatewayTool.mock.calls[0]?.[2] as {
811+const approvalRequestCall = mockCallGatewayTool.mock.calls[0];
812+expect(approvalRequestCall?.[0]).toBe("plugin.approval.request");
813+expect(approvalRequestCall?.[1]).toStrictEqual({ timeoutMs: 130_000 });
814+expect(approvalRequestCall?.[3]).toStrictEqual({ expectFinal: false });
815+const approvalRequest = approvalRequestCall?.[2] as {
824816title: string;
825817description: string;
826818};
819+expect(typeof approvalRequest.title).toBe("string");
820+expect(typeof approvalRequest.description).toBe("string");
827821expect(approvalRequest.title.length).toBeLessThanOrEqual(80);
828822expect(approvalRequest.description.length).toBeLessThanOrEqual(256);
829823});
@@ -905,13 +899,14 @@ describe("Codex app-server elicitation bridge", () => {
905899content: null,
906900_meta: null,
907901});
908-expect(warn).toHaveBeenCalledWith(
902+const [warningMessage, warningDetails] = warn.mock.calls[0] ?? [];
903+expect(warningMessage).toBe(
909904"codex MCP approval elicitation approved without a mappable response",
910-expect.objectContaining({
911-approvalKind: "mcp_tool_call",
912-fields: ["confirmChoice"],
913-outcome: "approved-once",
914-}),
915905);
906+expect(warningDetails).toStrictEqual({
907+approvalKind: "mcp_tool_call",
908+fields: ["confirmChoice"],
909+outcome: "approved-once",
910+});
916911});
917912});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。