Sessions
Manage agent conversation sessions — list active sessions, inspect state, and clean up stale ones.
A session is a lightweight conversation container. It holds the message history for one interaction between a user and an agent.
What a session contains
| Field | Description |
|---|---|
id | Unique u64 counter ID |
agent | Name of the agent handling this session |
created_by | Who started it ("cli", "tg:12345", "dc:67890") |
created_at | When the session was created |
history | Vec<Message> — the conversation so far |
Sessions are ephemeral — they exist only in memory and are lost when the daemon restarts. Durable knowledge goes through memory.
CLI commands
List sessions
walrus session listShows all active sessions with their ID, agent name, creator, message count, and age.
Kill a session
walrus session kill <id>Closes the session and frees its message history.
Session lifecycle
- REPL —
walrus attachcreates a session on first message. The session persists until you exit. - Channels — Telegram and Discord maintain one session per chat ID. The first message in a chat creates a new session; subsequent messages reuse it.
- Tasks — Each spawned task gets its own session, which is auto-closed when the task finishes.
When a session encounters a stale-session error (e.g., after a daemon restart), channels automatically recover by creating a new session.
What's next
- Runtime — how sessions fit into the runtime architecture
- CLI reference — full command syntax