Skip to content

[Bug]: Intel-only gh makes local Apple Silicon environment appear disconnected #14590

Closed

Description

@camptx

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop (with a server-side error)

What happened

T3 Code showed my local MacBook as disconnected even though its backend was running on the same laptop. Opening General settings showed:

Reconnect Cesar’s MacBook Pro to change its settings.

The problem was an Intel-only gh executable left in /usr/local/bin on an Apple Silicon Mac. Running it directly failed with bad CPU type in executable. Installing native gh and fully restarting T3 fixed the connection.

Steps to reproduce

This is the configuration where I encountered the problem; I have not recreated it on a clean machine.

  1. On an Apple Silicon Mac, have an Intel-only gh on the PATH used by T3, with no working native version taking precedence. In my case it was /usr/local/bin/gh.
  2. Open T3 Code desktop and connect to the local environment.
  3. Open Settings → General for that environment.

Expected behavior

A GitHub CLI failure should report which executable failed and why. If GitHub CLI probing is optional, it should leave the local environment usable and mark GitHub integration unavailable.

Actual behavior

The local environment appeared disconnected. The settings page asked me to reconnect the laptop without showing the underlying error or a way to resolve it.

Impact

Major degradation: I could not access the environment’s settings until the CLI installation was fixed.

Version and environment

  • T3 Code desktop: 0.0.44
  • macOS: 27.0 (26A428), Apple Silicon / arm64
  • Environment: this same laptop, backend at http://127.0.0.1:3774
  • Failing CLI: Intel-only GitHub CLI 2.97.0 under /usr/local

Evidence

The backend responded over HTTP. Logs showed successful WebSocket authentication, followed by an error in the client’s server-config subscription:

EnvironmentAuth.authenticateWebSocketUpgrade: Success
RpcClient.subscribeServerConfig: spawn Unknown system error -86

Server traces also recorded spawn Unknown system error -86 in process execution and GitHub CLI calls. The local CLI check confirmed the incompatible executable:

$ uname -m
arm64

$ file /usr/local/bin/gh
/usr/local/bin/gh: Mach-O 64-bit executable x86_64

$ gh --version
zsh: bad CPU type in executable: gh

This suggests a CLI probe failure reaches the settings subscription and causes the environment to be treated as disconnected. I have not traced the code path, so that part still needs confirmation.

Workaround

Install native GitHub CLI, ensure it takes precedence on PATH, then fully quit and reopen T3 Code. In my case, installing gh with Apple Silicon Homebrew put it at /opt/homebrew/bin/gh and resolved the issue.

I also repaired an outdated background service from 0.0.42 to 0.0.44 first. That did not resolve the issue; replacing the incompatible gh executable and restarting did.

Offer to help

If a maintainer agrees this should be addressed, I’m happy to investigate and contribute a focused fix. Would you prefer isolating the CLI probe failure so the environment stays connected, surfacing the underlying error in the UI, or both? I’ll wait for agreement on the scope before starting.

Activity

  1. camptx commented on Oct 1, 2026

    @camptx
    Author

    One additional detail: I first encountered this issue after upgrading this laptop to macOS Golden Gate (27.0). I haven’t confirmed whether the upgrade caused the failure, but the timing may help with investigation.

  2. juliusmarminge commented on Oct 1, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Triage

    Thanks for the thorough report and the evidence. This is a real bug: a gh that's on PATH but can't run shouldn't make the local environment look disconnected.

    On macOS, errno -86 is EBADARCH. Node reports it as spawn Unknown system error -86, which is the same failure as bad CPU type in executable for the x86_64 /usr/local/bin/gh on your Apple Silicon machine. Command lookup only checks that the file exists and is executable, so a wrong-architecture binary passes and T3 treats gh as installed. GitHubCli.fromVcsError only turns a spawn failure into "GitHub CLI is not available" when the platform error is NotFound. Any other spawn failure, including a bad CPU type, becomes a generic "GitHub CLI command failed."

    The desktop client doesn't mark an environment as connected until subscribeServerConfig delivers its first snapshot, and if that call fails or the subscription dies later, the session closes. Settings shows "Reconnect {name} to change its settings" whenever the environment isn't in the connected set, and that message doesn't include the underlying error. That's the screen you hit, even though the backend was up and the websocket upgrade succeeded.

    A fatal error on the websocket applies to the whole connection, so it fails every in-flight call, including subscribeServerConfig. That fits your log, where authentication succeeds and then the config subscription dies with the same spawn error recorded on the GitHub CLI process spans. The config snapshot itself doesn't spawn gh (on 0.0.44 or on main), and source-control discovery does catch a probe failure and marks the CLI as missing, so the probe alone isn't supposed to drop the connection. The gap is that a gh that can't run can still show up as an environment disconnect instead of an integration failure. Updating past 0.0.44 won't fix it. Putting a native gh ahead of the Intel binary on PATH is the right workaround for now.

    macOS 27 could be why this started for you, if Rosetta had been running that /usr/local/bin/gh before. But any arm64 machine with a wrong-architecture gh earlier on PATH can hit it. No existing issue covers this.

    To your scope question: both parts you suggested are worth doing, and keeping the connection up is what unblocks Settings. The environment should stay connected when an optional CLI fails to spawn, and a bad CPU type should be treated the same as not installed. The error should name the executable and the reason (the path and the architecture mismatch), so GitHub integration shows as unavailable instead of asking you to reconnect the laptop. This is separate from configuring a custom CLI path. A focused PR that links this issue is very welcome.

  3. added
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 1, 2026
  4. delu999 commented on Oct 2, 2026

    @delu999

    I encountered the same issue on T3 Code Nightly 0.0.45-nightly.20261002.2572, macOS 27.0 (26A428), Apple Silicon (arm64). The local backend was running and listening on loopback, but the composer repeatedly showed “pc is reconnecting”.

    The gh executable resolved from T3’s PATH was an Intel-only Mach-O (x86_64). Running gh --version directly failed with bad CPU type in executable.

    The server traces recorded this sequence:

    processRunner.runProcessCore [process.command=gh]: spawn Unknown system error -86
    ws.rpc.server.discoverSourceControl: spawn Unknown system error -86
    RpcClient.subscribeServerConfig: spawn Unknown system error -86
    EnvironmentRpc.currentSession: pc is not connected.
    

    Replacing the incompatible executable at the same PATH location with the official macOS arm64 GitHub CLI 2.102.0 (download verified against the published SHA-256 checksum) resolved the problem. T3 reconnected automatically, without restarting the app. Subsequent ws.rpc.server.discoverSourceControl and EnvironmentRpc.currentSession calls succeeded, including repeated session calls over the following minutes.

    This confirms that the problem also affects the October 2 nightly. The incompatible local CLI explains the spawn failure, but T3 should keep the environment connected and show an actionable GitHub integration error when that optional executable cannot run.

  5. added
    needs more infoInitial triage showed no bug. Awaiting more info
    and removed
    needs more infoInitial triage showed no bug. Awaiting more info
    on Oct 22, 2026
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 is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions