Skip to content

Fix Windows path assertion in colleague spawn test - #6

Merged
XYAIStudio merged 1 commit into
mainfrom
cursor/windows-spawn-path-assert-2a2d
Sep 15, 2026
Merged

XYAIStudio merged 1 commit into
mainfrom
cursor/windows-spawn-path-assert-2a2d

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 15, 2026

Copy link
Copy Markdown
Owner

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_row

The test compared Path.as_posix() (forward slashes) against AgentRow.config_json, which stores native Windows paths JSON-escaped as C:\\Users\\.... Production writes str(workspace) via json.dumps — that is the host-path contract used elsewhere, so this change fixes the test only.

The assertion now parses config_json and compares Path.resolve() objects, which is platform-safe on Windows and POSIX.

Target branch

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

Hotfix for Windows CI on main after #4 merged.

Type of change

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

Test plan

  • make all equivalent CI green (Linux + Windows)
  • Added/updated tests

Local:

  • pytest tests/unit/test_colleague_spawn.py — 1 passed
  • ruff check / ruff format --check on the test file — clean
  • Simulated Windows JSON: as_posix() is not a substring of json.dumps({"workspace_dir": r"C:\Users\..."}); parsed Path comparison succeeds

CI on this PR:

  • Python 3.12 — success
  • Windows / Python 3.12 — success
  • Live tests — success
  • CodeQL — success

Checklist

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

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.

Open in Web Open in Cursor 

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>
@XYAIStudio
XYAIStudio marked this pull request as ready for review September 15, 2026 05:16
@XYAIStudio
XYAIStudio merged commit d0f922e into main Sep 15, 2026
5 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