Skip to content

Fix Unicode daemon session roots on Windows - #1876

Merged
DeusData merged 1 commit into
DeusData:mainfrom
ertankucukoglu:fix/windows-unicode-session-context
Sep 2, 2026
Merged

Fix Unicode daemon session roots on Windows#1876
DeusData merged 1 commit into
DeusData:mainfrom
ertankucukoglu:fix/windows-unicode-session-context

Conversation

@ertankucukoglu

Copy link
Copy Markdown
Contributor

Summary

On Windows, canonicalization returns UTF-8 paths, but daemon validation passed them to narrow stat(). Non-ASCII working directories were therefore rejected before MCP initialization.

  • Validate session and background-index roots through the UTF-8 filesystem API.
  • Cover Unicode working-directory startup and non-ASCII path variants.

Tests

  • scripts/test.sh --suites daemon_application SANITIZE= — 50 passed
  • Production build and MCP initialize from a Unicode working directory
  • Latin, Cyrillic, CJK, and Greek variants matched the ASCII baseline

@github-actions

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

@DeusData

DeusData commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Reviewed and cleared. The fix is right and it belongs to a bug class this repo already knows.

Windows canonicalization hands back UTF-8, and passing that to a narrow stat() is the same shape as passing it to a narrow fopen() — which is why this repo has cbm_fopen(), and why SQLite opens on user paths go through their own normalization. A non-ASCII working directory being rejected before MCP initialization is a particularly unhelpful place for it to bite, because there is no session yet to report the error into.

Covering Latin, Cyrillic, CJK and Greek against an ASCII baseline is the right breadth — one non-ASCII case can pass by luck of the code page.

Two things, one yours and one not

Yours: the commit has no sign-off. I checked with git's trailer parser rather than a text search, because a blank line before a trailer can hide it from git while grep still finds it. Commit 31066f8c has none at all:

git commit --amend -s --no-edit
git push --force-with-lease

Not yours: test / test-windows-guards. Your own new test passed:

=== tests\windows\test_non_ascii_path.py ===
GREEN (tests\windows\test_non_ascii_path.py)
GREEN (tests\windows\test_non_ascii_cache_dump.py)

What failed is a cluster of preconditions in unrelated cases — test_hook_augment.py ("index did not run"), test_ui_drive_listing.py ("HTTP server did not start… Is this a UI build?"), and test_cli_non_ascii_arg.py ("ASCII control did not index via CLI"). The UI one is plainly a build-configuration precondition with nothing to do with Unicode paths.

I have seen that exact cluster today on an unrelated Swift extraction PR as well, so it is a property of that lane rather than of either change. It is ours to sort out, not yours, and I am recording it as such.

Also please rebasemain moved three times today (broken by a duplicate-symbol merge, repaired by #1993, then #1703 landed), and this is currently showing as conflicting.

Sign-off plus a rebase and this is ready. Thanks for finding it at the right layer rather than special-casing the path.

@DeusData DeusData added bug Something isn't working editor/integration Editor compatibility and CLI integration ux/behavior Display bugs, docs, adoption UX windows Windows-specific issues priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. labels Sep 1, 2026
Signed-off-by: Ertan <ertan.kucukoglu@gmail.com>
@ertankucukoglu
ertankucukoglu force-pushed the fix/windows-unicode-session-context branch from 31066f8 to 9d4ac2b Compare September 1, 2026 22:15
@DeusData
DeusData merged commit 2a0e9b9 into DeusData:main Sep 2, 2026
34 checks passed
@DeusData

DeusData commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Merged as 2a0e9b9b. Thank you for the sign-off and the rebase — the substance was approved a while ago and everything since was procedural on our side.

This is the same class as #1787 and #1816: Windows Unicode repository paths breaking because a narrow CRT call sits where a UTF-8-aware one belongs. Session-context roots were one more place it reached, and the daemon is a particularly bad one to lose them in, because the failure appears as "your project is not indexed" rather than as a path error.

Before merging I confirmed the 22-commit gap to main was inert: no commit had touched src/daemon/application.c, tests/test_daemon_application.c or tests/windows/test_non_ascii_path.py since your base, so the green described exactly what landed.

That is your second merge today, after #1836.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working editor/integration Editor compatibility and CLI integration priority/high Needs near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker. ux/behavior Display bugs, docs, adoption UX windows Windows-specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants