Skip to content

feat: add lane config option for embedded agent isolation#97

Open
mmhzlrj wants to merge 1 commit into
Tencent:mainfrom
mmhzlrj:main
Open

feat: add lane config option for embedded agent isolation#97
mmhzlrj wants to merge 1 commit into
Tencent:mainfrom
mmhzlrj:main

Conversation

@mmhzlrj
Copy link
Copy Markdown

@mmhzlrj mmhzlrj commented May 27, 2026

Summary

Add optional lane parameter to CleanContextRunner that allows extraction tasks (L1/L2/L3) to use a dedicated global lane instead of the default main lane. This prevents long-running memory extraction calls from blocking interactive chat sessions.

Problem

When memory-tdai runs scene-extract (L2) via runEmbeddedPiAgent, it occupies the default main global lane with no way to isolate it from user chat sessions. A single extraction call can take 2-5 minutes, blocking all other sessions on main during that time.

Solution

Pass lane to runEmbeddedPiAgent() via the new CleanContextRunnerOptions.lane field.

Changes

File Change
src/utils/clean-context-runner.ts CleanContextRunnerOptions.lane, passed to runEmbeddedPiAgent()
src/core/scene/scene-extractor.ts SceneExtractorOptions.lane, forwarded to CleanContextRunner
src/core/persona/persona-generator.ts PersonaGeneratorOptions.lane, forwarded to CleanContextRunner
src/core/record/l1-extractor.ts callLlmExtraction() lane param, forwarded
src/core/record/l1-dedup.ts batchDedup() lane param, forwarded
README.md Document extraction.lane and persona.lane

Usage

{
  "memory-tencentdb": {
    "extraction": { "model": "deepseek/deepseek-v4-flash", "lane": "cron" },
    "persona": { "lane": "cron" }
  }
}

Setting lane: "cron" routes extraction to OpenClaw's cron-nested global lane which runs in parallel with the main user chat lane.

Testing

npm run build:plugin  # ✓ Build complete in 145ms

Related

  • OpenClaw lane docs: /concepts/parallel-specialist-lanes
  • OpenClaw resolveGlobalLane() maps lane: "cron""cron-nested"

Add optional `lane` parameter to CleanContextRunnerOptions that allows
extraction tasks (L1/L2/L3) to use a dedicated global lane instead of
the default "main" lane. This prevents long-running extraction calls
from blocking interactive chat sessions.

Changes:
- CleanContextRunnerOptions: new `lane` field, passed to
  runEmbeddedPiAgent() as `params.lane`
- SceneExtractorOptions: accept `lane`, forward to CleanContextRunner
- PersonaGenerator: accept `lane`, forward to CleanContextRunner
- L1 extractor (callLlmExtraction): accept `lane`, forward to runner
- L1 dedup (runLlmJudgment): accept `lane`, forward to runner
- README: document extraction.lane and persona.lane

Usage:
  "memory-tencentdb": {
    "extraction": { "model": "deepseek/deepseek-v4-flash", "lane": "cron" },
    "persona": { "lane": "cron" }
  }

Setting lane="cron" routes extraction to the "cron-nested" global lane
which runs in parallel with the "main" user chat lane.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant