Skip to content

Commit 9ebf5ae

Browse files
authored
docs: correct session migration and discovery guidance (#133818)
1 parent b4002e3 commit 9ebf5ae

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

‎docs/channels/channel-routing.md‎

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,34 @@ Example:
151151

152152
## Session storage
153153

154-
Runtime session rows live in each agent's SQLite database under the state
155-
directory (default `~/.openclaw`):
154+
Runtime session rows and transcripts live in each agent's SQLite database under
155+
the state directory (default `~/.openclaw`):
156156

157157
- `~/.openclaw/agents/<agentId>/agent/openclaw-agent.sqlite`
158158

159159
Older installs may have legacy transcript JSONL files and a `sessions.json` row
160-
store under `~/.openclaw/agents/<agentId>/sessions/`. Gateway startup and
161-
`openclaw doctor --fix` import hot legacy rows/history into SQLite
162-
automatically. Use `openclaw doctor --session-sqlite inspect
160+
store under `~/.openclaw/agents/<agentId>/sessions/`. To import that history into
161+
SQLite, stop the Gateway, back up its state, and run `openclaw doctor --fix`
162+
before restarting it. Gateway startup does not import legacy session files: if
163+
it finds a legacy store, it refuses readiness and prints the Doctor command for
164+
the active profile. Use `openclaw doctor --session-sqlite inspect
163165
--session-sqlite-all-agents` and the
164-
[Doctor](/cli/doctor#session-sqlite-migration) validation sequence when you need
165-
explicit migration evidence.
166-
You can still select a legacy store path via `session.store` and `{agentId}`
167-
templating for migration and offline-maintenance workflows.
168-
169-
Gateway and ACP session discovery also scans disk-backed agent stores under the
170-
default `agents/` root and under templated `session.store` roots. Discovered
171-
stores must stay inside that resolved agent root and use a regular legacy
172-
`sessions.json` file. Symlinks and out-of-root paths are ignored.
166+
[Doctor](/cli/doctor#session-sqlite-migration) migration sequence for inspection
167+
and validation.
168+
169+
`session.store` supports `{agentId}` templating. At runtime, a legacy store path
170+
selects its corresponding SQLite database; the JSON file itself is only a
171+
migration input or an explicit offline-maintenance target.
172+
173+
Gateway session discovery can include on-disk stores under the default `agents/`
174+
root and templated `session.store` roots that use the
175+
`agents/<agentId>/sessions/sessions.json` layout. It recognizes the corresponding
176+
`agent/openclaw-agent.sqlite` database without requiring a legacy `sessions.json`
177+
file. Discovered store files must be regular files within the resolved agent
178+
root; symlinked store files and out-of-root paths are ignored.
179+
180+
ACP session discovery reads SQLite ACP metadata and joins it to the corresponding
181+
session entries.
173182

174183
## WebChat behavior
175184

0 commit comments

Comments
 (0)