feat: add lane config option for embedded agent isolation#97
Open
mmhzlrj wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add optional
laneparameter to CleanContextRunner that allows extraction tasks (L1/L2/L3) to use a dedicated global lane instead of the defaultmainlane. This prevents long-running memory extraction calls from blocking interactive chat sessions.Problem
When memory-tdai runs
scene-extract(L2) viarunEmbeddedPiAgent, it occupies the defaultmainglobal lane with no way to isolate it from user chat sessions. A single extraction call can take 2-5 minutes, blocking all other sessions onmainduring that time.Solution
Pass
lanetorunEmbeddedPiAgent()via the newCleanContextRunnerOptions.lanefield.Changes
src/utils/clean-context-runner.tsCleanContextRunnerOptions.lane, passed torunEmbeddedPiAgent()src/core/scene/scene-extractor.tsSceneExtractorOptions.lane, forwarded to CleanContextRunnersrc/core/persona/persona-generator.tsPersonaGeneratorOptions.lane, forwarded to CleanContextRunnersrc/core/record/l1-extractor.tscallLlmExtraction()laneparam, forwardedsrc/core/record/l1-dedup.tsbatchDedup()laneparam, forwardedREADME.mdextraction.laneandpersona.laneUsage
{ "memory-tencentdb": { "extraction": { "model": "deepseek/deepseek-v4-flash", "lane": "cron" }, "persona": { "lane": "cron" } } }Setting
lane: "cron"routes extraction to OpenClaw'scron-nestedglobal lane which runs in parallel with themainuser chat lane.Testing
npm run build:plugin # ✓ Build complete in 145msRelated
resolveGlobalLane()mapslane: "cron"→"cron-nested"