test(clients): assert the Pi override with join, not a POSIX separator - #2272
Conversation
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe route test now derives the expected ChangesRoute test path expectation
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This change makes the route test platform-neutral without changing production behavior, and the affected Windows test suite passes. No actionable merge-blocking risk remains beyond normal checks. Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. |
8575838 to
e580e7e
Compare
Ingwannu
left a comment
There was a problem hiding this comment.
Reviewed exact head e580e7e0001b5451c91b578e670c7940765d3fc6. The test-only change correctly derives the expected Pi models.json destination with the same platform-aware node:path.join contract as production, while retaining a non-tautological assertion that the override was honored.
Independent validation passed: bun test ./tests/management-client-config-route.test.ts (14/14) and repository typecheck. I found no code blocker. The PR is still draft with the readiness checklist at 0/4 and is now one integration commit behind dev; finish the checklist, refresh onto current dev, and let exact-head CI run before merge. This change has no Go-runtime counterpart.
`an accepted override still resolves through the route` hard-coded "/tmp/opencodex-pi-route-fixture/models.json". The resolver builds that destination with `join`, which is `\` on win32, so the case asserted the host's path separator rather than the override taking effect and was red on every Windows run: Expected: "/tmp/opencodex-pi-route-fixture/models.json" Received: "\tmp\opencodex-pi-route-fixture\models.json" Build the expectation with `join` from one binding shared with the env value. `join` is identity for this input on POSIX, so Linux and macOS are unchanged. The assertion still pins what it was written for: making `piAgentDir` ignore the override fails this case, so it did not become a tautology. Refs lidge-jun#2152.
e580e7e to
4fbfb27
Compare
리뷰 · 우선순위 29 / 80프로덕션은 이미 맞음. 지금 이 PR은 오버라이드 디렉터리 하나를 바인딩하고 기대를 draft=false. 체크리스트 4/4. 파일 하나. +8/-2. Windows 11 + Bun 1.3.14에서 해당 파일 14 pass. 로컬 풀수트 14029 중 이 한 장이 추가 실패였음. #2188 사이드카 이미 상대 경로 거절 케이스( 해결방안: 머지해라. 프로덕션 경로 손대지 말 것. 기대를 이 댓글은 grok-bot이 작성했습니다 |
Ingwannu
left a comment
There was a problem hiding this comment.
Approved exact head 4fbfb27d1da1e18d09cf3b8c521d0b2ec771f3cc.
I independently verified the owner/Grok recommendation. The change fixes only the Windows-specific test expectation by deriving the expected Pi destination with node:path.join; it does not call the production resolver from the assertion, so the override behavior remains genuinely tested rather than tautological. Production code is unchanged.
Local exact-head validation passed: 15/15 focused client-config route tests and repository typecheck. Cross-platform CI and React Doctor are green on this SHA. This test-only change has no Go-runtime counterpart.
|
Heads-up: this one is merged here but is not on
I checked the rest before saying anything — it looks like a one-off rather than something systematic. Every other merge of mine is still reachable from There is no revert commit for it, and #2265 merged the same morning is intact, so this reads as a force-push that dropped the merge rather than a decision to back it out. Nothing needed from you if you would rather restore it yourself. Otherwise I have the same eight lines ready to re-send against current |
Refs #2152.
What this fixes
tests/management-client-config-route.test.tshas one case that cannot pass on Windows:piConfigPathbuilds the destination withjoin(piAgentDir(env, home), "models.json"), andjoinemits\on win32. The expectation was a hard-coded POSIX string, so the case asserted the host's path separator rather than the thing it was written to prove — thatPI_CODING_AGENT_DIRtook effect instead of falling back to~/.pi/agent.The production behaviour is right; only the assertion was platform-bound.
The change
The expectation is now built with
joinfrom a single binding shared with the env value, so the override and the assertion cannot drift apart:joinis identity for this input on POSIX, so the Linux and macOS legs see the same string they see today:I used
joinrather than callingpiConfigPathin the test. Deriving the expectation from the same resolver that produced the value would have made the case pass no matter what the resolver did.Verification — Windows 11, Bun 1.3.14
Mutation-checked. Making
piAgentDirignorePI_CODING_AGENT_DIRentirely, keeping the new assertion:This case is among them, so it still pins the override taking effect rather than merely matching whatever the resolver returns.
How I found it
Running the full local suite on Windows: 14029 tests, this was the only failure. It is not in the four remaining failures listed on #2152, so it is an additional one in the same platform class rather than a duplicate of any of them.
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit