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-25 07:05:54 +01:00
parent 201972f548
commit a99a731430
@@ -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 () => {