feat(l3): dedicated l3Llm config slot for abstraction pass#1959
Conversation
L3 abstraction runs on the main `llm`, which on cheap models (gemini-2.5-flash-lite) over-extracts and truncates the JSON, producing "'constraints'/'inference' must be an array" failures — Violet logged 180 such failures and produced only 2 world-model facts total. Add an `l3Llm` config slot (same SkillEvolverSchema shape as `skillEvolver`). Blank inherits the main `llm` (zero behavior change); set explicitly to run the clustering → world-model pass on a stronger model. L3 is async/off the turn-response path, so a slower-but-correct model has no impact on companion latency. Wiring mirrors skillEvolver: schema + blank default + secret redaction + bootstrap client + PipelineDeps/PipelineHandle field + orchestrator handle passthrough, consumed at the L3 subscriber attach (`deps.l3Llm ?? deps.llm`).
|
Good config design! Dedicated l3Llm config slot allows using a stronger model for L3 abstraction without affecting companion latency. The fallback to shared llm settings is sensible. Adding l3Llm.apiKey to SECRET_FIELD_PATHS is correct. |
|
Automated Test Results: PASSED Cloud test-engine rerun against
Manual code review is still required before merge. |
✅ Automated Test Results: PASSEDAll tests passed (43/43 executed). memos_local_plugin/unit: 43/43. Duration: 12s [advisory, non-gating] AI-generated tests on branch test/auto-gen-05768d70954acbe1-20260709111339: 51/51 passed — these do NOT affect the PR verdict; review the branch manually. Branch: |
✅ Automated Test Results: PASSEDAll tests passed (43/43 executed). memos_local_plugin/unit: 43/43. Duration: 12s [advisory, non-gating] AI-generated tests on branch test/auto-gen-41b2127f5d64fbe6-20260709120727: 77/77 passed — these do NOT affect the PR verdict; review the branch manually. Branch: |
Problem
L3 abstraction runs on the main
llm. On cheap models (e.g.gemini-2.5-flash-lite) this over-extracts and truncates the JSON output, producing'constraints'/'inference' must be an arrayerrors. The slot is quality-sensitive and runs off the turn-response path — a slower but more capable model here improves world-model quality with no impact on latency.Changes
Adds an
l3Llmtop-level config slot using the sameSkillEvolverSchemashape asskillEvolver. When blank (the default), behavior is identical to today —deps.l3Llm ?? deps.llmfalls through to the main LLM. When set, the L3 clustering → abstraction subscriber uses the dedicated client.defaults.ts— blank default (inherits main llm)schema.ts—l3Llm: SkillEvolverSchemaentrymemory-core.ts— bootstrap client (mirrorsreflectLlmpath; errors log, don't crash)deps.ts/types.ts—PipelineDeps.l3LlmandPipelineHandle.l3Llmfieldsorchestrator.ts— threads the field through to the handleorchestrator.test.ts— two tests: dedicated client threads through, null when unconfiguredConfig example
Operators running a budget model as their main
llmcan now point L3 at a stronger model: