Skip to content

轻量模式下 turn_start 只取 Tier-2,导入的 skills / worldModels 永远不会被注入,而文档里没写 #2501

Open

Description

@MechDesign618

轻量模式(algorithm.lightweightMemory.enabled)默认就是 true。而 retrieve.js 的 turnStartRetrieve() 在轻量分支里把计划写死成:

wantTier1: false,
wantTier2: true,
wantTier3: false,

Tier-1 是技能层、Tier-3 是世界模型层。也就是说默认安装下:

  • skills 永远不会进 turn_start 的注入包;
  • world models 也一样。

这条最容易踩在官方提供的导入路径上:importBundle() 允许导入自己写的 skills / worldModels(share: {scope:'public'}),
导完向量能查、FTS 能查、Viewer 里看得见、ranker 也会给分,但就是到不了模型那里,而且一句提示都没有。
等于默认安装下"导入自己的技能"这个功能在 turn_start 上是死的。

很难发现的原因是 memos_search 也看不出来:工具那条计划同样写死 wantTier1: false(注释说是为了避免重复注入技能)。
能看出真相的只有插件自己落盘的检索统计(stats.plannedTiers),或者注入包本身:

"stats": {"plannedTiers": {"tier1": false, "tier2": true, "tier3": false}, "raw": 20, ...}

文档上的缺口在于:schema 里写着轻量模式保留 "summarize + embedding + retrieval filter",
那说的是演化链(reward / L2 / L3 / 技能结晶);没有任何地方说检索的"计划"也被砍了,更没说这是默认值。

期望至少做到一条:文档里写清轻量模式会关掉 Tier-1/Tier-3(包括它是默认值),
或者让 Tier-1 在轻量模式下保留(它是纯存储读,不花模型调用)。

环境:@memtensor/memos-local-plugin 2.0.20,Windows 11;lightweightMemory 用默认值;skills/worldModels 经 importBundle() 导入。

Activity

  1. akushonkamen commented on Oct 16, 2026

    @akushonkamen

    Claiming this one.

    Root cause confirmed on main @ a7367d0 (identical to 2.0.20): the lightweight branch of turnStartRetrieve hard-codes the plan to {wantTier1: false, wantTier2: true, wantTier3: false} (apps/memos-local-plugin/core/retrieval/retrieve.ts:102-110). The intent-based scheduler plan would normally override this (applyPlanOverride), but the prompt-time recall path — recallTurn in apps/memos-local-plugin/core/pipeline/orchestrator.ts:1259-1273, used by the DSH bridge turn-start (adapters/deepseek-harness/bridge.ts:228 via core.searchMemory({reason: "turn_start"})) — deliberately passes plan = undefined (no intent classification), so the hard-coded base always wins and imported skills never reach the injection packet. Tier-1 itself (runTier1) is a pure storage read (FTS + vector + pattern over repos, no model calls), so arming it preserves the lightweight cost contract.

    Planned fix (minimal): arm wantTier1 in the lightweight turn-start base plan, widen the default limit by tier1TopK, keep Tier-3 off, and spell out the effective lightweight retrieval plan in the algorithm.lightweightMemory schema docs (core/config/schema.ts:174-180) so the remaining gap (world models not injected) is documented.

    Tests: a regression test asserting Tier-1 candidates surface in the lightweight turn-start packet (red before the fix), plus the existing retrieval/injection suites green.

    Disclosure: analysis, code and tests are AI-assisted (Claude).

  2. akushonkamen commented on Oct 16, 2026

    @akushonkamen

    Fix is committed and locally verified.

    Branch: fix/plugin-lightweight-turnstart-tier1 @ 63baf44 (PR to follow from the contributor pipeline).

    Change: the lightweight base plan in turnStartRetrieve (core/retrieval/retrieve.ts:102) now arms wantTier1 and widens the default limit by tier1TopK; Tier-3 stays off; the scheduler plan override still wins when present (e.g. personal_fact); algorithm.lightweightMemory schema docs now spell out the effective lightweight retrieval plan. Also updated tests/unit/retrieval/integration.test.ts:447-452, which had encoded the old no-skills behavior, and added a regression test reproducing the recall-path condition (no plan override) — red before the fix (plannedTiers {tier1:false}, no skill snippets), green after.

    Local verification: npm run test:unit 181 files — 1590 passed / 2 skipped; npm run test:integration 6 passed; tests/e2e/v7-full-chain.e2e.test.ts 2 passed / 1 skipped; npm run lint (tsc --noEmit) clean.

    Disclosure: code and tests AI-assisted (Claude).

  3. akushonkamen commented on Oct 16, 2026

    @akushonkamen

    PR with the fix: #2505 — arms Tier-1 in the lightweight turn-start base plan (pure storage read, no model calls), widens the default limit by tier1TopK; Tier-3 stays off, scheduler plan override priority unchanged. Regression test included; docs gap filled in the algorithm.lightweightMemory schema.

  4. MechDesign618 commented on Oct 16, 2026

    @MechDesign618
    Author

    谢谢确认,和我们这边的实测一致 —— 我们是在 DSH 端看到检索统计里 plannedTiers 恒为
    {"tier1": false, "tier2": true, "tier3": false} 才定位到这条的。

    Tier-1 打开这件事我们本地打补丁验证过:把 retrieve.js 轻量分支的 wantTier1 改成 true 之后,
    注入包里立刻出现了 tier=1、refKind=skill 的条目(同一会话、前后相隔 77 秒,唯一变量就是那次重启),
    所以你们的修法方向我们这边有实测支撑。

    等含这个修复的版本发出来,我们可以在真实安装上跑一遍同样的判据(api_logs 里的 plannedTiers + 注入包本身)
    并把结果贴回这里。Tier-3 保持关闭、只在 schema 文档里写明,我们也接受。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:pluginOpenClaw & Hermesstatus:needs-triageNeeds initial triage | 需要初步判断 & 问题复现

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions