惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
酷 壳 – CoolShell
酷 壳 – CoolShell
G
Google Developers Blog
N
Netflix TechBlog - Medium
Recorded Future
Recorded Future
S
Securelist
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Scott Helme
Scott Helme
C
Check Point Blog
量子位
月光博客
月光博客
Last Week in AI
Last Week in AI
C
Cisco Blogs
G
GRAHAM CLULEY
B
Blog RSS Feed
K
Kaspersky official blog
爱范儿
爱范儿
J
Java Code Geeks
I
Intezer
aimingoo的专栏
aimingoo的专栏
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 三生石上(FineUI控件)
罗磊的独立博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
MongoDB | Blog
MongoDB | Blog
T
Threat Research - Cisco Blogs
N
News | PayPal Newsroom
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Security Latest
Security Latest
T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
The Cloudflare Blog
H
Heimdal Security Blog
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
GbyAI
GbyAI
V
Visual Studio Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 聂微东
T
Tenable Blog
The Register - Security
The Register - Security
AI
AI
C
Cybersecurity and Infrastructure Security Agency CISA
S
Schneier on Security
L
LangChain Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
docs(context-engine): rewrite with Steps, Tabs, AccordionGroup, and P… · openclaw/openclaw@eb769ee
vincentkoc · 2026-04-26 · via Recent Commits to openclaw:main

@@ -5,115 +5,114 @@ read_when:

55

- You are switching between the legacy engine and a plugin engine

66

- You are building a context engine plugin

77

title: "Context engine"

8+

sidebarTitle: "Context engine"

89

---

91010-

A **context engine** controls how OpenClaw builds model context for each run:

11-

which messages to include, how to summarize older history, and how to manage

12-

context across subagent boundaries.

11+

A **context engine** controls how OpenClaw builds model context for each run: which messages to include, how to summarize older history, and how to manage context across subagent boundaries.

131214-

OpenClaw ships with a built-in `legacy` engine and uses it by default — most

15-

users never need to change this. Install and select a plugin engine only when

16-

you want different assembly, compaction, or cross-session recall behavior.

13+

OpenClaw ships with a built-in `legacy` engine and uses it by default — most users never need to change this. Install and select a plugin engine only when you want different assembly, compaction, or cross-session recall behavior.

17141815

## Quick start

191620-

Check which engine is active:

21-22-

```bash

23-

openclaw doctor

24-

# or inspect config directly:

25-

cat ~/.openclaw/openclaw.json | jq '.plugins.slots.contextEngine'

26-

```

27-28-

### Installing a context engine plugin

29-30-

Context engine plugins are installed like any other OpenClaw plugin. Install

31-

first, then select the engine in the slot:

32-33-

```bash

34-

# Install from npm

35-

openclaw plugins install @martian-engineering/lossless-claw

36-37-

# Or install from a local path (for development)

38-

openclaw plugins install -l ./my-context-engine

39-

```

40-41-

Then enable the plugin and select it as the active engine in your config:

42-43-

```json5

44-

// openclaw.json

45-

{

46-

plugins: {

47-

slots: {

48-

contextEngine: "lossless-claw", // must match the plugin's registered engine id

49-

},

50-

entries: {

51-

"lossless-claw": {

52-

enabled: true,

53-

// Plugin-specific config goes here (see the plugin's docs)

17+

<Steps>

18+

<Step title="Check which engine is active">

19+

```bash

20+

openclaw doctor

21+

# or inspect config directly:

22+

cat ~/.openclaw/openclaw.json | jq '.plugins.slots.contextEngine'

23+

```

24+

</Step>

25+

<Step title="Install a plugin engine">

26+

Context engine plugins are installed like any other OpenClaw plugin.

27+28+

<Tabs>

29+

<Tab title="From npm">

30+

```bash

31+

openclaw plugins install @martian-engineering/lossless-claw

32+

```

33+

</Tab>

34+

<Tab title="From a local path">

35+

```bash

36+

openclaw plugins install -l ./my-context-engine

37+

```

38+

</Tab>

39+

</Tabs>

40+41+

</Step>

42+

<Step title="Enable and select the engine">

43+

```json5

44+

// openclaw.json

45+

{

46+

plugins: {

47+

slots: {

48+

contextEngine: "lossless-claw", // must match the plugin's registered engine id

49+

},

50+

entries: {

51+

"lossless-claw": {

52+

enabled: true,

53+

// Plugin-specific config goes here (see the plugin's docs)

54+

},

55+

},

5456

},

55-

},

56-

},

57-

}

58-

```

57+

}

58+

```

595960-

Restart the gateway after installing and configuring.

60+

Restart the gateway after installing and configuring.

616162-

To switch back to the built-in engine, set `contextEngine` to `"legacy"` (or

63-

remove the key entirely — `"legacy"` is the default).

62+

</Step>

63+

<Step title="Switch back to legacy (optional)">

64+

Set `contextEngine` to `"legacy"` (or remove the key entirely — `"legacy"` is the default).

65+

</Step>

66+

</Steps>

64676568

## How it works

666967-

Every time OpenClaw runs a model prompt, the context engine participates at

68-

four lifecycle points:

69-70-

1. **Ingest** — called when a new message is added to the session. The engine

71-

can store or index the message in its own data store.

72-

2. **Assemble** — called before each model run. The engine returns an ordered

73-

set of messages (and an optional `systemPromptAddition`) that fit within

74-

the token budget.

75-

3. **Compact** — called when the context window is full, or when the user runs

76-

`/compact`. The engine summarizes older history to free space.

77-

4. **After turn** — called after a run completes. The engine can persist state,

78-

trigger background compaction, or update indexes.

79-80-

For the bundled non-ACP Codex harness, OpenClaw applies the same lifecycle by

81-

projecting assembled context into Codex developer instructions and the current

82-

turn prompt. Codex still owns its native thread history and native compactor.

70+

Every time OpenClaw runs a model prompt, the context engine participates at four lifecycle points:

71+72+

<AccordionGroup>

73+

<Accordion title="1. Ingest">

74+

Called when a new message is added to the session. The engine can store or index the message in its own data store.

75+

</Accordion>

76+

<Accordion title="2. Assemble">

77+

Called before each model run. The engine returns an ordered set of messages (and an optional `systemPromptAddition`) that fit within the token budget.

78+

</Accordion>

79+

<Accordion title="3. Compact">

80+

Called when the context window is full, or when the user runs `/compact`. The engine summarizes older history to free space.

81+

</Accordion>

82+

<Accordion title="4. After turn">

83+

Called after a run completes. The engine can persist state, trigger background compaction, or update indexes.

84+

</Accordion>

85+

</AccordionGroup>

86+87+

For the bundled non-ACP Codex harness, OpenClaw applies the same lifecycle by projecting assembled context into Codex developer instructions and the current turn prompt. Codex still owns its native thread history and native compactor.

83888489

### Subagent lifecycle (optional)

85908691

OpenClaw calls two optional subagent lifecycle hooks:

879288-

- **prepareSubagentSpawn** — prepare shared context state before a child run

89-

starts. The hook receives parent/child session keys, `contextMode`

90-

(`isolated` or `fork`), available transcript ids/files, and optional TTL.

91-

If it returns a rollback handle, OpenClaw calls it when spawn fails after

92-

preparation succeeds.

93-

- **onSubagentEnded** — clean up when a subagent session completes or is swept.

93+

<ParamField path="prepareSubagentSpawn" type="method">

94+

Prepare shared context state before a child run starts. The hook receives parent/child session keys, `contextMode` (`isolated` or `fork`), available transcript ids/files, and optional TTL. If it returns a rollback handle, OpenClaw calls it when spawn fails after preparation succeeds.

95+

</ParamField>

96+

<ParamField path="onSubagentEnded" type="method">

97+

Clean up when a subagent session completes or is swept.

98+

</ParamField>

949995100

### System prompt addition

9610197-

The `assemble` method can return a `systemPromptAddition` string. OpenClaw

98-

prepends this to the system prompt for the run. This lets engines inject

99-

dynamic recall guidance, retrieval instructions, or context-aware hints

100-

without requiring static workspace files.

102+

The `assemble` method can return a `systemPromptAddition` string. OpenClaw prepends this to the system prompt for the run. This lets engines inject dynamic recall guidance, retrieval instructions, or context-aware hints without requiring static workspace files.

101103102104

## The legacy engine

103105104106

The built-in `legacy` engine preserves OpenClaw's original behavior:

105107106108

- **Ingest**: no-op (the session manager handles message persistence directly).

107-

- **Assemble**: pass-through (the existing sanitize → validate → limit pipeline

108-

in the runtime handles context assembly).

109-

- **Compact**: delegates to the built-in summarization compaction, which creates

110-

a single summary of older messages and keeps recent messages intact.

109+

- **Assemble**: pass-through (the existing sanitize → validate → limit pipeline in the runtime handles context assembly).

110+

- **Compact**: delegates to the built-in summarization compaction, which creates a single summary of older messages and keeps recent messages intact.

111111

- **After turn**: no-op.

112112113113

The legacy engine does not register tools or provide a `systemPromptAddition`.

114114115-

When no `plugins.slots.contextEngine` is set (or it's set to `"legacy"`), this

116-

engine is used automatically.

115+

When no `plugins.slots.contextEngine` is set (or it's set to `"legacy"`), this engine is used automatically.

117116118117

## Plugin engines

119118

@@ -185,11 +184,15 @@ Required members:

185184186185

`assemble` returns an `AssembleResult` with:

187186188-

- `messages` — the ordered messages to send to the model.

189-

- `estimatedTokens` (required, `number`) — the engine's estimate of total

190-

tokens in the assembled context. OpenClaw uses this for compaction threshold

191-

decisions and diagnostic reporting.

192-

- `systemPromptAddition` (optional, `string`) — prepended to the system prompt.

187+

<ParamField path="messages" type="Message[]" required>

188+

The ordered messages to send to the model.

189+

</ParamField>

190+

<ParamField path="estimatedTokens" type="number" required>

191+

The engine's estimate of total tokens in the assembled context. OpenClaw uses this for compaction threshold decisions and diagnostic reporting.

192+

</ParamField>

193+

<ParamField path="systemPromptAddition" type="string">

194+

Prepended to the system prompt.

195+

</ParamField>

193196194197

Optional members:

195198

@@ -204,34 +207,33 @@ Optional members:

204207205208

### ownsCompaction

206209207-

`ownsCompaction` controls whether Pi's built-in in-attempt auto-compaction stays

208-

enabled for the run:

210+

`ownsCompaction` controls whether Pi's built-in in-attempt auto-compaction stays enabled for the run:

209211210-

- `true` — the engine owns compaction behavior. OpenClaw disables Pi's built-in

211-

auto-compaction for that run, and the engine's `compact()` implementation is

212-

responsible for `/compact`, overflow recovery compaction, and any proactive

213-

compaction it wants to do in `afterTurn()`. OpenClaw may still run the

214-

pre-prompt overflow safeguard; when it predicts the full transcript will

215-

overflow, the recovery path calls the active engine's `compact()` before

216-

submitting another prompt.

217-

- `false` or unset — Pi's built-in auto-compaction may still run during prompt

218-

execution, but the active engine's `compact()` method is still called for

219-

`/compact` and overflow recovery.

212+

<AccordionGroup>

213+

<Accordion title="ownsCompaction: true">

214+

The engine owns compaction behavior. OpenClaw disables Pi's built-in auto-compaction for that run, and the engine's `compact()` implementation is responsible for `/compact`, overflow recovery compaction, and any proactive compaction it wants to do in `afterTurn()`. OpenClaw may still run the pre-prompt overflow safeguard; when it predicts the full transcript will overflow, the recovery path calls the active engine's `compact()` before submitting another prompt.

215+

</Accordion>

216+

<Accordion title="ownsCompaction: false or unset">

217+

Pi's built-in auto-compaction may still run during prompt execution, but the active engine's `compact()` method is still called for `/compact` and overflow recovery.

218+

</Accordion>

219+

</AccordionGroup>

220220221-

`ownsCompaction: false` does **not** mean OpenClaw automatically falls back to

222-

the legacy engine's compaction path.

221+

<Warning>

222+

`ownsCompaction: false` does **not** mean OpenClaw automatically falls back to the legacy engine's compaction path.

223+

</Warning>

223224224225

That means there are two valid plugin patterns:

225226226-

- **Owning mode** — implement your own compaction algorithm and set

227-

`ownsCompaction: true`.

228-

- **Delegating mode** — set `ownsCompaction: false` and have `compact()` call

229-

`delegateCompactionToRuntime(...)` from `openclaw/plugin-sdk/core` to use

230-

OpenClaw's built-in compaction behavior.

227+

<Tabs>

228+

<Tab title="Owning mode">

229+

Implement your own compaction algorithm and set `ownsCompaction: true`.

230+

</Tab>

231+

<Tab title="Delegating mode">

232+

Set `ownsCompaction: false` and have `compact()` call `delegateCompactionToRuntime(...)` from `openclaw/plugin-sdk/core` to use OpenClaw's built-in compaction behavior.

233+

</Tab>

234+

</Tabs>

231235232-

A no-op `compact()` is unsafe for an active non-owning engine because it

233-

disables the normal `/compact` and overflow-recovery compaction path for that

234-

engine slot.

236+

A no-op `compact()` is unsafe for an active non-owning engine because it disables the normal `/compact` and overflow-recovery compaction path for that engine slot.

235237236238

## Configuration reference

237239

@@ -247,47 +249,35 @@ engine slot.

247249

}

248250

```

249251250-

The slot is exclusive at run time — only one registered context engine is

251-

resolved for a given run or compaction operation. Other enabled

252-

`kind: "context-engine"` plugins can still load and run their registration

253-

code; `plugins.slots.contextEngine` only selects which registered engine id

254-

OpenClaw resolves when it needs a context engine.

252+

<Note>

253+

The slot is exclusive at run time — only one registered context engine is resolved for a given run or compaction operation. Other enabled `kind: "context-engine"` plugins can still load and run their registration code; `plugins.slots.contextEngine` only selects which registered engine id OpenClaw resolves when it needs a context engine.

254+

</Note>

255255256256

## Relationship to compaction and memory

257257258-

- **Compaction** is one responsibility of the context engine. The legacy engine

259-

delegates to OpenClaw's built-in summarization. Plugin engines can implement

260-

any compaction strategy (DAG summaries, vector retrieval, etc.).

261-

- **Memory plugins** (`plugins.slots.memory`) are separate from context engines.

262-

Memory plugins provide search/retrieval; context engines control what the

263-

model sees. They can work together — a context engine might use memory

264-

plugin data during assembly. Plugin engines that want the active memory

265-

prompt path should prefer `buildMemorySystemPromptAddition(...)` from

266-

`openclaw/plugin-sdk/core`, which converts the active memory prompt sections

267-

into a ready-to-prepend `systemPromptAddition`. If an engine needs lower-level

268-

control, it can still pull raw lines from

269-

`openclaw/plugin-sdk/memory-host-core` via

270-

`buildActiveMemoryPromptSection(...)`.

271-

- **Session pruning** (trimming old tool results in-memory) still runs

272-

regardless of which context engine is active.

258+

<AccordionGroup>

259+

<Accordion title="Compaction">

260+

Compaction is one responsibility of the context engine. The legacy engine delegates to OpenClaw's built-in summarization. Plugin engines can implement any compaction strategy (DAG summaries, vector retrieval, etc.).

261+

</Accordion>

262+

<Accordion title="Memory plugins">

263+

Memory plugins (`plugins.slots.memory`) are separate from context engines. Memory plugins provide search/retrieval; context engines control what the model sees. They can work together — a context engine might use memory plugin data during assembly. Plugin engines that want the active memory prompt path should prefer `buildMemorySystemPromptAddition(...)` from `openclaw/plugin-sdk/core`, which converts the active memory prompt sections into a ready-to-prepend `systemPromptAddition`. If an engine needs lower-level control, it can still pull raw lines from `openclaw/plugin-sdk/memory-host-core` via `buildActiveMemoryPromptSection(...)`.

264+

</Accordion>

265+

<Accordion title="Session pruning">

266+

Trimming old tool results in-memory still runs regardless of which context engine is active.

267+

</Accordion>

268+

</AccordionGroup>

273269274270

## Tips

275271276272

- Use `openclaw doctor` to verify your engine is loading correctly.

277-

- If switching engines, existing sessions continue with their current history.

278-

The new engine takes over for future runs.

279-

- Engine errors are logged and surfaced in diagnostics. If a plugin engine

280-

fails to register or the selected engine id cannot be resolved, OpenClaw

281-

does not fall back automatically; runs fail until you fix the plugin or

282-

switch `plugins.slots.contextEngine` back to `"legacy"`.

283-

- For development, use `openclaw plugins install -l ./my-engine` to link a

284-

local plugin directory without copying.

285-286-

See also: [Compaction](/concepts/compaction), [Context](/concepts/context),

287-

[Plugins](/tools/plugin), [Plugin manifest](/plugins/manifest).

273+

- If switching engines, existing sessions continue with their current history. The new engine takes over for future runs.

274+

- Engine errors are logged and surfaced in diagnostics. If a plugin engine fails to register or the selected engine id cannot be resolved, OpenClaw does not fall back automatically; runs fail until you fix the plugin or switch `plugins.slots.contextEngine` back to `"legacy"`.

275+

- For development, use `openclaw plugins install -l ./my-engine` to link a local plugin directory without copying.

288276289277

## Related

290278279+

- [Compaction](/concepts/compaction) — summarizing long conversations

291280

- [Context](/concepts/context) — how context is built for agent turns

292281

- [Plugin Architecture](/plugins/architecture) — registering context engine plugins

293-

- [Compaction](/concepts/compaction) — summarizing long conversations

282+

- [Plugin manifest](/plugins/manifest) — plugin manifest fields

283+

- [Plugins](/tools/plugin) — plugin overview