From 96348c437a0fa137198d4d78edc40c828b93ea07 Mon Sep 17 00:00:00 2001 From: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 10:45:08 +0000 Subject: [PATCH] fix(clawsweeper): address review for automerge-openclaw-openclaw-75035 (validation-1) --- src/agents/cli-runner.ts | 2 +- src/agents/pi-embedded-runner/run/attempt.ts | 2 +- .../chat.directive-tags.test.ts | 21 ------------------- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/agents/cli-runner.ts b/src/agents/cli-runner.ts index c6029bca81f..0c9b3a69ae8 100644 --- a/src/agents/cli-runner.ts +++ b/src/agents/cli-runner.ts @@ -416,7 +416,7 @@ export async function runPreparedCliAgent( }, buildAgentHookContext(hookContext), ); - } catch (err) { + } catch { const blockMessage = resolveBlockMessage( { outcome: "block", reason: "before_agent_run hook failed" }, { blockedBy: "before_agent_run" }, diff --git a/src/agents/pi-embedded-runner/run/attempt.ts b/src/agents/pi-embedded-runner/run/attempt.ts index bfe1d589230..8192bcfa255 100644 --- a/src/agents/pi-embedded-runner/run/attempt.ts +++ b/src/agents/pi-embedded-runner/run/attempt.ts @@ -2854,7 +2854,7 @@ export async function runEmbeddedAttempt( }, hookCtx, ); - } catch (err) { + } catch { log.warn("before_agent_run hook failed; blocking request"); beforeAgentRunBlocked = true; beforeAgentRunBlockedBy = "before_agent_run"; diff --git a/src/gateway/server-methods/chat.directive-tags.test.ts b/src/gateway/server-methods/chat.directive-tags.test.ts index 41fdefaf942..75440f71db8 100644 --- a/src/gateway/server-methods/chat.directive-tags.test.ts +++ b/src/gateway/server-methods/chat.directive-tags.test.ts @@ -389,27 +389,6 @@ function createScopedCliClient( }; } -async function runChatHistory(params: { - client?: unknown; - requestParams?: Record; -}) { - const respond = vi.fn(); - await chatHandlers["chat.history"]({ - params: { - sessionKey: "main", - limit: 200, - ...params.requestParams, - }, - respond: respond as unknown as Parameters<(typeof chatHandlers)["chat.history"]>[0]["respond"], - req: {} as never, - client: (params.client ?? null) as never, - isWebchatConnect: () => false, - context: createChatContext() as GatewayRequestContext, - }); - expect(respond).toHaveBeenCalledWith(true, expect.anything()); - return respond.mock.calls[0]?.[1] as { messages?: unknown[] }; -} - function createChatContext(): Pick< GatewayRequestContext, | "broadcast"