MiMo-Code icon indicating copy to clipboard operation
MiMo-Code copied to clipboard

[macOS] mimocode 0.1.0 fails to start: vscode-jsonrpc IPC socket path hits sun_path limit → uncaught ENAMETOOLONG, cannot chat

Open braveheartforeverever-coder opened this issue 5 months ago • 2 comments

Summary

On macOS, a fresh install of mimocode 0.1.0 cannot chat at all. During startup bootstrap, the server-proxy creates a vscode-jsonrpc IPC unix socket whose path is deterministically 103 characters on macOS, which hits the sun_path limit and throws an uncaught ENAMETOOLONG. The model loop never finishes initializing, so messages are never sent. The TUI launches but is unusable (no response to input).

Environment

  • mimocode: 0.1.0 (installed via curl -fsSL https://mimo.xiaomi.com/install | bash, latest)
  • macOS 15.6.1 (24G90), Apple Silicon
  • Runtime: Bun (bundled)
  • Reproducibility: 100%, persists after fully wiping ~/.mimocode ~/.config/mimocode ~/.local/share/mimocode and reinstalling

Steps to reproduce

rm -rf ~/.mimocode ~/.config/mimocode ~/.local/share/mimocode
curl -fsSL https://mimo.xiaomi.com/install | bash
mimo                 # TUI starts but input does nothing
# or
mimo run "hello"     # hangs forever, no outbound model request ever made

Logs

In ~/.local/share/mimocode/log/*.log, immediately after creating instance / bootstrapping:

ERROR service=server-proxy e=ENAMETOOLONG: name too long, open   (rejection)
ERROR service=server-proxy e=ENAMETOOLONG: name too long, open   (rejection)

These come from the global process.on("unhandledRejection", ...) handler (uncaught). Afterwards only GET /session/status polling continues; sending a message produces no provider fetch and hangs indefinitely.

Root cause

The bundled vscode-jsonrpc IPC pipe generator (decompiled):

const limits = new Map([["linux", 107], ["darwin", 103]]);
function generateRandomPipeName() {
  const id = randomBytes(21).toString("hex");          // 42 chars
  let p;
  if (process.env.XDG_RUNTIME_DIR)
    p = join(XDG_RUNTIME_DIR, `vscode-ipc-${id}.sock`);
  else
    p = join(os.tmpdir(), `vscode-${id}.sock`);         // macOS path
  const max = limits.get("darwin");                     // 103
  if (max && p.length > max) console.warn(`WARNING: IPC handle "${p}" is longer than ${max}...`);
  return p;                                             // returns anyway; listen() then throws ENAMETOOLONG
}

On macOS:

  • os.tmpdir() = /var/folders/xx/<30-char>/T/ → fixed 49 chars (system-determined, constant length)
  • vscode- (7) + 42 hex + .sock (5) = 54 chars
  • Total = 103 chars, i.e. exactly the sun_path (104 bytes) minus the trailing \0 → the bind()/listen() fails with ENAMETOOLONG

Because the macOS /var/folders/.../T/ length is fixed, this triggers deterministically on every Mac. generateRandomPipeName() only console.warns instead of shortening or relocating, and the subsequent listen() rejection is never caught.

Workarounds that do NOT work

TMPDIR / BUN_TMPDIR / XDG_RUNTIME_DIR / MIMOCODE_HOME + all XDG_* pointed at a short dir, mimo run --pure, mimo upgrade (0.1.0 is latest) — none help; the socket creation does not honor these overrides at the point of failure.

Possibly related

Startup consistently warns:

WARN service=config NpmInstallFailedError (cause: @mimo-ai/plugin: No matching version found for @mimo-ai/[email protected].)

@mimo-ai/[email protected] does not exist on the npm registry — suggests the 0.1.0 release may be incomplete.

Suggested fix

  1. In generateRandomPipeName(), shorten the random id on macOS (e.g. randomBytes(8) instead of 21), or fall back to a shorter base dir (e.g. /tmp) when the generated path exceeds the limit — not just console.warn.
  2. Wrap the IPC listen() in try/catch with a readable error instead of an uncaught rejection that silently hangs.
  3. Fix the missing @mimo-ai/[email protected] npm publish.

Note

The MiMo account/key/network/model are all fine — calling https://token-plan-sgp.xiaomimimo.com/v1/chat/completions with the same key returns 200 normally. The failure is entirely in the client IPC layer.

Thanks

Khang org

Vào 20:55, CN, 14 thg 6, 2026 braveheartforeverever-coder < @.***> đã viết:

braveheartforeverever-coder created an issue (XiaomiMiMo/MiMo-Code#607) https://github.com/XiaomiMiMo/MiMo-Code/issues/607 Summary

On macOS, a fresh install of mimocode 0.1.0 cannot chat at all. During startup bootstrap, the server-proxy creates a vscode-jsonrpc IPC unix socket whose path is deterministically 103 characters on macOS, which hits the sun_path limit and throws an uncaught ENAMETOOLONG. The model loop never finishes initializing, so messages are never sent. The TUI launches but is unusable (no response to input). Environment

  • mimocode: 0.1.0 (installed via curl -fsSL https://mimo.xiaomi.com/install | bash, latest)
  • macOS 15.6.1 (24G90), Apple Silicon
  • Runtime: Bun (bundled)
  • Reproducibility: 100%, persists after fully wiping ~/.mimocode ~/.config/mimocode ~/.local/share/mimocode and reinstalling

Steps to reproduce

rm -rf ~/.mimocode ~/.config/mimocode ~/.local/share/mimocode curl -fsSL https://mimo.xiaomi.com/install | bash mimo # TUI starts but input does nothing# or mimo run "hello" # hangs forever, no outbound model request ever made

Logs

In ~/.local/share/mimocode/log/*.log, immediately after creating instance / bootstrapping:

ERROR service=server-proxy e=ENAMETOOLONG: name too long, open (rejection) ERROR service=server-proxy e=ENAMETOOLONG: name too long, open (rejection)

These come from the global process.on("unhandledRejection", ...) handler (uncaught). Afterwards only GET /session/status polling continues; sending a message produces no provider fetch and hangs indefinitely. Root cause

The bundled vscode-jsonrpc IPC pipe generator (decompiled):

const limits = new Map([["linux", 107], ["darwin", 103]]);function generateRandomPipeName() { const id = randomBytes(21).toString("hex"); // 42 chars let p; if (process.env.XDG_RUNTIME_DIR) p = join(XDG_RUNTIME_DIR, vscode-ipc-${id}.sock); else p = join(os.tmpdir(), vscode-${id}.sock); // macOS path const max = limits.get("darwin"); // 103 if (max && p.length > max) console.warn(WARNING: IPC handle "${p}" is longer than ${max}...); return p; // returns anyway; listen() then throws ENAMETOOLONG}

On macOS:

  • os.tmpdir() = /var/folders/xx/<30-char>/T/ → fixed 49 chars (system-determined, constant length)
  • vscode- (7) + 42 hex + .sock (5) = 54 chars
  • Total = 103 chars, i.e. exactly the sun_path (104 bytes) minus the trailing \0 → the bind()/listen() fails with ENAMETOOLONG

Because the macOS /var/folders/.../T/ length is fixed, this triggers deterministically on every Mac. generateRandomPipeName() only console.warns instead of shortening or relocating, and the subsequent listen() rejection is never caught. Workarounds that do NOT work

TMPDIR / BUN_TMPDIR / XDG_RUNTIME_DIR / MIMOCODE_HOME + all XDG_* pointed at a short dir, mimo run --pure, mimo upgrade (0.1.0 is latest) — none help; the socket creation does not honor these overrides at the point of failure. Possibly related

Startup consistently warns:

WARN service=config NpmInstallFailedError (cause: @mimo-ai/plugin: No matching version found for @@.***)

@@.*** does not exist on the npm registry — suggests the 0.1.0 release may be incomplete. Suggested fix

  1. In generateRandomPipeName(), shorten the random id on macOS (e.g. randomBytes(8) instead of 21), or fall back to a shorter base dir (e.g. /tmp) when the generated path exceeds the limit — not just console.warn.
  2. Wrap the IPC listen() in try/catch with a readable error instead of an uncaught rejection that silently hangs.
  3. Fix the missing @@.*** npm publish.

Note

The MiMo account/key/network/model are all fine — calling https://token-plan-sgp.xiaomimimo.com/v1/chat/completions with the same key returns 200 normally. The failure is entirely in the client IPC layer.

— Reply to this email directly, view it on GitHub https://github.com/XiaomiMiMo/MiMo-Code/issues/607?email_source=notifications&email_token=CD2HGD7KRRAFKSKJ2VPJBJT472VEFA5CNFSL4Z3JMQ5C6L3HNF2C22DVMIXUS43TOVSS6NBWGU4TGMZQGIYDTJTSMVQXG33OVJZXKYTTMNZGSYTFMSSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L, or unsubscribe https://github.com/notifications/unsubscribe-auth/CD2HGD7QVMLFRH3DOVR354D472VEFAVCNFSNUABGKJSXA33TNF2G64TZHMYTENRVGAZDKMBSHA5US43TOVSTWNBWGU4TGMZQGIYDTILWAI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

danhduykhan-code avatar Jun 15 '26 04:06 danhduykhan-code

Update: still reproduces on v0.1.1 (macOS).

Upgraded to 0.1.1 (fresh install). The TUI now renders the trust/confirm dialogs (an improvement over 0.1.0, which showed nothing), but after confirming "trust this directory", the input is still unusable — typing produces no response and no message is ever sent.

Logs for the 0.1.1 run still contain, right after bootstrap:

ERROR service=server-proxy e=ENAMETOOLONG: name too long, open (rejection)
ERROR service=server-proxy e=ENAMETOOLONG: name too long, open (rejection)

Caveat on my earlier root-cause claim: I also see the same ENAMETOOLONG rejection emitted by upstream opencode (1.14.31) on the same machine, and opencode otherwise works for many users — so this log line may be non-fatal noise rather than the direct cause of the hang. The user-visible bug, however, is real and unchanged: on macOS 15.6.1 (Apple Silicon), a fresh 0.1.1 install cannot send a single message; the TUI hangs after the trust prompt.

Repro is still 100% with:

rm -rf ~/.mimocode ~/.cache/mimocode && curl -fsSL https://mimo.xiaomi.com/install | bash
cd ~/some-project && mimo   # confirm trust, then input does nothing

Network/key/model are confirmed fine (direct curl to the model endpoint returns 200). Happy to provide full DEBUG logs if useful.