Skip to content

bug(embedder): search --json leaks model loading messages to stdout #115

@carlos-alm

Description

@carlos-alm

Found during dogfooding v2.4.0

Severity: Low
Command: codegraph search "query" --json

Reproduction

codegraph search "build graph" --json 2>/dev/null | head -3

Expected behavior

Clean JSON on stdout with all status messages on stderr, allowing pipe usage:

{
  "results": [

Actual behavior

Loading embedding model: Xenova/all-MiniLM-L6-v2 (384d)...
Model loaded.
{

The "Loading embedding model..." and "Model loaded." lines appear on stdout, breaking JSON pipe consumers.

Root cause

These messages come from @huggingface/transformers via console.log. The codegraph logger routes through stderr, but the HF library's own console output goes to stdout.

Suggested fix

Redirect console.log to stderr during model loading, or suppress HF library output when --json is active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdogfoodFound during dogfooding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions