test: tighten exec approval followup handoff assertion · openclaw/openclaw@60214e3
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -43,6 +43,7 @@ function expectGatewayAgentFollowup(expected: Record<string, unknown>) {
|
43 | 43 | expect(params[key]).toBe(value); |
44 | 44 | } |
45 | 45 | expect(call[3]).toEqual({ expectFinal: true }); |
| 46 | +return params; |
46 | 47 | } |
47 | 48 | |
48 | 49 | function expectDirectSend(expected: Record<string, unknown>) { |
@@ -293,18 +294,12 @@ describe("exec approval followup", () => {
|
293 | 294 | idempotencyKey: "exec-approval-followup:req-elevated-75832:nonce:nonce-75832", |
294 | 295 | }); |
295 | 296 | |
296 | | -expect(callGatewayTool).toHaveBeenCalledWith( |
297 | | -"agent", |
298 | | -expect.any(Object), |
299 | | -expect.objectContaining({ |
300 | | -sessionKey: "agent:main:telegram:direct:123", |
301 | | -channel: "telegram", |
302 | | -idempotencyKey: "exec-approval-followup:req-elevated-75832:nonce:nonce-75832", |
303 | | -internalRuntimeHandoffId: "handoff-75832", |
304 | | -}), |
305 | | -{ expectFinal: true }, |
306 | | -); |
307 | | -const [, , agentArgs] = vi.mocked(callGatewayTool).mock.calls[0] ?? []; |
| 297 | +const agentArgs = expectGatewayAgentFollowup({ |
| 298 | +sessionKey: "agent:main:telegram:direct:123", |
| 299 | +channel: "telegram", |
| 300 | +idempotencyKey: "exec-approval-followup:req-elevated-75832:nonce:nonce-75832", |
| 301 | +internalRuntimeHandoffId: "handoff-75832", |
| 302 | +}); |
308 | 303 | expect(agentArgs).not.toHaveProperty("bashElevated"); |
309 | 304 | expect(agentArgs).not.toHaveProperty("execApprovalFollowupToken"); |
310 | 305 | }); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。