mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:10:51 +00:00
fix(clawsweeper): address review for automerge-openclaw-openclaw-75035 (validation-1)
This commit is contained in:
@@ -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" },
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user