[Bug]: Explicit embedding refresh on a never-embedded graph returns ok and reports nothing

Author: alex-feelCreated Sep 27, 2026Updated Sep 27, 2026

code-review-graph version

2.3.9

Operating system

Linux

Python version

3.12.14

AI platform

claude-code

Output of code-review-graph status

bash
Nodes: 2
Edges: 1
Files: 1
Languages: python
Last updated: 2026-09-27T18:02:03
Built on branch: master
Built at commit: c77e24a6d495

Steps to reproduce

bash
mkdir demo && cd demo && git init -q
printf 'def hello():\n    return 1\n' > app.py
git add app.py && git -c user.name=demo -c [email protected] commit -qm "chore: add app"
cd ..
uv run --no-project --python 3.12 --with code-review-graph==2.3.9 python - <<'PY'
from code_review_graph.tools.build import build_or_update_graph

result = build_or_update_graph(
    full_rebuild=True,
    repo_root="demo",
    embedding_provider="local",
    embedding_model="all-MiniLM-L6-v2",
)
print(result["status"], result["total_nodes"])
print({k: v for k, v in result.items() if "embed" in k or k == "warnings"})
PY

Output:

ok 2
{}

code-review-graph build --embedding-provider local --embedding-model all-MiniLM-L6-v2 in the same repo also exits 0 with no warning.

Expected vs actual behavior

Expected: the result says the requested refresh embedded nothing, for example a flag plus a warning to run code-review-graph embed (MCP: embed_graph_tool) once.

Actual: status: ok with no embeddings_refreshed key and no warning, the same result as a build that never asked for a refresh. A client that passes both values on every build reads this as "embeddings are maintained" while the graph has none.

Additional context

refresh_embeddings returns None before provider resolution when the graph has no vectors. #653 made that deliberate, and I'd keep it. The two call sites, _run_embedding_refresh in tools/build.py and _refresh_embeddings in postprocessing.py, record a result only when the refresh returns a dict, so the None case leaves no trace. An update that finds no changed files returns before post-processing and never reaches the refresh.

I have a fix ready and will open it against staging once this issue has a number. It keeps the skip, sets embeddings_refresh_skipped: true and adds a warning naming code-review-graph embed, also on an update that finds no changes. watch treats any post-processing warning as a failed update, so the fix exempts this one notice there: watch logs it and keeps running. Bootstrapping the index when both values are passed would also close the gap, but it would resolve a provider on a never-embedded graph, and since #653 the refresh returns before that step on purpose.

Source: tirth8205/code-review-graph