Skip to content

[Bug]: Remote Link runs a stale npm/Bun ocx instead of the Desktop app's CLI on the Child and reports it as "too old" #6942

Closed

Description

@lidge-jun

Client or integration

OpenCodex dashboard

Area

Platform (Windows / macOS / Linux)

Summary

The Home runs every Child command through REMOTE_OCX_SCRIPT (src/link/ssh-argv.ts), which uses the non-interactive SSH PATH plus ~/.bun/bin:~/.local/bin:/opt/homebrew/bin:/usr/local/bin. It never looks in ~/.opencodex-desktop/bin or the app bundle. Desktop writes its PATH block only to interactive startup files (.zshrc, .bashrc; desktop/src-tauri/src/cli_command_posix.rs), which a non-interactive SSH session does not read. Any older npm or Bun install on the Child therefore wins over the Desktop CLI.

Two cases from one rollout:

  • macOS Child with OpenCodex.app 2.83.0 and a leftover Bun-global ocx whose shebang is #!/usr/bin/env node (no Node installed): the script resolves ~/.bun/bin/ocx and gets env: node: No such file or directory. env exits 127, the status the Home treats as "ocx was not found". The only fix was adding the Desktop bin directory to ~/.zshenv.
  • Windows machine with OpenCodex Desktop 2.77.0 installed: Test connection and host confirmation succeed, then the dashboard says "OpenCodex on the remote computer is too old … run ocx update … opencodex 2.58.0", because an npm-global 2.58.0 shim comes first on PATH. The advice is wrong twice: ocx update would target the npm install, and a current version would not make Windows a supported Child.

Reproduction

  1. On a macOS Child, install OpenCodex.app and keep an older npm/Bun-global ocx in ~/.bun/bin.
  2. From the Home: ssh <child> 'sh -c '\''PATH="$PATH:$HOME/.bun/bin:$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin"; command -v ocx; ocx --version'\'''
  3. Output: /Users/<user>/.bun/bin/ocx and env: node: No such file or directory. After adding ~/.opencodex-desktop/bin to ~/.zshenv, the same command prints the Desktop CLI and opencodex 2.83.0.
  4. Windows: Add Child for a host with Desktop installed plus an older npm-global ocx → "too old … opencodex 2.58.0".

Expected:

  • Look for Desktop CLIs (~/.opencodex-desktop/bin/ocx, /Applications/OpenCodex.app/Contents/MacOS/ocx, the deb's /usr/bin/ocx) before the generic directories, or have Desktop also publish a non-interactive PATH entry.
  • When the remote is Windows (MSYS/MINGW uname, or a Windows ocx), report that Windows Children are unsupported instead of "too old".

Version

Home 2.81.0 (OpenCodex Desktop); Children 2.83.0 (macOS Desktop) and 2.77.0 (Windows Desktop). REMOTE_OCX_SCRIPT is unchanged on dev 9b6f4b2632.

Operating system

Home macOS 27 arm64; Children macOS 27 arm64 and Windows 11 x64 (OpenSSH, Git Bash default shell)

Provider and model

No response

Logs or error output

/Users/<user>/.bun/bin/ocx
env: node: No such file or directory

원격 컴퓨터의 OpenCodex가 원격 연결을 쓰기에는 오래되었습니다. 그 컴퓨터에서 ocx update를 실행해 2.66.0 이상으로 올린 뒤 다시 시도하세요. 이유: opencodex 2.58.0

Screenshots and supporting files

No response

Redacted configuration

No response

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    cliCLI, config inject, packaging flags
    installInstallation or packaging
    platformOS/service/tray/ACL (Windows-heavy, not Windows-only)
    on Oct 11, 2026
  2. lidge-jun commented on Oct 11, 2026

    @lidge-jun
    OwnerAuthor

    Follow-up from the same rollout: a Windows Child works end to end once the PATH problem above is fixed, even though the guide lists Windows as outside the supported flow.

    Setup: Windows 11, OpenSSH server with Git Bash as the default shell, OpenCodex Desktop upgraded from 2.77.0 to 2.83.0 (MSI). The only blocker was an npm-global @bitkyc08/opencodex 2.58.0 under nvm that came before C:\Program Files\OpenCodex in the SSH session's PATH. The system Path holds the nvm entries, and Desktop only prepends to the user Path. After npm uninstall -g @bitkyc08/opencodex, REMOTE_OCX_SCRIPT resolved /c/Program Files/OpenCodex/ocx (2.83.0), and Add Child from the Home completed. After restarting the Child's proxy (see #6939), /healthz reported role: client and a /v1/responses request on the Child was relayed to and answered by the Home. The relaunched runtime stays under Desktop in the console session.

    So for Windows, the "too old" message is not just misleading: once ocx resolves to the Desktop CLI, the flow can actually succeed. A Windows-aware check could look for C:\Program Files\OpenCodex\ocx.exe first, or report that a stale ocx shadows the Desktop install.

  3. lidge-jun commented on Oct 11, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #6955 (squash 34bf006). Exact-head bfdfcb2: PR CI 38156344376 and Cross-platform CI lane=all 38156346377 succeeded (macos 1/2 needed one rerun after a 20-minute runner limit, with no failing test). Independent security/correctness review passed; no unresolved review threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcliCLI, config inject, packaging flagsinstallInstallation or packagingplatformOS/service/tray/ACL (Windows-heavy, not Windows-only)

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions