Skip to content

Detect Bun-managed Codex CLI - #82

Merged
hardbeat920 merged 1 commit into
hardbeat920:mainfrom
jagadhis:feat/managed-codex-cli-setup
Sep 14, 2026
Merged

Detect Bun-managed Codex CLI#82
hardbeat920 merged 1 commit into
hardbeat920:mainfrom
jagadhis:feat/managed-codex-cli-setup

Conversation

@jagadhis

@jagadhis jagadhis commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

What changed

MonoCode now checks ~/.bun/bin/codex when resolving the Codex CLI.

Why

Apps such as T3 can provision Codex in ~/.bun/bin, while GUI processes may not inherit that directory through PATH. MonoCode could therefore report an existing Codex installation as unavailable.

This is the discovery-only slice of #81. Downloading and executing an installer from the application is intentionally excluded and will require a separate review covering Windows support, integrity and update behavior, failure recovery, and the security boundary.

UI

No UI changes.

Checklist

  • I ran npm run check:rust
  • This PR is small and focused
  • I did not mix unrelated changes

Summary by CodeRabbit

  • Bug Fixes
    • Codex CLI detection now also supports installations located in the user’s ~/.bun/bin directory.

@hardbeat920

Copy link
Copy Markdown
Owner

Could we split this into two PRs?
Detecting ~/.bun/bin/codex is a small, safe fix we can land now.

Downloading and executing an installer from the application needs a separate review covering Windows support, integrity/update behavior, failure recovery, and the security boundary.

@jagadhis
jagadhis force-pushed the feat/managed-codex-cli-setup branch from 1d55a03 to e776fbb Compare September 13, 2026 02:17
@jagadhis jagadhis changed the title Add managed Codex CLI setup Detect Bun-managed Codex CLI Sep 13, 2026
@jagadhis

Copy link
Copy Markdown
Contributor Author

Split as requested. This PR now contains only the ~/.bun/bin/codex discovery change, rebased onto current main. The in-app installer, UI, bridge, and documentation changes have been removed and remain separate pending the broader Windows, integrity/update, recovery, and security review.

@coderabbitai

coderabbitai Bot commented Sep 13, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 2dd93e2f-0a9a-4a62-a0ed-549a2b7a2226

📥 Commits

Reviewing files that changed from the base of the PR and between 36d6d28 and e776fbb.

📒 Files selected for processing (1)
  • src-tauri/src/harness.rs

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The Codex resolver now checks ~/.bun/bin/codex in addition to its existing candidate paths.

Changes

Codex resolution

Layer / File(s) Summary
Bun-managed Codex path
src-tauri/src/harness.rs
resolve_codex now includes ~/.bun/bin/codex among the paths it checks.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~2 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: hardbeat920

Merge Risk: ⚪ Minimal · up to e776f

This change safely expands Codex discovery to Bun-managed installations without altering other provider behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The change satisfies the discovery objective in issue #81. src-tauri/src/harness.rs adds ~/.bun/bin/codex to resolve_codex candidates. The issue also requires an explicit Install Codex action, t… Implement or include the remaining #81 provider setup changes: the confirmed installer action, the specified installer environment, post-install provider and model refresh, and user-owned authentication guidance. If the work is intentionall…
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: detecting Codex installations managed by Bun.
Description check ✅ Passed The description includes the required What changed, Why, UI, and Checklist sections. It explains the scope and confirms that installer work is excluded. The checklist records npm run check:rust instea…
Out of Scope Changes check ✅ Passed The only reviewed change adds home.join(".bun/bin/codex") to the existing Codex CLI discovery candidates. This directly supports the existing-installation objective in issue #81. The summary reports…
Full details: Linked Issues check

Explanation

The change satisfies the discovery objective in issue #81. src-tauri/src/harness.rs adds ~/.bun/bin/codex to resolve_codex candidates. The issue also requires an explicit Install Codex action, the official installer flow with CODEX_INSTALL_DIR=~/.monocode/bin and CODEX_NON_INTERACTIVE=1, availability and model-catalog refresh after installation, and user-owned authentication. The PR summary states that installer, UI, authentication, and refresh changes remain outside this PR. Therefore, the complete coding requirements of #81 are not met by this PR.

Resolution

Implement or include the remaining #81 provider setup changes: the confirmed installer action, the specified installer environment, post-install provider and model refresh, and user-owned authentication guidance. If the work is intentionally split, link the follow-up implementation that completes these requirements.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@nulljosh nulljosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct and safe — adds ~/.bun/bin/codex as a candidate path alongside the existing npm-global/cargo/n entries in resolve_codex(). Matches the existing pattern exactly, no conflicts.

@hardbeat920
hardbeat920 merged commit b1a5850 into hardbeat920:main Sep 14, 2026
4 checks passed
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.

3 participants