From 5f5933fde96a2c7c92da255d959db5780373f5cf Mon Sep 17 00:00:00 2001 From: iris Date: Mon, 9 Nov 2026 22:23:43 +0100 Subject: [PATCH] docs, swarm ui: a deleted login now logs the agent out, and the dialog and docs say so With the harness poll, an agent that holds a session logs out within 5 minutes of its stored login being deleted. The confirmation and the claude-login page said the agent keeps its session. --- docs/2-handbook/swarm/claude-login.md | 5 +++-- .../packages/swarm-ui/src/agent/claude-login/StoredLogin.ts | 6 +++--- frontend/packages/swarm-ui/test/stored-login.test.mjs | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/2-handbook/swarm/claude-login.md b/docs/2-handbook/swarm/claude-login.md index 1290996fc..b40745daf 100644 --- a/docs/2-handbook/swarm/claude-login.md +++ b/docs/2-handbook/swarm/claude-login.md @@ -52,8 +52,9 @@ reads the credential. **delete login** on the card calls `DELETE /api/agents//claude-login/stored`. The minter removes the leaf and every version of it, not just the newest: an older version is still a -session. It doesn't log out an agent that already holds a session; that agent -keeps running on what's in its own `~/.claude`. +session. An agent that already holds a session logs out too, the next time it +reads the store: within 5 minutes, or when a paused agent resumes (see +[the harness's rule](#why-the-harness-takes-only-a-newer-version)). ## Why the harness takes only a newer version diff --git a/frontend/packages/swarm-ui/src/agent/claude-login/StoredLogin.ts b/frontend/packages/swarm-ui/src/agent/claude-login/StoredLogin.ts index 8942d4acd..359dce4aa 100644 --- a/frontend/packages/swarm-ui/src/agent/claude-login/StoredLogin.ts +++ b/frontend/packages/swarm-ui/src/agent/claude-login/StoredLogin.ts @@ -24,8 +24,8 @@ export function storedAtMs(login: StoredLogin): number | null { return Number.isNaN(ms) ? null : ms; } -// What the delete's confirmation says: it removes the swarm's copy, and an -// agent that already holds a session keeps it. The agent is not logged out. +// What the delete's confirmation says: it removes the swarm's copy, and the +// agent reads the store every 5 minutes and logs out when the copy is gone. export function deleteMessage(agent: string): string { - return `Delete the stored claude login for ${agent}? ${agent} is not logged out: it keeps its current session. A new login has to be made to get another stored copy.`; + return `Delete the stored claude login for ${agent}? ${agent} is logged out within 5 minutes, and needs a new login.`; } diff --git a/frontend/packages/swarm-ui/test/stored-login.test.mjs b/frontend/packages/swarm-ui/test/stored-login.test.mjs index fd6e9e74d..ae872e147 100644 --- a/frontend/packages/swarm-ui/test/stored-login.test.mjs +++ b/frontend/packages/swarm-ui/test/stored-login.test.mjs @@ -30,5 +30,5 @@ test("the time the store gives is read as an instant, or as nothing", () => { test("the delete's confirmation names the agent", () => { assert.match(deleteMessage("atlas"), /stored claude login for atlas/); - assert.match(deleteMessage("atlas"), /not logged out/); + assert.match(deleteMessage("atlas"), /logged out within 5 minutes/); });