Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Jan 30, 2026

Summary

  • The should respect CODEX_HOME env var test failed on the Windows CI runner because the implementation uses path.resolve() (which adds the drive letter, e.g. D:\), but the test expectation used path.join() (which does not)
  • Wraps the test's expected path with path.resolve() to match the implementation behavior on all platforms

Test plan

  • Verified tests pass locally
  • CI passes on all platforms (linux, macOS, Windows)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated test expectations for path normalization to ensure consistent handling of custom CODEX_HOME configurations.

✏️ Tip: You can customize this high-level summary in your review settings.

The test expected path.join('/custom/codex-home', ...) but the
implementation uses path.resolve() which adds the drive letter on
Windows (e.g. D:\). Align the test expectation with the implementation.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

A test expectation in the command-generation adapters test is updated to use path.resolve() for normalizing the CODEX_HOME path to an absolute path, replacing a direct path join operation.

Changes

Cohort / File(s) Summary
Test Path Normalization
test/core/command-generation/adapters.test.ts
Updated expected CODEX_HOME path assertion to use path.resolve() for absolute path resolution instead of direct path joining.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 A path once tangled, now so clear,
With resolve() the way is near,
From custom homes to absolute ground,
Our tests are tight, our logic sound! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: using path.resolve in the Codex adapter test for Windows compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/windows-codex-adapter-test-path

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

@greptile-apps
Copy link

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Fixed Windows test failure in should respect CODEX_HOME env var by wrapping the expected path with path.resolve() to match the implementation's behavior.

  • The implementation in src/core/command-generation/adapters/codex.ts:20 uses path.resolve() which normalizes paths to absolute paths with drive letters on Windows
  • The test expectation now uses path.join(path.resolve('/custom/codex-home'), 'prompts', 'opsx-explore.md') instead of path.join('/custom/codex-home', 'prompts', 'opsx-explore.md')
  • This ensures consistent behavior across all platforms (Linux, macOS, Windows)

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk - it's a focused test fix for Windows compatibility
  • Score reflects a simple, well-understood test fix that directly addresses a platform-specific test failure. The change correctly aligns test expectations with implementation behavior by wrapping the path with path.resolve() to match how the codex adapter normalizes paths on Windows
  • No files require special attention

Important Files Changed

Filename Overview
test/core/command-generation/adapters.test.ts Wrapped expected path with path.resolve() to match implementation behavior on Windows (adds drive letter)

Sequence Diagram

sequenceDiagram
    participant Test as Test Suite
    participant Adapter as codexAdapter
    participant Path as path module
    participant Env as process.env
    
    Test->>Env: Set CODEX_HOME='/custom/codex-home'
    Test->>Adapter: getFilePath('explore')
    Adapter->>Env: Read CODEX_HOME
    Env-->>Adapter: '/custom/codex-home'
    Adapter->>Path: resolve('/custom/codex-home')
    Note over Path: On Windows: adds drive letter<br/>(e.g., 'D:/custom/codex-home')
    Path-->>Adapter: Absolute path
    Adapter->>Path: join(absolutePath, 'prompts', 'opsx-explore.md')
    Path-->>Adapter: Full file path
    Adapter-->>Test: Return file path
    Test->>Path: resolve('/custom/codex-home')
    Note over Path: Test wraps expected path<br/>to match implementation
    Path-->>Test: Same absolute path
    Test->>Test: Assert paths match ✓
Loading

@TabishB TabishB merged commit 5e2e02c into main Jan 30, 2026
10 checks passed
@TabishB TabishB deleted the fix/windows-codex-adapter-test-path branch January 30, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants