Skip to content

test(windows): pin USERPROFILE in the two subagent cwd tilde tests - #23786

Open
leonlaiyc wants to merge 1 commit into
kirodotdev:mainfrom
leonlaiyc:claude/windows-userprofile-xfails
Open

leonlaiyc wants to merge 1 commit into
kirodotdev:mainfrom
leonlaiyc:claude/windows-userprofile-xfails

Conversation

@leonlaiyc

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: the two subagent cwd tests that check ~ expansion run and pass on the Windows matrix instead of sitting in the strict-xfail list.

test/test_subagent_cwd.py::TestValidateCwd::test_tilde_expanded_in_allowed_roots and ::test_tilde_expanded_in_cwd pin HOME at tmp_path and expect validate_cwd to expand ~ under it. On Windows they fail:

assert "cwd is not under an allowed root: ['~/ws']" == ''
assert 'cwd does not exist or is not a directory' == ''

os.path.expanduser on Windows reads USERPROFILE, not HOME. The suite's home floor pins only KIROCREW_HOME, so ~ resolved to the real user profile and both paths fell outside the test's root. validate_cwd does what it should.

Why it matters

As strict xfails, neither test checks tilde expansion on Windows, where a user's ~/... cwd and allowed roots are expanded by exactly this code. Worse, an unpinned ~ points a test at the developer's real profile.

Not a goal

  • validate_cwd itself, or how it expands ~.
  • The other test files that pin HOME alone. Most are POSIX-only or pass HOME to a child process, and none of them is failing on Windows today.

What changed (motivation → approach → change)

  • Symptom: both tests fail on Windows with the path outside the root.
  • Root cause: HOME is pinned and USERPROFILE is not, so ~ is not the test's directory on Windows.
  • Change: each test also pins USERPROFILE at tmp_path, as pod_helpers.py, agent_home_isolation_helpers.py and member_essential_context_helpers.py already do beside HOME. On POSIX nothing changes. The two strict-xfail lines are gone from test/windows-expected-failures.txt.
  • The two lines sit right after the test_slack_gateway_run.py block that test(windows): burn down the gateway-run xfails by patching the rlimit seam #23781 removes, so whichever of the two merges second needs a one-line rebase of the list; I will do it.

Backwards compatibility

Compatible: test-only; no product code changes.

Removes nothing: two strict-xfail lines go, so these tests now run and assert on Windows, and no assertion is dropped.

Tests

Proof: not provable -- test-only change

Manual verification

N/A — test-only change; the Windows run above is the check, and the Windows matrix runs these tests on this PR.

Related Issues

Fixes #23785

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

🤖 Generated with Claude Code

@leonlaiyc
leonlaiyc requested review from a team and KiroCrewCaptain as code owners October 24, 2026 16:46
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention labels Oct 24, 2026
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 24, 2026
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ⏭️ skipped

Revision 2da95d92c12f947e74f114ef70f97d8eff63daae ships no reviewable capability (docs, tests or generated files only), so there is nothing to inventory. Does not block merge.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ⏭️ skipped

Revision 2da95d92c12f947e74f114ef70f97d8eff63daae touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 2da95d92c12f947e74f114ef70f97d8eff63daae via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: this is a test-only fix for the cause, and the Windows matrix runs both tests that leave the xfail list.

[DESIGN-REVIEWED] 2da95d9

Description read

[DESCRIPTION-READ] 54f0d7f22a4569d0cb292c8568c1ecc154f8d8e4ff7f433d410884c4bfccd0dc

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 463343236cf993c6c910bbbca58bee72404efee9 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 4633432

@github-actions

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 463343236cf993c6c910bbbca58bee72404efee9 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 4633432

@leonlaiyc

Copy link
Copy Markdown
Contributor Author

PR Readiness on 463343236c is still pending, waiting on Security Scope Review (not started), and that lane stopped on infrastructure, not on the code:

  • Fork Security Scope Review run 40114410361: the generate job's Checkout base (trusted) failed three times at 17:04 UTC with fatal: unable to access 'https://github.com/kirodotdev/KiroCrew/': Failed to connect to github.com port 443 ... Couldn't connect to server, and the job was cancelled at 35 minutes. The publish job then posted the [scope-floor:unsettled] failure ("the generate job did not finish").

Design Review passed for this head, and the Opus 5.5 and GPT 6.1 reviews have no blocking findings. A fork cannot re-run workflows: could a maintainer re-run run 40114410361?

Both tests pin HOME at tmp_path and then expect validate_cwd to expand
~ under it. On Windows os.path.expanduser reads USERPROFILE, not HOME,
and the suite's home floor pins only KIROCREW_HOME, so ~ resolved to
the real user profile: the cwd fell outside the test's root and both
were strict xfails. Pin USERPROFILE beside HOME, as the suite's other
home-redirecting tests do, and drop the two lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leonlaiyc
leonlaiyc force-pushed the claude/windows-userprofile-xfails branch from 4633432 to 2da95d9 Compare October 30, 2026 12:02
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 30, 2026
@leonlaiyc

Copy link
Copy Markdown
Contributor Author

Rebased onto main @ 118702f4d3; new head 2da95d92c1. The diff is unchanged in substance.

  • Conflict was only in test/windows-expected-failures.txt: main has since removed the neighbouring test_slack_gateway_run.py lines, and this PR deletes the two test_subagent_cwd.py lines. Neither set remains, so the PR's diff is still the same two deletions plus the two USERPROFILE pins in test/test_subagent_cwd.py.
  • On this Windows host: test/test_subagent_cwd.py 30 passed (the list applies, and no XPASS); test/test_ci_surface_tests.py 74 passed.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026

This branch has not been deployed

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

Labels

fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two subagent cwd tilde tests pin HOME but not USERPROFILE, so they are Windows xfails

1 participant