Skip to content

[Bug][macOS] Bundled 2.68.0 ocx cannot load @napi-rs/keyring #6139

Description

@arikon

Client or integration

Other — OpenCodex desktop app's bundled ocx sidecar

Area

Installation or packaging

Summary

The ocx binary bundled in OpenCodex.app 2.68.0 reports that the OS keychain is unavailable because it cannot load @napi-rs/keyring. On an interactive macOS session, the bundled CLI should be able to load its declared keyring dependency and report Keychain availability (or a genuine OS credential-store error). This prevents the documented ocx provider keychain <name> store path from being used through the app's bundled runtime.

Reproduction

  1. Install OpenCodex.app 2.68.0 in /Applications on macOS arm64.

  2. Run from an unrelated working directory, with no globally installed ocx:

    cd /private/tmp
    /Applications/OpenCodex.app/Contents/MacOS/ocx --version
    /Applications/OpenCodex.app/Contents/MacOS/ocx provider keychain openai status
  3. The same output occurs from other working directories. This probe does not create or store a credential; the openai row is used only to inspect keychain availability.

Version

OpenCodex.app and bundled ocx: 2.68.0

Operating system

macOS 26.7, arm64

Provider and model

Not provider-specific; no model request is involved.

Logs or error output

opencodex 2.68.0
name: openai
store: none
keychainAvailable: false
keychainUnavailableReason: Cannot find module '@napi-rs/keyring'
Require stack:
- /$bunfs/root/ocx

The app bundle contains Contents/MacOS/ocx and opencodex-desktop; no @napi-rs/keyring or native keyring artifact was found under Contents by filename. The module-resolution error is the direct evidence; a missing build artifact is a likely packaging cause, not yet proven.

Checks

Activity

  1. added
    bugSomething isn't working
    cliCLI, config inject, packaging flags
    installInstallation or packaging
    platformOS/service/tray/ACL (Windows-heavy, not Windows-only)
    on Sep 27, 2026
  2. Ingwannu commented on Sep 28, 2026

    @Ingwannu
    Owner

    Confirmed as a packaging defect rather than an OS Keychain permission denial. The source dependency and Darwin native packages are declared, but the 2.68 desktop app’s Bun-bundled ocx sidecar cannot resolve @napi-rs/keyring when launched from an unrelated working directory. The fix needs to ship and resolve the platform native addon from the application bundle and add a packaged-app smoke test launched outside the bundle tree (for example /private/tmp), without writing credentials. Keeping this open while I prepare the packaging fix.

  3. Ingwannu commented on Sep 28, 2026

    @Ingwannu
    Owner

    Fix is now in draft PR #6161. It stages the target native addon outside Bun’s virtual filesystem, packages both Darwin architectures into the universal app, resolves only deterministic executable-relative paths, and adds a packaged-app keychain probe from an unrelated working directory. Focused tests/typecheck/structure checks are green locally under the resource cap; hosted macOS bundle CI and maintainer review are in progress.

  4. Ingwannu commented on Sep 28, 2026

    @Ingwannu
    Owner

    Correction/update for #6161: the packaged-app verifier now uses a bounded load-only keyring probe. It verifies that the signed sidecar can load the external native binding and expose both constructors from an unrelated cwd, but deliberately does not read or write an OS credential (avoiding Keychain consent-dialog dependence in CI). The universal macOS release job separately requires both arm64 and x64 addon resources before running that verifier.

  5. added
    priority: P1High: reproducible failure in a core path (routing, failover, account pool, streaming, usage, auth,
    on Sep 28, 2026
  6. Ingwannu commented on Sep 28, 2026

    @Ingwannu
    Owner

    Update: #6161 exact head 4475196 now has all hosted checks green across Linux/macOS/Windows packaging, keyring, desktop-shell and functional jobs. The implementation uses a load-only packaged binding proof and does not touch OS credentials. The PR remains draft pending @lidge-jun final maintainer review; this issue stays open until merge and packaged release verification.

  7. lidge-jun commented on Sep 29, 2026

    @lidge-jun
    Owner

    Fixed on dev by #6161: standalone and desktop builds now stage the platform keyring native addon outside Bun's virtual filesystem, and the packaged sidecar loads it from an unrelated working directory (CI macos widget + bundle and desktop shell probes on the merged head). Evidence limit: the packaged probe is load-only; an OS credential operation through the packaged app was not exercised in CI (separate keyring smoke jobs cover it from source). Ships in the next release; please reopen if the packaged app still cannot read the keyring.

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)priority: P1High: reproducible failure in a core path (routing, failover, account pool, streaming, usage, auth,

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions