Skip to content

Windows: stale daemon can preserve missing embeddings env; search output can also crash on GBK consoles #166

Description

@2233admin

Title: Windows: slim uvx cocoindex-code@latest install starts a stale daemon without embeddings; search output can also crash on GBK consoles

Repo: cocoindex-io/cocoindex-code
Version: cocoindex-code 0.2.33
OS: Windows

Summary

There are two separate problems:

  1. A slim uvx cocoindex-code@latest install can start a daemon that lacks sentence_transformers, and later runs keep reconnecting to that stale daemon even after the dependency is added.
  2. ccc search can crash on Windows consoles that use GBK when a result contains Unicode characters not encodable in that code page.

What I ran

First attempt:

uvx --prerelease=explicit --with cocoindex>=1.0.0a16 cocoindex-code@latest index

Observed:

Indexing failed: No module named 'sentence_transformers'

Then I retried with the missing dependency:

uvx --prerelease=explicit --with cocoindex>=1.0.0a16 --with sentence-transformers cocoindex-code@latest index

Observed:

Indexing failed: No module named 'sentence_transformers'

The dependency was actually present in the environment. These checks succeeded:

uv run --with sentence-transformers python -c "import sentence_transformers; print(sentence_transformers.__file__)"
uv run --with cocoindex-code --with sentence-transformers python -c "from cocoindex.ops.sentence_transformers import SentenceTransformerEmbedder; print(SentenceTransformerEmbedder)"

Root cause I found locally

  • The first failed run had already started a daemon.
  • Later runs kept reconnecting to that stale daemon.
  • Stopping the daemon and rerunning in a correct environment fixed indexing.

Commands:

uv run --with cocoindex-code --with sentence-transformers python -m cocoindex_code.cli daemon stop
uv run --with cocoindex-code --with sentence-transformers python -m cocoindex_code.cli index

After stopping the stale daemon, indexing succeeded.

Recommended fix

  • If embeddings are required, fail earlier with a direct install hint that points users to the supported cocoindex-code[full] install path.
  • Consider including dependency/environment fingerprinting in the daemon handshake so a client does not reconnect to an incompatible stale daemon.
  • If a required module is missing in the daemon, surface that as a daemon health error and suggest ccc daemon restart after install.

Second issue: Windows console encoding crash

After indexing succeeded, search returned results but then crashed while printing:

uv run --with cocoindex-code --with sentence-transformers python -m cocoindex_code.cli search obsidian --limit 3

Observed traceback tail:

UnicodeEncodeError: 'gbk' codec can't encode character '\u2194' in position 523: illegal multibyte sequence

Recommended fix

  • Emit UTF-8 safely on Windows, or
  • catch UnicodeEncodeError in result printing and fall back to replacement characters.

Notes

  • Installing the supported full tool worked cleanly:
uv tool install --upgrade "cocoindex-code[full]"
ccc index
ccc mcp
  • Once the full tool was installed, indexing worked on local projects and a Markdown notes directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions