External CodeGraph 'context' command mismatch with codegraph v1.5.0 — context-pack always falls back to Lite
Summary
memorix codegraph context-pack never uses the external semantic CodeGraph because the CLI command Memorix invokes — codegraph context --path <project-root> --format json --max-nodes 8 --no-code <task> — does not exist in codegraph v1.5.0 (error: unknown command 'context', exit 1). The health probe (codegraph status --json) passes and reports ready, so the discrepancy is confusing.
Repro
codegraph context --path <project> "any task" # error: unknown command 'context'
memorix codegraph context-pack --task "any task" # Cautions: "External semantic CodeGraph is unavailable; using Lite structural evidence for this brief."
Diagnosis
bin/codegraph.js(v1.5.0) registers 22 commands;contextis not among them, although a Context Builder implementation exists in the package atlib/dist/context/index.jsand the "codegraph context— Build context for a task" help string appears in usage text. - Reported upstream: https://github.com/colbymchenry/codegraph/issues/1611
- Also hit: the default external-codegraph command timeout is 1200ms which is tight on Windows spawn (status --json alone measures ~811ms). Raising via
[codegraph] external_timeout_ms = 5000helped the health probe but not the missing command.
Suggestion
When codegraph context is unavailable (exit != 0 / "unknown command"), fall back to an equivalent available invocation — e.g. codegraph explore --path <root> <task> — before degrading to Lite. Also consider bumping the default externalTimeoutMs (1200ms) — it is below the 5s cap and very tight for spawn+JIT on Windows.
Fixed in Memorix 1.8.2.
When the external CodeGraph context command fails or is unavailable, Memorix now falls back to the official explore CLI. The fallback uses shell-free bounded spawning, strict path/output/relation validation, and independent diagnostics for context and explore. A status ready result is no longer treated as proof that the context command exists.
Upgrade with npm install -g [email protected] and verify an external CodeGraph context request with the provider diagnostics enabled.