Skip to content

Fix inserted-document count log to not depend on TTY-gated progress bar#30

Merged
jennapederson merged 1 commit into
mainfrom
fix/npm-run-index-inserted-count-log
Jul 22, 2026
Merged

Fix inserted-document count log to not depend on TTY-gated progress bar#30
jennapederson merged 1 commit into
mainfrom
fix/npm-run-index-inserted-count-log

Conversation

@jennapederson

@jennapederson jennapederson commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

cli-progress's SingleBar.start() no-ops when stdout isn't a TTY, so progressBar.getTotal() stays at the library's default of 100 in any piped/redirected/CI run, regardless of how many documents were actually indexed. Report clean.length directly instead.

Problem

Fixing broken / out of date sample apps

Solution

Describe the approach you took. Link to any relevant bugs, issues, docs, or other resources.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Describe specific steps for validating this change.


Note

Low Risk
Logging-only change with no effect on indexing, embeddings, or Pinecone upserts.

Overview
Fixes the post-index “Inserted N documents” log so N reflects the number of articles actually indexed instead of a misleading default from cli-progress.

When stdout is not a TTY (piped output, redirects, CI), SingleBar.start() effectively does not initialize the bar total, so progressBar.getTotal() could stay at the library default (e.g. 100) even when far more rows were upserted. The completion message now uses clean.length, matching the row count passed into progressBar.start() and the embed/upsert loop.

Reviewed by Cursor Bugbot for commit 290dac9. Bugbot is set up for automated code reviews on this repo. Configure here.

cli-progress's SingleBar.start() no-ops when stdout isn't a TTY, so
progressBar.getTotal() stays at the library's default of 100 in any
piped/redirected/CI run, regardless of how many documents were
actually indexed. Report clean.length directly instead.
@jennapederson
jennapederson merged commit 1075823 into main Jul 22, 2026
8 checks passed
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