Fix Windows path assertion in colleague spawn test - #6
Merged
Merged
Conversation
Compare workspace_dir via parsed config_json and Path.resolve() instead of as_posix() substring matching, which fails when Windows paths are JSON-escaped with backslashes. Co-authored-by: XYAI Labs <haoboy8@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Windows CI failed after the self-growth loop PR (#4) with exactly one test:
tests/unit/test_colleague_spawn.py::test_spawn_writes_registry_and_agent_rowThe test compared
Path.as_posix()(forward slashes) againstAgentRow.config_json, which stores native Windows paths JSON-escaped asC:\\Users\\.... Production writesstr(workspace)viajson.dumps— that is the host-path contract used elsewhere, so this change fixes the test only.The assertion now parses
config_jsonand comparesPath.resolve()objects, which is platform-safe on Windows and POSIX.Target branch
develop(feature / fix — default)main(release/*orhotfix/*only)Hotfix for Windows CI on
mainafter #4 merged.Type of change
Test plan
make allequivalent CI green (Linux + Windows)Local:
pytest tests/unit/test_colleague_spawn.py— 1 passedruff check/ruff format --checkon the test file — cleanas_posix()is not a substring ofjson.dumps({"workspace_dir": r"C:\Users\..."}); parsedPathcomparison succeedsCI on this PR:
Checklist
CHANGELOG.md(if user-facing)Test-only; no user-facing change.
Note: #5 is a nearly identical test-only fix that is also green. Merge either; this PR uses
Path.resolve()on both sides.