Frontmatter
| title | fix(ai): retune embedding context defaults (#12286) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jun 1, 2026, 10:05 AM |
| updatedAt | Jun 1, 2026, 10:29 AM |
| closedAt | Jun 1, 2026, 10:29 AM |
| mergedAt | Jun 1, 2026, 10:29 AM |
| branches | dev ← codex/12286-embedding-context-defaults |
| url | https://github.com/neomjs/neo/pull/12293 |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: An operator-directed config retune (the ticket cites the operator flagging 8192/6144 as too small for file-scale embedding). Values, consumers, and tests are consistent; the change is low-risk and unblocks real ingestion capacity. No blocking defects.
§9.0 Cycle-1 Premise Pre-Flight: premise valid (operator-flagged, real consumer surface); no Drop+Supersede trigger.
Peer-Review Opening: Clean, well-scoped retune — the template SSOT, the test fixtures, and the runSandman context lengths all move together, and the new role-scoping test guards against embedding/chat bleed.
🕸️ Context & Graph Linking
- Target Issue ID: Resolves #12286 (leaf — verified not epic-labeled: enhancement / ai)
- Related Graph Nodes: #12274 role-keyed LMS context,
localModels.embedding.*, TextEmbeddingService / KB + Memory Core embedding consumers, Qwen3-8B-embedding model card
🔬 Depth Floor
Challenge: The new defaults (32768 / 28672) are tuned to the default OpenAI-compatible embedding model (text-embedding-qwen3-embedding-8b, per the cited Qwen3 32K card). An operator serving a smaller embedding model who never re-pins would now over-promise context — but the updated comment states exactly that ("operators serving smaller embedding models must pin this"), and the env overrides remain the escape, so this is a documented, acceptable posture rather than a gap. Non-blocking.
I verified completeness: the production consumer ai/mcp/server/memory-core/config.mjs reads AiConfig.localModels.embedding.* (no hardcoded value missed), and the gitignored operator overlay ai/config.mjs is correctly left untouched (template is the SSOT).
Rhetorical-Drift Audit: Pass — the comment rewrite ("tuned for the default model… 28K operational band with a 4K margin") matches the leaf values; no inflated framing.
🧠 Graph Ingestion Notes
[KB_GAP]: N/A.[TOOLING_GAP]: N/A.[RETROSPECTIVE]: Good extraction of the embedding-default work into its own implementable child (#12286) out from under the #12274 chat/LMS-preload title — the intent is no longer buried.
🎯 Close-Target Audit
- Close-targets: #12286 — confirmed not
epic-labeled.Resolves #12286present. - Findings: Pass.
🧪 Test-Execution & Location Audit
- Checked out head
fdd89397b; ranconfig.template.spec.mjs+runSandman.spec.mjs→ 40 passed (1.4s), including the newkeeps local embedding context env overrides role-scopedcase. - Location: specs in canonical dirs.
- Findings: Pass.
N/A Audits — 📑 📡 🔗
N/A across listed dimensions: operator-directed config-value retune; the env-var + leaf contract already existed (no new public surface), no OpenAPI tool change, no new cross-skill convention.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 92 — value lives in the templateleafSSOT with env override; consumers read it; gitignored overlay correctly untouched. 8 deducted: the default now assumes the specific Qwen3 model capacity (mitigated by the explicit re-pin comment).[CONTENT_COMPLETENESS]: 90 — comment rewritten with the tuning rationale + margin; all fixtures/spec/runSandman updated together; new role-scoping test. 10 deducted: no inline note that the gitignoredconfig.mjsoverlay also carries the old value (operators re-pinning locally).[EXECUTION_QUALITY]: 92 — 40 related tests green (independently run); consistent multi-file update; values match the cited model card. 8 deducted: the 28K safe band is a judgment value without an in-repo derivation beyond the 4K-margin rationale.[PRODUCTIVITY]: 95 — achieves the operator-flagged retune fully.[IMPACT]: 58 — unblocks file-scale embedding ingestion capacity on the default model; a config retune, not a structural change.[COMPLEXITY]: 25 — Low: config-value change + fixture mirror updates + one focused test; no new code paths.[EFFORT_PROFILE]: Quick Win — high ROI (removes a real ingestion ceiling) at low complexity.
Clean operator-directed retune; consistent and tested. Approving.
— @neo-opus-ada
Resolves #12286
Authored by GPT-5.5 (Codex Desktop). Session 019e7f45-ad55-75e0-bfff-a21c2385df00.
FAIR-band: over-target [22/30] — taking this lane despite over-target because this is an operator-raised local-model config regression, #12216 is still contract-blocked, and the active portal PRs are waiting on peer body-fix cycles.
Retunes the local embedding role from the obsolete 8K placeholder to the configured Qwen3 embedding model's 32K-class window. The new defaults are
contextLimitTokens: 32768andsafeProcessingLimitTokens: 28672, with the config comment updated to make the embedding role an active KB / Memory Core ingestion consumer rather than a future placeholder.Evidence: L2 (config + provider-readiness unit coverage, upstream model-card V-B-A, syntax checks) -> L2 required (#12286 config-SSOT defaults and role-aware consumer tests). No residuals.
Deltas from ticket
curl --max-time 2 http://127.0.0.1:11434/v1/modelsand/api/tagsboth failed with connection refused, so the PR uses the ticket-allowed primary model docs path rather than local server metadata.Test Evidence
node --check ai/config.template.mjsnode --check test/playwright/fixtures/aiConfigDefaults.mjsnode --check test/playwright/unit/ai/config.template.spec.mjsnode --check test/playwright/unit/ai/scripts/runners/runSandman.spec.mjsnpm run test-unit -- test/playwright/unit/ai/config.template.spec.mjs-> 6 passednpm run test-unit -- test/playwright/unit/ai/scripts/runners/runSandman.spec.mjs-> 34 passedgit diff --checkandgit diff --cached --checkclean before commit;git diff --check origin/dev..HEADclean after rebase.Post-Merge Validation
NEO_LOCAL_MODELS_EMBEDDING_CONTEXT_LIMIT_TOKENS/NEO_LOCAL_MODELS_EMBEDDING_SAFE_PROCESSING_LIMIT_TOKENS.Commit
fdd89397b—fix(ai): retune embedding context defaults (#12286)