fix(scripts): run ocx-run commands in the requested workdir - #2474
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 (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
ChangesWorkdir execution
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR changes the runner to execute commands from the requested workdir and adds regression coverage for relative paths with spaces and CDPATH conflicts. Focused validation passes, and no actionable merge-blocking risk remains. 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. |
리뷰 · 우선순위 68 / 80설명: 이 풀 리퀘스트는 ocx-run 이 받은 작업 폴더에서 명령을 돌리게 고친다. 작성자는 luvs01 이다. 오늘 열여섯 시 십사 분에 열렸다. 포크 저장소에서 왔다. 초안이 아니다. 점검 네 칸이 다 채워졌다. 위생은 통과다. 베이스는 지금 HEAD 지금 HEAD 의 scripts/ocx-run 을 열었다. 16줄 쓰임새는 이름, 작업 폴더, 시간 한도, 명령이다. 23줄 보기에도 작업 폴더가 실행 자리로 적혀 있다. scripts/OCX-RUN.md 도 같은 뜻이다. 104줄에서 workdir 를 받는다. 105줄에서 그 폴더가 있는지만 본다. 128줄은 setsid timeout 으로 명령을 띄운다. 그 줄에 cd 가 없다. 그래서 명령은 호출한 쪽의 현재 폴더에서 돈다. 비대화 ssh 는 대개 집 폴더다. bun run test 가 저장소가 아니라 집에서 패키지를 찾는다. 작업 폴더 칸은 죽은 칸이다. 이 PR 은 128줄을 괄호로 감싼다. 먼저 CDPATH 를 비운다. 그 다음 cd -- 로 받은 작업 폴더로 들어간다. 그 다음 exec setsid timeout 이다. 부모 스크립트는 자리를 안 옮긴다. 로그와 상태와 잠금 파일은 절대 경로라서 그대로다. exec 가 중요하다. 빼면 백그라운드 아이디가 껍데기 번호가 된다. 88줄 cmd_stop 의 kill -TERM -$pid 가 타임아웃 무리 대신 껍데기 무리를 친다. 작업 제어가 꺼진 스크립트에서는 그 무리가 부모와 같다. 부모까지 죽을 수 있다. exec 는 반드시 남겨야 한다. CDPATH 를 비우는 것도 맞다. 상대 작업 폴더가 다른 맞는 폴더로 새면 안 된다. cd -- 는 이름 앞에 빼기가 있어도 버틴다. 시험은 리눅스에서만 돈다. 상대 경로에 빈칸이 있고, 같은 이름의 CDPATH 가짜 폴더가 있다. 명령은 pwd -P 다. 로그가 진짜 작업 폴더와 같아야 한다. 구멍의 중심을 잠근다. 다만 절대 경로, 빼기 이름, 시간 초과, 멈춤은 안 잠근다. exec 가 있으면 멈춤은 이론상 예전과 같다. 시험이 없을 뿐이다. 작성자 로컬은 윈도라서 이 시험이 건너뛰어졌다. 깃허브 점검 목록에는 위생, 라벨, 타깃, 토끼만 있다. Cross-platform CI 는 안 돌아갔다. 포크 첫 기여라서 승인 전에는 본 시험이 안 뜬다. 리눅스 CI 가 이 새 시험을 실제로 돌리기 전에는 머지하지 말 것. 운영 스크립트 구멍이라서 제품 사용자 길이보다는 낮다. 그래도 문서와 칸이 거짓말하는 상태라서 68. 점검 네 칸은 채워졌다. 베이스는 지금 HEAD 와 같다. 범위는 이 한 줄과 시험이다. types.ts/config.ts 가르기와 상관없다. 닫고 다시 밑지 말 것. 프리뷰 배포가 아니다. 2426 은 2473 이 착지하기 전에는 닫지 않는다. 2473 은 아직 초안이다. 2472 는 연다. 2463 과 2464 과 2465 는 구현 파일이 없어서 닫지 않는다. 2468 은 메인이라서 메인에 넣지 말 것. 2451 과 2467 과 2471 은 다시 열지 말 것. 카탈로그 팁은 Ox Alpha x-preview-f-free + deepseek-v4-flash-vision-exp. Cursor 정적 카탈로그는 opus-4-8-fast / opus-5-fast. 2334 CursorCredentialRouter 는 여전히 src/providers/cursor-pool.ts 모듈+테스트만 있고 어댑터에 연결되지 않았다. 2332 H2 는 discovery 전용. 2320 overflow + 2342 는 이미 dev. 2188 사이드카는 이미 dev. 2361 scripts/ocx-run 라인 104 - workdir 를 받는다. 이 칸이 실행 자리여야 한다 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
Summary
ocx-runjobs from the requested<workdir>instead of inheriting the SSH caller's current directory.exec setsid.CDPATHduring that directory change so relative workdirs cannot resolve to a different matching directory.CDPATHentry.Verification
Focused checks were run on exact head
e6cd33cf09aef3fd2230b9b55895a141ee792c98with Bun1.4.0-canary.1 (9fcdea80b):bun test tests/ocx-run.test.ts— 0 failed; the one GNU/Linux-only execution case was skipped on the Windows test host and will execute in Linux CIbun run typecheck— passedbun run privacy:scan— passedgit diff --checkand staged whitespace validation — passedThe repository-wide suite was not duplicated locally; this change is isolated to the Linux-only maintenance runner, and the focused regression plus relevant static gates are green.
Exact base:
c44e43f00f1b8001f30292067324fb419e5ffc86Exact head:
e6cd33cf09aef3fd2230b9b55895a141ee792c98Checklist
scripts/OCX-RUN.mdalready describes the requested workdir as the execution directory, so no wording change is needed.CDPATHis neutralized.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
Bug Fixes
CDPATHvalues no longer interfere with command execution.Tests