Repository navigation
fix: report a skipped embedding refresh on a graph with no embeddings - #1071
Merged
1 commit merged intoOct 15, 2026
Merged
1 commit merged into
1 commit merged into
Conversation
An explicit embedding refresh (provider and model supplied) on a graph that was never embedded returned before provider resolution and left no trace in the result, so it looked the same as a build that never asked for a refresh. build, update and postprocess now set embeddings_refresh_skipped and add a warning that names the embed command. An update that finds no changes returns before post-processing, so it checks for an index directly and reports the same notice. No model is loaded and no provider is contacted in either case; has_embeddings() is the check refresh_embeddings() already made, now shared. watch fails closed on post-processing warnings, so the notice would have ended it on the first update. The watch boundary exempts that one notice: watch logs it and keeps running, and every other warning, including a refresh that fails against an existing index, still fails the update.
03a5c7d
Owner
|
Thank you! I added tests for watch logging the notice once per update, the real CLI watch and build runs, an empty embeddings table left by graph stats, and half a provider/model pair. The tests and your change are merged into staging in #1115. |
azizur100389
pushed a commit
to azizur100389/code-review-graph
that referenced
this pull request
Oct 15, 2026
- incremental update that re-parses files reports the skip, including a repo path with spaces and non-ASCII characters - repeated build/update requests report every time and never create the embeddings table - no-change update reports the skip at postprocess none/minimal/full (guards the tirth8205#1105 no-op rewrite in tools/build.py) - interrupted-build repair reports the skip - postprocess with an empty embeddings table keeps status ok - skip, then embed, then refresh reports embeddings_refreshed and no notice - has_embeddings: no table, empty table, current and legacy rows - legacy index without provider identity fails the refresh and stops watch; an empty legacy table is a skip - watch exempts only the exact notice (duplicates ok; half-pair, altered text still fail); None/non-dict results are ignored - real MCP tools and CLI build/update/postprocess/--quiet report the notice, exit cleanly and never resolve a provider Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
azizur100389
pushed a commit
to azizur100389/code-review-graph
that referenced
this pull request
Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Closes #1070
What & why
An explicit refresh (
embedding_provider+embedding_model, or--embedding-provider+--embedding-model) on a graph with no vectors returnedokwith no embedding field and no warning, the same result as a build that never asked for a refresh.refresh_embeddingskeeps returningNonebefore provider resolution, so the feat: add documentation-aware, opt-in embedding refresh #653 guarantee holds: no model load and no network call. I moved its table-and-row check intohas_embeddings()inembeddings.pyso the no-change path below can reuse it.build_or_update_graph,run_postprocess(behind the MCP tools and thebuild,updateandpostprocesscommands) and the sharedrun_post_processingnow turn thatNoneintoembeddings_refresh_skipped: trueplusREFRESH_SKIPPED_WARNING, which tells the caller to runcode-review-graph embed/embed_graph_toolonce.updatethat finds no changes returns before post-processing. With both values passed, it now callshas_embeddings()and reports the same notice if the graph has no index. On an embedded graph it does nothing, as before.watchtreats any post-processing warning as a failed update, so the notice alone would endwatch --embedding-provider ... --embedding-model ...on its first update._raise_watch_postprocess_warningsnow exempts that one warning: watch logs it after each update and keeps running. Any other warning fails the update as before, including a refresh that fails against an existing index.Builds without both values behave as before. A
watchthat starts with nothing to reconcile stays quiet until the first file changes, because no refresh runs before then.I updated the docstrings,
docs/USAGE.mdand the changelog.How it was tested
Linux, Python 3.12 (
python:3.12container), on a clone of the branch with full history and tags, checked out at the path CI uses (/home/runner/work/code-review-graph/code-review-graph):tests/test_e2e_real_repo.py::test_hybrid_search_ranks_impact_radius_nodes_firstdepends on where the checkout lives. With the clone at/work/repoit fails on this branch and on unchangedstaging(6b12d11) alike, and at the CI path it passes on both. The new and changed test modules also pass on Windows with Python 3.14.New tests:
tests/test_watch_refresh_without_index.py: watch startup reconciliation and a watch batch, each with an explicit pair on a never-embedded graph, keep running and never resolve a provider. Any other warning, alone or next to the notice, fails the update.TestRefreshWithoutVectorsintests/test_embedding_refresh.py: every build post-process level, shared post-processing,run_postprocess, a full build, and a no-changeupdatewith and without an index. The post-process cases run with noembeddingstable and with an empty one, and each case asserts thatget_provideris not called.Checklist
uv run pytest tests/ --tb=short -quv run ruff check code_review_graph/uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optionaldocs/, docstrings)