fix: Windows compatibility — room routing, Unicode output, test cleanup - #403
fix: Windows compatibility — room routing, Unicode output, test cleanup#403roip wants to merge 5 commits into
Conversation
PR Review: fix: Windows compatibility — room routing, Unicode output, test cleanupExecutive Summary
Affected Areas: Business Impact: Room routing change may reassign files to different rooms for existing users who relied on substring folder/filename matching. Flow Changes: Ratings
PR Health
Medium Priority Issues(Should fix or explicitly acknowledge before merge) [Flow Impact / Bug] #1:
|
web3guru888
left a comment
There was a problem hiding this comment.
Solid Windows compat work. The room routing bug fix is the most important change here — the substring matching issue would affect everyone, not just Windows.
Room routing fix (important for all platforms):
The old part in room_name or room_name in part was genuinely broken: a folder named ml/ matching visualizeml is a real bug. The new part == c or part in c.split("-") fixes it while still allowing hyphen-component matching (e.g., backend matches keyword backend-api). The regression test test_detect_room_exact_match_no_substring is well-structured — covers the bug, the fix, and the edge case.
Unicode console compat:
_stdout_supports() checking encoding before printing is the right approach. Falling back to ASCII (+, #, .) is pragmatic. This is a common pain point on Windows cp1252 consoles.
Test cleanup:
force_cleanup_tempdir() with gc.collect() + retry is a known workaround for ChromaDB's file lock issue on Windows. Using try/finally blocks instead of bare shutil.rmtree at the end makes the test suite more robust.
split_mega_files.py:
There's a merge/rebase artifact in this file — the diff shows out_path.write_text("".join(chunk), encoding="utf-8") and the _CHECKMARK print line duplicated three extra times in the main() function, inserted into completely wrong positions (inside else branches for the file iteration, the backup section, and the summary section). This will cause SyntaxError or incorrect behavior at runtime. Looks like the checkmark replacement got applied to the wrong hunks. The fix in the split_file() function itself (line ~225) is correct — just the main() function needs cleanup.
.mpignore in SKIP_FILES:
I notice you also added .mpignore to SKIP_FILES — heads-up that #379 introduces .mempalaceignore for the same purpose. Might want to coordinate on naming.
The room routing fix and Unicode compat are clean and well-tested. Just needs the split_mega_files.py artifact fixed before merge.
🔭 Reviewed as part of the MemPalace-AGI integration project — autonomous research with perfect memory. Community interaction updates are posted regularly on the dashboard.
…plit_mega_files main()
|
Thanks for the review @web3guru888 — good catch on the split_mega_files.py merge artifact. Fixed in 7024af9: the three spurious write_text/_CHECKMARK insertions in main() are removed. The correct usage in split_file() (line ~227) is untouched. Re .mpignore vs .mempalaceignore (#379): aware of the overlap. We went with .mpignore for brevity (same pattern as .npmignore, .dockerignore). Happy to support both filenames or defer to maintainer preference on the canonical name — it's a one-line change in load_ignore_matcher(). |
|
Hi, thanks for the contribution. This PR has merge conflicts with Could you rebase onto If this change is no longer relevant, feel free to close the PR. (This message is part of a periodic backlog pass, sent to all open PRs that match this state.) |
Summary
Test plan
mempalace mine --dry-runroutes files correctly