






















@@ -143,6 +143,24 @@ describe("OpenClaw SDK", () => {
143143expect(result.error?.message).toBe("aborted by operator");
144144});
145145146+it("maps auth-revoked wait snapshots to cancelled", async () => {
147+const transport = new FakeTransport({
148+"agent.wait": {
149+status: "timeout",
150+runId: "run_auth_revoked",
151+stopReason: "auth-revoked",
152+error: "provider auth was removed",
153+},
154+});
155+const oc = new OpenClaw({ transport });
156+157+const result = await oc.runs.wait("run_auth_revoked");
158+159+expect(result.runId).toBe("run_auth_revoked");
160+expect(result.status).toBe("cancelled");
161+expect(result.error?.message).toBe("provider auth was removed");
162+});
163+146164it("keeps wait-only deadlines non-terminal", async () => {
147165const transport = new FakeTransport({
148166"agent.wait": { status: "timeout", runId: "run_still_active" },
@@ -989,9 +1007,27 @@ describe("OpenClaw SDK", () => {
9891007expect(cancelled.runId).toBe("run_1");
9901008expect(cancelled.data).toEqual({ phase: "end", aborted: true, stopReason: "rpc" });
9911009992-const timedOut = normalizeGatewayEvent({
1010+const authRevoked = normalizeGatewayEvent({
9931011event: "agent",
9941012seq: 6,
1013+payload: {
1014+runId: "run_1",
1015+stream: "lifecycle",
1016+ ts,
1017+data: { phase: "end", aborted: true, stopReason: "auth-revoked" },
1018+},
1019+});
1020+expect(authRevoked.type).toBe("run.cancelled");
1021+expect(authRevoked.runId).toBe("run_1");
1022+expect(authRevoked.data).toEqual({
1023+phase: "end",
1024+aborted: true,
1025+stopReason: "auth-revoked",
1026+});
1027+1028+const timedOut = normalizeGatewayEvent({
1029+event: "agent",
1030+seq: 7,
9951031payload: {
9961032runId: "run_1",
9971033stream: "lifecycle",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。