fix: polish restart feedback + stabilize tests (#685) (thanks @carlulsoe)

This commit is contained in:
Peter Steinberger
2026-01-10 22:52:09 +01:00
parent f699dc3777
commit fa61699f9a
5 changed files with 30 additions and 3 deletions

View File

@@ -13,6 +13,7 @@
- Docker: allow optional home volume + extra bind mounts in `docker-setup.sh`. (#679) — thanks @gabriel-trigo. - Docker: allow optional home volume + extra bind mounts in `docker-setup.sh`. (#679) — thanks @gabriel-trigo.
### Fixes ### Fixes
- CLI: avoid success message when daemon restart is skipped. (#685) — thanks @carlulsoe.
- macOS: stabilize bridge tunnels, guard invoke senders on disconnect, and drain stdout/stderr to avoid deadlocks. (#676) — thanks @ngutman. - macOS: stabilize bridge tunnels, guard invoke senders on disconnect, and drain stdout/stderr to avoid deadlocks. (#676) — thanks @ngutman.
- Agents/System: clarify sandboxed runtime in system prompt and surface elevated availability when sandboxed. - Agents/System: clarify sandboxed runtime in system prompt and surface elevated availability when sandboxed.
- Auto-reply: prefer `RawBody` for command/directive parsing (WhatsApp + Discord) and prevent fallback runs from clobbering concurrent session updates. (#643) — thanks @mcinteerj. - Auto-reply: prefer `RawBody` for command/directive parsing (WhatsApp + Discord) and prevent fallback runs from clobbering concurrent session updates. (#643) — thanks @mcinteerj.

View File

@@ -589,7 +589,6 @@ export async function getReplyFromConfig(
(agentCfg?.elevatedDefault as ElevatedLevel | undefined) ?? (agentCfg?.elevatedDefault as ElevatedLevel | undefined) ??
"on") "on")
: "off"; : "off";
const providerKey = sessionCtx.Provider?.trim().toLowerCase();
const resolvedBlockStreaming = const resolvedBlockStreaming =
opts?.disableBlockStreaming === true opts?.disableBlockStreaming === true
? "off" ? "off"

View File

@@ -131,6 +131,33 @@ describe("update-cli", () => {
expect(runDaemonRestart).toHaveBeenCalled(); expect(runDaemonRestart).toHaveBeenCalled();
}); });
it("updateCommand skips success message when restart does not run", async () => {
const { runGatewayUpdate } = await import("../infra/update-runner.js");
const { runDaemonRestart } = await import("./daemon-cli.js");
const { defaultRuntime } = await import("../runtime.js");
const { updateCommand } = await import("./update-cli.js");
const mockResult: UpdateRunResult = {
status: "ok",
mode: "git",
steps: [],
durationMs: 100,
};
vi.mocked(runGatewayUpdate).mockResolvedValue(mockResult);
vi.mocked(runDaemonRestart).mockResolvedValue(false);
vi.mocked(defaultRuntime.log).mockClear();
await updateCommand({ restart: true });
const logLines = vi
.mocked(defaultRuntime.log)
.mock.calls.map((call) => String(call[0]));
expect(
logLines.some((line) => line.includes("Daemon restarted successfully.")),
).toBe(false);
});
it("updateCommand validates timeout option", async () => { it("updateCommand validates timeout option", async () => {
const { defaultRuntime } = await import("../runtime.js"); const { defaultRuntime } = await import("../runtime.js");
const { updateCommand } = await import("./update-cli.js"); const { updateCommand } = await import("./update-cli.js");

View File

@@ -42,5 +42,5 @@ describe("sandbox explain command", () => {
expect(Array.isArray(parsed.fixIt)).toBe(true); expect(Array.isArray(parsed.fixIt)).toBe(true);
expect(parsed.fixIt).toContain("agents.defaults.sandbox.mode=off"); expect(parsed.fixIt).toContain("agents.defaults.sandbox.mode=off");
expect(parsed.fixIt).toContain("tools.sandbox.tools.deny"); expect(parsed.fixIt).toContain("tools.sandbox.tools.deny");
}); }, 15_000);
}); });

View File

@@ -118,7 +118,7 @@ describe("discord tool result dispatch", () => {
expect(runtimeError).not.toHaveBeenCalled(); expect(runtimeError).not.toHaveBeenCalled();
expect(sendMock).toHaveBeenCalledTimes(1); expect(sendMock).toHaveBeenCalledTimes(1);
expect(sendMock.mock.calls[0]?.[1]).toMatch(/^PFX /); expect(sendMock.mock.calls[0]?.[1]).toMatch(/^PFX /);
}, 10000); }, 15_000);
it("caches channel info lookups between messages", async () => { it("caches channel info lookups between messages", async () => {
const { createDiscordMessageHandler } = await import("./monitor.js"); const { createDiscordMessageHandler } = await import("./monitor.js");