Repository navigation
Conversation
TestNoNofollowPlatform covers how session_pid_sig reads a mapping file where the platform has no O_NOFOLLOW, which is Windows, and simulates that on POSIX by deleting os.O_NOFOLLOW. monkeypatch.delattr raises when the attribute is absent, so on Windows all three tests failed before reaching the code and were strict xfails. Delete it with raising=False so Windows runs its own lstat pre-check and identity check, and mark the case that plants a symlink requires_symlinks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ⏭️ skippedRevision |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: this is a test-only change on an existing seam. It reuses the [DESIGN-REVIEWED] 65c06b2 Description read[DESCRIPTION-READ] 8edfe3eca90604133fc3ab58b654f6ec41dc1c296d527c1cbca7e1e6b50f7f5c That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
|
The three reds on
Coverage Gate then failed closed on those shards ( |
|
Closing as superseded by #25209, merged today. It makes the same change to the three |
Problem / Motivation
Goal: the tests for reading a session-pid mapping file without
O_NOFOLLOWrun on Windows, the platform that read path exists for, instead of failing there before they reach it.TestNoNofollowPlatformintest/test_session_pid_sig.pycoverssession_pid_sig._read_regular_nofollowon a platform withoutO_NOFOLLOW: anlstatpre-check that refuses a symlink, then a(st_dev, st_ino)identity check that refuses a file swapped in between thelstatand the open. Its docstring names Windows as that platform, and each test simulates it on POSIX withmonkeypatch.delattr("os.O_NOFOLLOW").delattrraisesAttributeErrorwhen the attribute is absent, which is the case on Windows. All three tests fail there at that line, and all three are strict xfails intest/windows-expected-failures.txt.Why it matters
The mapping directory is agent-writable, so these checks are what keep the trusted MCP process from following a planted symlink when it reads a session's pid mapping. On Windows they are the only defence, and today they run only on POSIX hosts that remove the flag to imitate Windows, never on the Windows matrix.
Not a goal
_read_regular_nofollowitself; no product code changes.osattribute: the rest already check for it first or are POSIX-only.What changed (motivation → approach → change)
AttributeError: module 'os' has no attribute 'O_NOFOLLOW'before reaching the code.os.O_NOFOLLOWto make a POSIX host look like Windows, andmonkeypatch.delattrrefuses to remove an attribute that is not there.test/test_session_pid_sig.py:delattr(..., raising=False). POSIX still removes the flag; Windows, which has none, runs its own path. The class docstring says so.test_symlink_present_at_lstat_refusedplants a real symlink, so it carriesrequires_symlinksfromconftest.py. GitHub's Windows runners hold the privilege and run it; a Windows host without it skips it instead of failing on WinError 1314.test/windows-expected-failures.txt.Backwards compatibility
Compatible: test-only; no product code changes.
Removes nothing: three strict-xfail lines go, and no assertion is dropped or loosened.
Tests
test/test_session_pid_sig.pyon a Windows host with the lines removed: 58 passed, 5 skipped, on Python 3.13.5 and on 3.12.13.test_regular_file_still_readsandtest_lstat_open_swap_refusednow pass there, the second because the identity check refuses the decoy the patchedlstatvetted. This host has no symlink privilege, sotest_symlink_present_at_lstat_refusedis among the skips and runs on the Windows matrix of this PR.AttributeErrorabove.check_comment_history,check_brand_name, andtest_flake_pattern_ratchet.py+test_windows_gap_list.py(65 passed) pass.git grep -n "delattr(" -- test/ src/, narrowed toosattributes, finds three other sites.test_embeddings_threads.pycheckshasattrfirst,test_platform_compat_group_privacy.pyskips withoutgetxattr, andtest_snapshot_merge_core_files_pinned.pyis POSIX-only by itspytestmark.test/windows-expected-failures.txt(test(windows): burn down six path-separator xfails #23777, test(windows): burn down the gateway-run xfails by patching the rlimit seam #23781, test(windows): pin USERPROFILE in the two subagent cwd tilde tests #23786, test(windows): write the materialize fixtures with LF, skip the symlink case #23788, test(windows): run the stdio probe's stderr stubs as Python scripts #23799, test(crew): give weak crew, agent and subagent tests real checks and merge twins #23887) are clean.Proof: not provable -- test-only change
Manual verification
N/A — test-only change; the Windows runs above are the check, and the Windows matrix runs these tests on this PR.
Related Issues
Fixes #24025
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
🤖 Generated with Claude Code