Skip to content

Init reindex progress - #4

Merged
jdbadger merged 5 commits into
mainfrom
init-reindex-progress
Sep 19, 2026
Merged

jdbadger merged 5 commits into
mainfrom
init-reindex-progress

Conversation

@jdbadger

@jdbadger jdbadger commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

indexter init and reindex used to run silently for seconds (about 19s on this repo, most of it embedding), and the only output was Hugging Face's own warnings and progress bars. This PR adds progress narration on stderr for both commands, with one line per phase that settles into a static summary. It only appears when stderr is an interactive terminal, and --quiet or --progress override that. Results on stdout are unchanged, and MCP-triggered syncs stay silent so stdout remains the JSON-RPC channel. A cached model now loads without going online, which saves about 1.1s per run, and it falls back to downloading if the cache is incomplete. Hugging Face and transformers warnings and progress bars are muted, including the tokenizer download on a first run. An embedding_model that isn't a Hugging Face model ID, such as a local path, now gives a one-line error instead of a traceback. The PR also removes a leftover planning file and archives the OpenSpec change.

init and reindex ran silently for seconds (about 19s on this repo, 91% of it
embedding), and the only output was Hugging Face's own warning and weight-loading
bar. A first-run model download printed nothing at all.

- Add a Progress observer threaded through index_repository, sync_repo and the
  embedding backlog. It defaults to NullProgress, so MCP search-triggered syncs
  stay silent and stdout remains the JSON-RPC transport.
- Add ConsoleProgress (rich): phases paint only after ~300ms, only the active
  phase animates, and each resolves to a static line. Narration goes to stderr;
  results stay on stdout, unchanged. A cold model download shows elapsed time,
  never a byte total or estimate.
- Add --quiet / --progress to init and reindex; narration is otherwise on only
  for an interactive stderr. NO_COLOR is honoured.
- Probe the local HF cache and load a cached model with local_files_only=True
  (about 1.1s faster per run), retrying without it if the cache is incomplete.
- Mute huggingface_hub and transformers warnings and progress bars after import.
- Archive the OpenSpec change and merge its deltas into the main specs.
A local path (or any non-repo-ID name) made huggingface_hub raise
HFValidationError, a ValueError nothing caught, so init, reindex and
search-triggered syncs ended in a traceback. _load_tokenizer has had this
since M3; probe_model_cache added a second crash site.

- probe_model_cache treats an invalid name as uncached instead of raising.
- _load_tokenizer raises the new InvalidModelName (an EmbeddingError), which
  the CLI and MCP tools already render as one line. It names the setting and
  says local paths are not supported, rather than advising network access.
The tokenizer is fetched during the files phase, before _load_model mutes
anything, so a first run on a terminal drew the hub's download bar over
the live progress line.
Under GITHUB_ACTIONS, Typer forces rich's terminal mode, which styles
"--quiet" as "-" + "-quiet" with escape codes between them, so the
substring check failed in CI but passed locally.
@jdbadger
jdbadger merged commit 6674d9e into main Sep 19, 2026
5 checks passed
@jdbadger
jdbadger deleted the init-reindex-progress branch September 19, 2026 01:33
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.

1 participant