mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:40:43 +00:00
context-engine: pass runtime context to ContextEngineFactory (#67243)
Merged via squash.
Prepared head SHA: 9aca6a5af1
Co-authored-by: jarimustonen <1272053+jarimustonen@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
This commit is contained in:
@@ -960,7 +960,7 @@ pipeline rather than just add memory search or hooks.
|
||||
import { buildMemorySystemPromptAddition } from "openclaw/plugin-sdk/core";
|
||||
|
||||
export default function (api) {
|
||||
api.registerContextEngine("lossless-claw", () => ({
|
||||
api.registerContextEngine("lossless-claw", (ctx) => ({
|
||||
info: { id: "lossless-claw", name: "Lossless Claw", ownsCompaction: true },
|
||||
async ingest() {
|
||||
return { ingested: true };
|
||||
@@ -982,6 +982,9 @@ export default function (api) {
|
||||
}
|
||||
```
|
||||
|
||||
The factory `ctx` exposes optional `config`, `agentDir`, and `workspaceDir`
|
||||
values for construction-time initialization.
|
||||
|
||||
If your engine does **not** own the compaction algorithm, keep `compact()`
|
||||
implemented and delegate it explicitly:
|
||||
|
||||
@@ -992,7 +995,7 @@ import {
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
|
||||
export default function (api) {
|
||||
api.registerContextEngine("my-memory-engine", () => ({
|
||||
api.registerContextEngine("my-memory-engine", (ctx) => ({
|
||||
info: {
|
||||
id: "my-memory-engine",
|
||||
name: "My Memory Engine",
|
||||
|
||||
Reference in New Issue
Block a user