






















@@ -139,6 +139,15 @@ function approvalResolveCalls(request: ReturnType<typeof vi.fn>) {
139139return request.mock.calls.filter(([method]) => method === "exec.approval.resolve");
140140}
141141142+function hasApprovalRelay(agent: AcpGatewayAgent, approvalId: string): boolean {
143+const relayMap = (
144+agent as unknown as {
145+approvalRelays: Map<string, unknown>;
146+}
147+).approvalRelays;
148+return relayMap.has(approvalId);
149+}
150+142151function requireRecord(value: unknown): Record<string, unknown> {
143152expect(value).toBeTruthy();
144153expect(typeof value).toBe("object");
@@ -319,7 +328,9 @@ describe("ACP translator permission relay", () => {
319328expect(harness.requestPermission).toHaveBeenCalledTimes(1);
320329expect(resolveApproval).toHaveBeenCalledTimes(1);
321330});
322-await new Promise((resolve) => setTimeout(resolve, 0));
331+await vi.waitFor(() => {
332+expect(hasApprovalRelay(harness.agent, "approval-retry")).toBe(false);
333+});
323334324335await harness.agent.handleGatewayEvent(event);
325336此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。