You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8f19112
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/reference/session-management-compaction.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ Per agent, on the Gateway host (resolved via `src/config/sessions.ts`):
54
54
|`maxDiskBytes`|`10gb`| per-agent sessions disk budget; `false`, `0`, or `"0"` disables |
55
55
|`highWaterBytes`| 80% of `maxDiskBytes`| target after cleanup; zero-resolving values use the default, and negatives are invalid |
56
56
57
-
Reset advances the live `sessionKey -> sessionId` mapping but keeps the previous SQLite session, transcript, trajectory, and search rows. That history remains searchable under the same session key; ordinary entry and session lists show only the new live mapping. Retained reset history is bounded by the disk budget, not by `resetArchiveRetention`, which only ages archive artifacts. Explicit deletion is different: it writes and verifies a compressed transcript archive (`*.jsonl.deleted.<timestamp>.zst` when zstd is available) before removing the deleted session's rows.
57
+
Reset boundaries start a fresh history window without deleting earlier transcript rows. When session rollover advances the live `sessionKey -> sessionId` mapping, the previous SQLite session, transcript, trajectory, and search rows also remain; ordinary entry and session lists show only the live mapping. Retained reset history is bounded by the disk budget, not by `resetArchiveRetention`, which only ages archive artifacts. Explicit deletion is different: it writes and verifies a compressed transcript archive (`*.jsonl.deleted.<timestamp>.zst` when zstd is available) before removing the deleted session's rows.
58
58
59
59
`maxDiskBytes` enforcement uses physical bytes: the per-agent SQLite main file, its `-wal` file, and counted files in the agent sessions directory. It never estimates row JSON sizes or subtracts logical row sizes from that total.
60
60
@@ -130,7 +130,7 @@ A `sessionKey` identifies which conversation bucket you are in (routing + isolat
130
130
131
131
Each `sessionKey` points at a current `sessionId` (the SQLite transcript identity that continues the conversation). Decision logic lives in `initSessionState()` in `src/auto-reply/reply/session.ts`.
132
132
133
-
-**Reset** (`/new`, `/reset`) creates a new `sessionId` for that `sessionKey`.
133
+
-**Gateway reset** (`/new`, `/reset`) records a reset boundary in an existing persisted session and keeps its `sessionId`. A session that does not exist yet receives a new id.
134
134
-**No automatic reset** is the default. The current `sessionId` continues while compaction keeps the active model context bounded.
135
135
-**Daily reset** (`session.reset.mode: "daily"`) creates a new `sessionId` on the next message after the configured local-hour boundary (`session.reset.atHour`, default `4`).
136
136
-**Idle expiry** (`session.reset.mode: "idle"` with `session.reset.idleMinutes`, or legacy `session.idleMinutes`) creates a new `sessionId` when a message arrives after the idle window. If daily and idle are both configured, whichever expires first wins.
@@ -181,8 +181,11 @@ Notable entry types:
181
181
-`custom_message`: extension-injected message that _does_ enter model context (rendered in the TUI when `display: true`, hidden entirely when `display: false`)
182
182
-`custom`: extension state that does _not_ enter model context (for persisting extension state across reloads)
183
183
-`compaction`: persisted compaction summary with `firstKeptEntryId` and `tokensBefore`
184
+
-`reset`: a fresh history window, optionally retaining messages from `firstKeptEntryId`
184
185
-`branch_summary`: persisted summary when navigating a tree branch
185
186
187
+
History readers keep the latest reset window across later compactions: explicitly retained reset messages and messages after that reset remain visible, but older messages and compaction summaries do not reappear. Model context follows the latest reset or compaction instead, so compaction can summarize the current conversation without reopening its earlier history.
188
+
186
189
OpenClaw intentionally does not "fix up" transcripts; the Gateway uses `SessionManager` to read/write them.
0 commit comments