Add Pi Windows home-dir and package artifact regressions - #16
Add Pi Windows home-dir and package artifact regressions#16safzanpirani wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/cli/test/cli.test.ts">
<violation number="1" location="packages/cli/test/cli.test.ts:69">
P2: The new Pi default-home regression test is not isolated: it sets both HOME and USERPROFILE and does not clear PI_CODING_AGENT_DIR, so it can pass without strictly exercising Windows default-home discovery.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/cli/test/cli.test.ts">
<violation number="1" location="packages/cli/test/cli.test.ts:73">
P2: Windows env cleanup removes only exact-case keys, so mixed-case inherited `PI_CODING_AGENT_DIR` variants can leak into spawned CLI and break test isolation.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/cli/test/cli.test.ts">
<violation number="1" location="packages/cli/test/cli.test.ts:848">
P2: The mixed-case PI_CODING_AGENT_DIR regression test is ineffective on Windows because createHomeEnv sets PI_CODING_AGENT_DIR: undefined and createChildEnv deletes unset keys case-insensitively, which removes Pi_Coding_Agent_Dir before spawn. The CLI only sees default home env, so the test won't catch a regression that incorrectly honors the mixed-case variant.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| const result = await runCli( | ||
| ["--pi", "--format", "json", "--output", outputPath], | ||
| { | ||
| ...createHomeEnv(workspace), |
There was a problem hiding this comment.
P2: The mixed-case PI_CODING_AGENT_DIR regression test is ineffective on Windows because createHomeEnv sets PI_CODING_AGENT_DIR: undefined and createChildEnv deletes unset keys case-insensitively, which removes Pi_Coding_Agent_Dir before spawn. The CLI only sees default home env, so the test won't catch a regression that incorrectly honors the mixed-case variant.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/cli/test/cli.test.ts, line 848:
<comment>The mixed-case PI_CODING_AGENT_DIR regression test is ineffective on Windows because createHomeEnv sets PI_CODING_AGENT_DIR: undefined and createChildEnv deletes unset keys case-insensitively, which removes Pi_Coding_Agent_Dir before spawn. The CLI only sees default home env, so the test won't catch a regression that incorrectly honors the mixed-case variant.</comment>
<file context>
@@ -800,6 +821,49 @@ test("Pi discovers ~/.pi/agent/sessions from the default home directory layout",
+ const result = await runCli(
+ ["--pi", "--format", "json", "--output", outputPath],
+ {
+ ...createHomeEnv(workspace),
+ Pi_Coding_Agent_Dir: leakedPiAgentDir,
+ },
</file context>
Summary
~/.pi/agent/sessionslayout without settingPI_CODING_AGENT_DIRWhy
I dug into the Windows report and the current source tree does detect Pi usage correctly from
%USERPROFILE%\.pi\agent\sessions. The bigger issue is that the publishedslopmeter@latestartifact can drift from source, so this adds coverage for both the Windows default-home path and the package artifact itself.Validation
bun run --cwd packages/cli testSummary by cubic
Add regression coverage to ensure Pi works on Windows. Tests default home-dir discovery (
~/.pi/agent/sessions) with an isolated home env, ignores mixed-casePI_CODING_AGENT_DIRoverrides on Windows, and verifies the packed CLI still advertises and ships Pi support.Adds Windows-safe pack/extract helpers (
npm.cmd,tar.exe) so the release check runs on Windows.Written for commit 3fb71e2. Summary will update on new commits.