Skip to content

fix: keep successful searches off stderr - #114

Merged
nicholls73 merged 2 commits into
mainfrom
codex/fix-stderr-noise
Aug 10, 2026
Merged

fix: keep successful searches off stderr#114
nicholls73 merged 2 commits into
mainfrom
codex/fix-stderr-noise

Conversation

@nicholls73

@nicholls73 nicholls73 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • pass dtype: "auto" when loading the Transformers embedding pipeline
  • route non-fatal search and update notices to stdout
  • keep genuine CLI failures on stderr
  • cover the stderr contract with regression tests

Root cause

The Transformers pipeline emitted a warning when dtype was omitted, while OpenBrain also used stderr for successful-search advisories and update notices. Hook consumers can treat stderr as a blocking failure signal, so successful operations need a clean error channel.

Impact

Successful memory searches no longer produce stderr noise, making hook-backed integrations safe to build on without hiding genuine errors.

Validation

  • pnpm lint
  • pnpm build
  • pnpm test — 130 passed, 1 opt-in integration test skipped
  • manual CLI check: successful search exited 0 with zero stderr bytes; invalid search exited 1 with stderr

Fixes #88

Summary by CodeRabbit

  • Bug Fixes

    • Adjusted diagnostic and update notices to appear as informational messages instead of warnings or errors.
    • Improved transformer initialization with automatic data-type selection.
    • Search, embedding, and update notifications now avoid cluttering warning and error output.
  • Tests

    • Added coverage for transformer-backed embeddings, automatic data types, output dimensions, and informational logging.
    • Updated search and update notification tests to verify the revised messaging behavior.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nicholls73, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b669e8c-ac37-425d-9ebc-c7798b4f257c

📥 Commits

Reviewing files that changed from the base of the PR and between 549f8ca and cf9859e.

📒 Files selected for processing (1)
  • tests/embeddings.test.ts
📝 Walkthrough

Walkthrough

Transformer initialization now uses dtype: "auto". Embedding and search diagnostics, plus update notices, now use console.info. Tests verify output channels, message behavior, and embedding dimensions.

Changes

Embedding initialization and diagnostics

Layer / File(s) Summary
Embedding initialization and diagnostics
src/embeddings.ts, tests/embeddings.test.ts
Transformer initialization passes automatic dtype. Dimension-mismatch reporting uses informational logging. Tests verify 384-dimensional output and logging behavior.
Search diagnostic reporting
src/search.ts, tests/openbrain.test.ts
FTS-only and dimension-mismatch notices use informational logging. Tests verify informational output and the absence of warnings or errors.
Update notice output
src/update.ts, tests/update.test.ts
Update notices use console.info instead of console.error. Tests verify both output channels.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: successful searches no longer write non-fatal output to stderr.
Linked Issues check ✅ Passed The changes address issue #88 by setting automatic dtype, routing non-fatal notices to stdout, preserving errors, and adding regression tests.
Out of Scope Changes check ✅ Passed The code and test changes directly support issue #88 and contain no unrelated functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-stderr-noise

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nicholls73
nicholls73 marked this pull request as ready for review August 10, 2026 23:25

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/embeddings.test.ts`:
- Around line 166-173: Update the test around the provider.embed calls to spy on
console.warn in addition to console.info, assert the warning spy was not called,
and restore both spies in the finally block while preserving the existing info
assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 40242a88-26bd-4434-b0a7-755c810f2dc3

📥 Commits

Reviewing files that changed from the base of the PR and between c8f6816 and 549f8ca.

📒 Files selected for processing (6)
  • src/embeddings.ts
  • src/search.ts
  • src/update.ts
  • tests/embeddings.test.ts
  • tests/openbrain.test.ts
  • tests/update.test.ts

Comment thread tests/embeddings.test.ts
@nicholls73
nicholls73 merged commit 0616b68 into main Aug 10, 2026
6 checks passed
@nicholls73
nicholls73 deleted the codex/fix-stderr-noise branch August 10, 2026 23:36
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.

Library noise on stderr will block tool calls once hook-backed integrations land

1 participant