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 c09f136
Browse filesBrowse the repository at this point in the historyBrowse files
fix: reduce memory spikes when preparing long session histories (#133753)
* fix(sessions): project model history before hydration
* fix(sessions): follow canonical transcript identity reader
* fix(sessions): type projection column references
Copy file name to clipboardExpand all lines: docs/plugins/hooks.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -781,6 +781,8 @@ restrictions intersect. A nested ordinary `before_prompt_build` dispatch on
781
781
the same runner is skipped while its outer dispatch is active; other hook
782
782
families and independent turns remain available.
783
783
784
+
Message-consuming prompt hooks receive a detached model-context snapshot. Mutating nested messages does not change the caller's history, including when a handler retains its input after returning. Registrations within one dispatch share that snapshot in priority order; prepare, ordinary prompt-build, authorized enrichment, and subsequent prompt rebuilds receive separate snapshots. Storage-only native prompt text and tool-result details are excluded from these snapshots.
785
+
784
786
### Authorized prompt enrichment
785
787
786
788
Register `before_prompt_build` with `requiresToolAuthority: true` when a plugin
Copy file name to clipboardExpand all lines: docs/reference/session-management-compaction.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,6 +186,8 @@ Notable entry types:
186
186
187
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
188
189
+
Model-only callers can use `SessionManager.openModelContext()` to create a detached, non-persisting view. The reader selects payloads in SQLite and retains lightweight navigation outside the model window, without introducing a history size cutoff. Storage-only native prompt text and tool-result details stay out of that view; mirror identity, sender and media facts, tool content, and valid provider replay state remain available. Native fork verification, replay, exports, and doctor operations continue to use full-fidelity evidence readers.
190
+
189
191
OpenClaw intentionally does not "fix up" transcripts; the Gateway uses `SessionManager` to read/write them.
0 commit comments