Skip to content

[Bug] ENOENT uv_cwd error dump when working directory is deleted and latest_unavailable in GUI #3400

Description

@agentHits

Client or integration

CLI

Area

CLI

Summary

Running ocx or ocx start from a working directory that has been deleted or unlinked causes two chained failures:

  1. Startup crash dump to stderr: in src/update/notify.ts and src/cli/star-prompt.ts, checking process.stdin.isTTY triggers Bun's lazy initialization of new tty.ReadStream(0). Bun's stream constructor attempts to validate path "" against process.cwd(). Because the working directory was unlinked, libuv's uv_cwd fails with ENOENT: process.cwd failed with error no such file or directory, uv_cwd.
  2. Dashboard update check failure: the proxy daemon remains running in the background with a deleted cwd. When the GUI dashboard queries GET /api/update/check?tag=latest, the server executes spawnSync for npm view. Because the parent process cwd is deleted, spawnSync fails, returning latestVersion: null and reason "latest_unavailable". The dashboard displays: "Could not read the latest version from npm. Try again later."

Reproduction

  1. Open a terminal and create a temporary directory:
    mkdir -p /tmp/stale-workdir && cd /tmp/stale-workdir
  2. Remove that directory from another process or terminal window:
    rmdir /tmp/stale-workdir
  3. Run ocx start in the original terminal.
  4. Observe the ENOENT process.cwd error dump from internal:fs/streams via interactiveGuardOk.
  5. Open the dashboard update modal at http://localhost:10100/ and observe that the latest version check fails with reason latest_unavailable.

Version

2.41.0

Operating system

macOS 15.x / Linux / POSIX

Provider and model

N/A

Logs or error output

53 | function ReadStream(path, options) {
54 |   if (!(this instanceof ReadStream))
55 |     return new ReadStream(path, options);
56 |   options = copyObject(getStreamOptions(options)), options.decodeStrings = !0;
57 |   let { fd, autoClose, fs: customFs, start, end = @Infinity } = options;
58 |     this[kFs] = customFs || fs, this.fd = null, this.path = getValidatedPath(path);
                                                                                 ^
error: ENOENT: process.cwd failed with error no such file or directory, the current working directory was likely removed without changing the working directory, uv_cwd
      at ReadStream (internal:fs/streams:58:77)
      at new ReadStream (node:tty:11:23)
      at interactiveGuardOk (.../src/update/notify.ts:126:40)
      at shouldConsider (.../src/update/notify.ts:139:8)
      at maybeShowUpdatePrompt (.../src/update/notify.ts:233:22)
      at handleStart (.../src/cli/index.ts:310:9)

Redacted configuration

No response

Checks

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

Activity

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 flagsguiDashboard, tray, settings UI

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions