Skip to content

Fix knowledge-base folder mount UTF-8 mojibake on Windows - #31

Merged
XYAIStudio merged 3 commits into
mainfrom
cursor/fix-kb-mount-utf8-34e3
Sep 16, 2026
Merged

XYAIStudio merged 3 commits into
mainfrom
cursor/fix-kb-mount-utf8-34e3

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

Windows knowledge-base local folder mount showed Chinese paths and filenames as UTF-8-as-Latin-1/CP1252 mojibake (for example 项ç�®ç»�æ��.png instead of 项目结构.png). Mount and list preview also surfaced 409 KNOWLEDGE_PREREQUISITES_FAILED when the embedding model was not ready, or when a bad path was mapped to that same code.

This PR keeps mount-first:

  • Native Windows folder picker now returns the path as UTF-8 Base64 (console code page cannot corrupt CJK).
  • Desktop and Python layers repair leftover Latin-1/CP1252 mojibake.
  • Mount/list preview require only the knowledge feature switch, not a ready embedding model.
  • Invalid folder paths now return KNOWLEDGE_MOUNT_INVALID (400) instead of a prerequisites 409.

Does not merge or replace any Release branch.

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • make all (full ship bar not run here; targeted suites below are green)
  • Added/updated tests

Verification:

  • uv run ruff check on touched Python files: passed
  • uv run mypy --strict on touched modules: passed
  • uv run pytest targeted (test_win_utf8, test_knowledge_mount, test_knowledge_bases, tests/unit/i18n, test_host_dirs, desktop folder-picker source check): 140 passed, 1 skipped
  • cd dashboard && npx tsc --noEmit: passed
  • npx vitest run (utf8Mojibake, desktopFolder, LocalMountPanel, pickKnowledgeFolder): 8 passed
  • go test for the desktop package was not run to completion here (Wails/GTK headers missing on this Linux image). Encoding helpers are covered by Go unit tests in CI environments that build Wails, plus a Python source assertion.

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 16, 2026 07:32
Keep folder picker and mount listing on UTF-8 so Chinese paths and
filenames are not shown as Latin-1/CP1252 mojibake. Mount and list
preview require only the knowledge feature switch, not a ready
embedding model.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Form defaults from FastAPI must not be treated as filenames. Changelog
notes the Windows mojibake and mount-first 409 fix.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 16, 2026 07:36
@XYAIStudio
XYAIStudio merged commit f29ac52 into main Sep 16, 2026
11 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/fix-kb-mount-utf8-34e3 branch September 16, 2026 08:28
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.

3 participants