test: check auto-reply diagnostics

This commit is contained in:
Shakker
2026-05-11 18:02:25 +01:00
parent 738f94b290
commit 27e705f7cd
3 changed files with 7 additions and 4 deletions

View File

@@ -2591,7 +2591,7 @@ describe("runReplyAgent transient HTTP retry", () => {
expect(runEmbeddedPiAgentMock).toHaveBeenCalledTimes(2);
expect(runtimeErrorMock).toHaveBeenCalledWith(
expect.stringContaining("Transient HTTP provider error before reply"),
'Transient HTTP provider error before reply (521 <!DOCTYPE html><html lang="en-US"><head><title>Web server is down</title></head><body>Cloudflare</body></html>). Retrying once in 2500ms.',
);
const payload = Array.isArray(result) ? result[0] : result;

View File

@@ -155,10 +155,11 @@ describe("handleBashChatCommand stop", () => {
},
});
const result = await handleBashChatCommand(buildElevatedDeniedParams("/bash pwd"));
const params = buildElevatedDeniedParams("/bash pwd");
const result = await handleBashChatCommand(params);
expect(resolveSandboxRuntimeStatusSpy).toHaveBeenCalledWith({
cfg: expect.any(Object),
cfg: params.cfg,
sessionKey: "agent:target:telegram:direct:target-session",
});
expect(result.text).toContain(

View File

@@ -75,7 +75,9 @@ describe("drainPendingToolTasks", () => {
await vi.advanceTimersByTimeAsync(100);
await expect(drain).resolves.toEqual({ kind: "timeout", remaining: 1 });
expect(onTimeout).toHaveBeenCalledWith(expect.stringContaining("1 task(s) still pending"));
expect(onTimeout).toHaveBeenCalledWith(
"pending tool tasks made no progress within 100ms; proceeding with 1 task(s) still pending to avoid session deadlock",
);
expect(tasks.size).toBe(1);
});