fix(clawsweeper): address review for automerge-openclaw-openclaw-75035 (validation-1)

This commit is contained in:
clawsweeper
2026-05-06 10:45:08 +00:00
parent 138559ae74
commit 96348c437a
3 changed files with 2 additions and 23 deletions

View File

@@ -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" },

View File

@@ -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";

View File

@@ -389,27 +389,6 @@ function createScopedCliClient(
};
}
async function runChatHistory(params: {
client?: unknown;
requestParams?: Record<string, unknown>;
}) {
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"