test(cli): reopen the idle agent explicitly after a supervisor restart

Fetching an agent's timeline now reads stored history without loading the agent, so the agent stays closed until it is reopened.
This commit is contained in:
Mohamed Boudra
2026-11-26 02:44:45 +01:00
parent eed84c01f1
commit 511306bd25
@@ -210,7 +210,12 @@ try {
console.log("Foreground SIGINT reached the supervisor. The worker and ACP processes exited.");
daemon = await startSupervisor();
const restoredIdle = (await daemon.client.fetchAgentTimeline(idle.id)).agent;
// The stored timeline is served without reopening the agent.
const storedIdle = (await daemon.client.fetchAgentTimeline(idle.id)).agent;
assert.equal(storedIdle?.status, "closed");
assert.equal(storedIdle?.requiresAttention, false);
await daemon.client.refreshAgent(idle.id);
const restoredIdle = (await daemon.client.fetchAgent(idle.id))?.agent;
assert.equal(restoredIdle?.status, "idle");
assert.equal(restoredIdle?.requiresAttention, false);
await waitFor(async () => {