Skip to content

fix(cli): handle unencodable search results - #246

Merged
georgeh0 merged 1 commit into
cocoindex-io:mainfrom
shixi-li:fix/gbk-search-output
Jul 31, 2026
Merged

fix(cli): handle unencodable search results#246
georgeh0 merged 1 commit into
cocoindex-io:mainfrom
shixi-li:fix/gbk-search-output

Conversation

@shixi-li

Copy link
Copy Markdown
Contributor

Summary

  • fall back to replacement characters when search result metadata or content cannot be encoded by the console
  • preserve text that the active console encoding supports
  • cover file paths and result content with a strict GBK output regression

Addresses the GBK console-output failure described in #166. The separate stale-daemon environment problem remains out of scope.

Testing

  • .venv/bin/python -m pytest tests/test_cli_helpers.py::test_print_search_results_replaces_unencodable_console_characters -q
  • .venv/bin/python -m pytest tests/test_cli_helpers.py -q (25 passed)
  • .venv/bin/ruff check src/cocoindex_code/cli.py tests/test_cli_helpers.py
  • .venv/bin/ruff format --check src/cocoindex_code/cli.py tests/test_cli_helpers.py
  • .venv/bin/python -m mypy src tests
  • uv build --offline

The full developer suite is not reported as passing locally: its sentence-transformers dependency resolves to torch 2.13, which has no Intel macOS wheel. The focused CLI suite, strict static checks, offline package build, and GBK-specific regression all pass.

@georgeh0 georgeh0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the enhancement!

@georgeh0
georgeh0 merged commit 979cdf8 into cocoindex-io:main Jul 31, 2026
4 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.

2 participants