fix(codex): restore Windows shim caller token state - #3956
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughWindows CMD and PowerShell shims now restore the caller’s ChangesWindows shim token restoration
Estimated code review effort: 3 (Moderate) | ~20 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Explicit security review record for head The owner authorized agent-assisted maintainer delivery of this scoped change. Independent Astra high source/security review and main-agent source verification found no blocking issue. Production shim bytes match the contributor head. We reviewed token presence/value restoration, nested CMD scope and batch handoff, PowerShell finally and exit status, escaped fixture paths, no-timeout failure oracles, and preservation of existing-installation ownership. Codex and descendants intentionally remain token recipients. No real account or token was used. This records the explicit security review and sponsorship decision for this revision. It is not a claim of a separate human approval or passing Windows execution. Required PR checks and exact-head workflow_dispatch lane=all (six Windows shards plus macOS control) remain merge gates. Any source change reopens this review. |
|
✅ Deterministic PR hygiene checks passed. |
리뷰 · 우선순위 66 / 80이 PR은 Windows Codex shim이 끝난 뒤 호출자 셸에 서비스에서 읽은 고치는 방법은 단순합니다. CMD는 스크립트 맨 위에 회귀 테스트는 라인 src/codex/shim.ts · buildWindowsCodexShim - 맨 위 라인 src/codex/shim.ts · buildWindowsPowerShellCodexShim - 경로 docs-site/.../lifecycle.md (5 locale) - 기존 shim은 자동으로 안 바뀐다는 점이 명확합니다. 업데이트만으로는 안 고쳐지니, 릴리스 노트나 트러블슈팅에 한 번 더 짚을지는 선택입니다. 경로 tests/codex-integration/codex-shim.test.ts - 의미 있는 매트릭스입니다. Linux/macOS 호스트에서는 이 케이스가 전부 skip되므로, Windows CI 샤드가 이 head에서 실제로 도는지가 머지 게이트입니다. 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
(cherry picked from commit 06829fa)
…ation Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
5643743 to
d6f9eca
Compare
|
Refreshed candidate |
|
Owner-authorized dev-only maintainer integration for d6f9eca into 2ee9019. Independent source review PASS; exact-head hosted verification: 34178467225 pull_request: 19 success / 2 skip; 34178464441 workflow_dispatch: 26 success / 0 skip. Skips are not passing tests. Original failure history retained; no local product tests/build/typecheck/install. One fixture repair only, independently revertible squash. Independently reviewed fixture/voice changes in destination: tests/responses/responses-state.test.ts. Candidate-scoped evidence reused; whole combined-tree execution is not claimed. Remaining B candidate CI will verify the cumulative baseline. Actual landing is checked against precomputed merge tree, unchanged unrelated paths and fetched dev ancestry. This is agent-assisted maintainer integration, not a separate human approval. No unresolved threads or maintainer objections; ready-triggered optional review checks are not claimed as passed. |
Summary
Fix Windows Codex wrappers leaving a service-loaded token in the caller shell after Codex exits. CMD now scopes its environment; PowerShell restores the previous token presence/value in a finally block while preserving the Codex exit status. The change affects newly generated wrappers, and the five existing lifecycle guides explain how to recreate an older wrapper.
Carries #3909 from
06829fa566c5e9d688a934fd31d481227450828bonto current dev, preserving luvs01's original production patch. Regression coverage additionally separates explicit-token execution from bypass and checks exact caller state and completed nonzero failures after PowerShell exceptions. This PR contains only the Windows shim bug; other B-workstream fixes have independent PRs.Verification
--no-verify.git diff --checkpassed. Productionsrc/codex/shim.tsis byte-identical to the original source PR head. The newer dev documentation remains intact.5643743439ef4fe4ee7039d45f6bef4b5d88723d: no blocking findings; seven files covered. This is source review, not runtime or human review approval.ci.ymlworkflow dispatch withlane=allare required before landing. Ordinary PR CI skips Windows shards and macOS control; these skips are not passing Windows evidence.Checklist
Co-authored-by: luvs01 27862058+luvs01@users.noreply.github.com
Summary by CodeRabbit
New Features
OPENCODEX_API_AUTH_TOKENafter execution.Documentation
Bug Fixes