






















@@ -107,12 +107,8 @@ describe("Codex app-server approval bridge", () => {
107107expect(requestPayload.turnSourceChannel).toBe("telegram");
108108expect(requestPayload.turnSourceTo).toBe("chat-1");
109109expect(gatewayCallOptions()).toEqual({ expectFinal: false });
110-expect(
111-findApprovalEvent(params, { status: "pending", approvalId: "plugin:approval-1" }),
112-).toBeDefined();
113-expect(
114-findApprovalEvent(params, { status: "approved", approvalId: "plugin:approval-1" }),
115-).toBeDefined();
110+findApprovalEvent(params, { status: "pending", approvalId: "plugin:approval-1" });
111+findApprovalEvent(params, { status: "approved", approvalId: "plugin:approval-1" });
116112});
117113118114it("describes command approvals from parsed command actions when available", async () => {
@@ -240,12 +236,10 @@ describe("Codex app-server approval bridge", () => {
240236expect(gatewayRequestPayload().description).toBe(
241237"Command: pnpm test --watch extensions/codex/src/app-server\nSession: agent:main:session-1",
242238);
243-expect(
244-findApprovalEvent(params, {
245-status: "pending",
246-command: "pnpm test --watch extensions/codex/src/app-server",
247-}),
248-).toBeDefined();
239+findApprovalEvent(params, {
240+status: "pending",
241+command: "pnpm test --watch extensions/codex/src/app-server",
242+});
249243});
250244251245it("escapes command approval previews before forwarding approval text and events", async () => {
@@ -275,12 +269,9 @@ describe("Codex app-server approval bridge", () => {
275269expect(description).not.toContain("<@U123>");
276270expect(description).not.toContain("[trusted](https://evil)");
277271expect(description).not.toContain("@here");
278-expect(
279-findApprovalEvent(params, {
280-command:
281-"printf '<\uff20U123> \uff3btrusted\uff3d\uff08https://evil\uff09 \uff20here'",
282-}),
283-).toBeDefined();
272+findApprovalEvent(params, {
273+command: "printf '<\uff20U123> \uff3btrusted\uff3d\uff08https://evil\uff09 \uff20here'",
274+});
284275});
285276286277it("preserves visible OSC-8 link labels in command previews", async () => {
@@ -416,12 +407,10 @@ describe("Codex app-server approval bridge", () => {
416407"plugin.approval.request",
417408"plugin.approval.waitDecision",
418409]);
419-expect(
420-findApprovalEvent(params, {
421-status: "denied",
422-approvalId: "plugin:approval-untrusted",
423-}),
424-).toBeDefined();
410+findApprovalEvent(params, {
411+status: "denied",
412+approvalId: "plugin:approval-untrusted",
413+});
425414});
426415427416it("only treats own null data-property request decisions as no-route", async () => {
@@ -538,9 +527,7 @@ describe("Codex app-server approval bridge", () => {
538527539528expect(result).toEqual({ decision: "decline" });
540529expect(mockCallGatewayTool).toHaveBeenCalledTimes(1);
541-expect(
542-findApprovalEvent(params, { status: "unavailable", reason: "needs write access" }),
543-).toBeDefined();
530+findApprovalEvent(params, { status: "unavailable", reason: "needs write access" });
544531});
545532546533it("sanitizes reason previews before forwarding approval text and events", async () => {
@@ -566,12 +553,10 @@ describe("Codex app-server approval bridge", () => {
566553expect(gatewayRequestPayload().description).toBe(
567554"Reason: needs write access for /tmp please\nSession: agent:main:session-1",
568555);
569-expect(
570-findApprovalEvent(params, {
571-status: "unavailable",
572-reason: "needs write access for /tmp please",
573-}),
574-).toBeDefined();
556+findApprovalEvent(params, {
557+status: "unavailable",
558+reason: "needs write access for /tmp please",
559+});
575560});
576561577562it("fails closed for unsupported native approval methods without requesting plugin approval", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。