Skip to content

Fix Windows agent discovery and diagnose early Codex startup failures - #919

Merged
leeguooooo merged 2 commits into
mainfrom
fix/sidebar-windows-npm-discovery
Dec 2, 2026
Merged

leeguooooo merged 2 commits into
mainfrom
fix/sidebar-windows-npm-discovery

Conversation

@leeguooooo

@leeguooooo leeguooooo commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Refs #914 and #917.

The native host now searches for runnable Windows executables and npm batch launchers. It also searches the standard Node installation directory after inherited PATH entries. Both sidebar chat and status report when the selected Codex app-server closes before it answers initialization.

The implementation is the original commit from #917. This branch adds the corresponding English and Chinese sidebar documentation, troubleshooting text in CLI help, and bundled skill guidance.

Tests

On the dedicated macOS ARM64 build host, 335 agent-panel unit tests and all 11 native-host integration tests passed on commit 57aceb2e. The focused regressions cover a Windows npm layout and early disconnects in both chat and status. GitHub-hosted checks did not start because of the account billing lock. A retest on the original Windows 11 installation is still needed to confirm what triggered the reporter's failure. Cargo formatting and the whitespace check passed.

Browser behavior

This change concerns native executable discovery and diagnostics. The browser relay, launch flags, site permission rules and page interactions retain their existing implementation.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change expands Windows Codex executable discovery and reports a specific error when Codex closes before initialization. It adds tests for these paths and documents how to inspect Codex startup errors from a terminal.

Changes: Windows Codex startup diagnostics

Layer / File(s) Summary
Windows agent discovery
cli/src/agent_panel.rs, cli/tests/agent_panel_native.rs, README.md, README.zh.md, skill-data/core/references/connection.md
Windows discovery checks absolute directories derived from APPDATA, PNPM_HOME, and PROGRAMFILES. It searches .exe, .cmd, and .bat names and retains inherited PATH priority. Documentation describes launcher discovery and startup troubleshooting.
Codex startup-close handling
cli/src/agent_panel.rs, cli/src/agent_panel/backend.rs, cli/src/agent_panel/inspection.rs, cli/src/output.rs, cli/tests/agent_panel_native.rs, cli/tests/fixtures/panel_agent.py, docs/agent-panel.html, docs/en/agent-panel.html
Codex inspection and conversation flows use shared app-server arguments. They return a startup-specific error when Codex closes before initialization and retain the existing error behavior for later closes. Tests exercise the failure, and the documentation describes the terminal diagnostic command.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

Possibly related PRs

Suggested reviewers: euvoor

Merge Risk: Minimal · up to 57ace

This change improves Windows Codex discovery and adds clearer errors when Codex exits during startup. No concrete merge-blocking risk was found. A retest on a real Windows installation is still worthwhile.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description states the purpose: native host discovery of Windows executables and npm batch launchers, a Node install directory fallback after inherited PATH, and diagnostics when the Codex app-ser… 1. Tick the "Nothing here is visible to the pages chrome-use drives" option under Stealth mode, since the author's Browser behavior section says the change concerns native discovery and diagnostics. Or tick the other option and explain how …
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the two main changes: Windows agent discovery fixes and diagnostics for early Codex startup failures. The raw summary shows the code changes match both parts: discovery now searches AP…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the two main changes: Windows agent discovery fixes and diagnostics for early Codex startup failures. The raw summary shows the code changes match both parts: discovery now searches APPDATA\npm, PNPM_HOME, and PROGRAMFILES\nodejs after inherited PATH, and CODEX_STARTUP_CLOSED is returned when Codex closes before initialization. The title is 69 characters and 10 words, which is a little long but still specific and clear.

Full details: Description check

Explanation

The description states the purpose: native host discovery of Windows executables and npm batch launchers, a Node install directory fallback after inherited PATH, and diagnostics when the Codex app-server closes before answering initialization. It also lists the test results on a macOS ARM64 host and notes the GitHub checks did not run. The template's required sections are only partly filled. The "Stealth mode" section is missing, with neither checkbox ticked. The browser behavior section gives a reason the change is not page-visible, but it does not tick the template's option. The "Docs" section is not ticked, though the branch includes EN/ZH docs, CLI help, and skill-data updates. The CHANGELOG item is not addressed.

Resolution

  1. Tick the "Nothing here is visible to the pages chrome-use drives" option under Stealth mode, since the author's Browser behavior section says the change concerns native discovery and diagnostics. Or tick the other option and explain how it is gated. 2. Tick the Docs checkbox for the first item, because README (EN/ZH), skill-data, and docs/ (ZH and docs/en) were updated. 3. State whether CHANGELOG.md and the docs changelogs need updates for this release, and mark that item or explain why it does not apply. 4. Under Tests, name the specific Windows 11 retest status, or say it is pending, and keep the test scope clear.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cb68c4aa-938b-4319-aa9b-c494093f5a29
Commits

Reviewing files that changed from the base of the PR and between 6f8921a and 57aceb2.

Files selected for processing: 11

  • README.md
  • README.zh.md
  • cli/src/agent_panel.rs
  • cli/src/agent_panel/backend.rs
  • cli/src/agent_panel/inspection.rs
  • cli/src/output.rs
  • cli/tests/agent_panel_native.rs
  • cli/tests/fixtures/panel_agent.py
  • docs/agent-panel.html
  • docs/en/agent-panel.html
  • skill-data/core/references/connection.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@leeguooooo
leeguooooo merged commit f55ba00 into main Dec 2, 2026
13 of 17 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.

1 participant