Skip to content

fix(cli): warn when embedding reindex has no entities - #1190

Merged
phernandez merged 1 commit into
mainfrom
codex/reindex-embeddings-warning
Aug 5, 2026
Merged

fix(cli): warn when embedding reindex has no entities#1190
phernandez merged 1 commit into
mainfrom
codex/reindex-embeddings-warning

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

bm reindex --embeddings only rebuilds vectors for entities already present in the database. On a fresh CLI-only project it could therefore report 0 entities embedded and finish successfully while files still had not been indexed, with no explanation of the prerequisite.

Fixes #1184.

What Changed

  • warn when embeddings-only mode finds zero indexed entities
  • explain that --embeddings does not discover project files
  • direct users to plain bm reindex or the MCP server's initial index
  • update the semantic-search quick start and reindex reference to distinguish the two commands
  • add a CLI regression for the zero-entity output

Implementation Details

The lifecycle boundary is unchanged. Embeddings-only mode still operates exclusively on database entities and does not implicitly run the project-index coordinator. The warning is emitted only when --embeddings runs without the search/index phase and reindex_vectors() reports zero total entities.

That keeps existing incremental and provider-rebuild behavior predictable while making the unsynced-project no-op explicit.

Testing

Automated

  • uv run pytest -q tests/cli/test_db_reindex.py --no-cov: 9 passed
  • just fast-check: Ruff fix/check, formatting, and ty type checking passed
  • git diff --check: passed

Manual

  • No live embedding provider was needed; the CLI regression captures the rendered zero-entity summary and warning.

Risks / Follow-ups

  • The command still exits successfully because an empty indexed project is not itself an operational failure. The user-visible warning supplies the missing next action.
  • This PR deliberately does not auto-index files from --embeddings; plain bm reindex remains the command that owns project discovery and indexing.

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez merged commit 7493f93 into main Aug 5, 2026
25 checks passed
@phernandez
phernandez deleted the codex/reindex-embeddings-warning branch August 5, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bm reindex --embeddings silently no-ops on an unsynced project (0 embedded, no warning)

1 participant