Skip to content

Server reads login-shell PATH only at startup, so claude/codex installed afterwards stay "not found on PATH" until the server restarts #34354

Closed

Description

@pirut

What happened

On a macOS background-service install, Claude and Codex both showed as not installed: Claude Agent CLI (\claude`) was not found on PATH.andCould not start Codex CLI (`codex`). Both CLIs were installed in ~/.local/bin` and worked from the user's shell. The periodic provider health check kept failing every 5 minutes for about 17 hours. Restarting the service fixed it at once.

Diagnosis

fixPath() (apps/server/src/os-jank.ts) runs once at startup (apps/server/src/server.ts:866), merging PATH from zsh -ilc into process.env.PATH. Nothing re-reads it.

Timeline (Nov 10, local): 13:50 launchd service installed (plist PATH lacks ~/.local/bin); 14:35 server started on 0.1.9-nightly.20261110.4478 and read PATH; 14:39 Claude Code installed to ~/.local/bin; 14:40 ~/.zshrc gained export PATH="$HOME/.local/bin:$PATH"; 14:41 Codex installed to ~/.local/bin.

Provider re-checks resolve the CLIs against the stale 14:35 PATH, so they fail until restart. The probe itself is fine: the same zsh -ilc call with the service's environment returns ~/.local/bin in ~13 ms, so this is not the timeout in #22336/#30746/#10534.

Possible fix: re-read login-shell PATH (rate-limited) before a provider re-check when a binary is missing, or say a restart is needed.

Steps to reproduce

  1. macOS, zsh. Make sure ~/.local/bin is not on PATH in any shell startup file.
  2. Install and start T3 Code as the background service (installed here via npx t3).
  3. While the server is running, install Claude Code with the native installer (puts claude in ~/.local/bin and adds it to ~/.zshrc).
  4. In a new terminal, which claude works.
  5. In T3 Code, Settings → Providers → Claude shows "claude was not found on PATH". Waiting for the 5-minute health check does not help.
  6. Restart the service (launchctl kickstart -k gui/$(id -u)/com.t3tools.t3code.service). Claude is now detected.

Version

Server: 0.1.9-nightly.20261110.4478 (from /.well-known/t3/environment). The t3 triage CLI was 0.1.8. No commit on main through 2026-11-11 changes when PATH hydration runs (latest change to the probe: #32646, DEBUG-trap output).

Environment

  • macOS 27.2 (Darwin 27.2.0), arm64, Mac mini
  • zsh; ~/.local/bin added only in ~/.zshrc
  • T3 Code running as launchd background service (com.t3tools.t3code.service), connected from the desktop app on another Mac and over T3 Connect
  • Claude Code 2.1.322, Codex CLI 0.167.0 (both in ~/.local/bin)

Evidence

Provider cache before restart: claudeAgent `installed=false`, "`claude` was not found on PATH." (checkedAt 2026-11-11T12:47:34Z); codex `installed=false`, "Could not start Codex CLI".

`boot-service.log`: `Listening` at 14:35:03, then `WARN Claude Agent CLI health check failed. { errorTag: 'PlatformError' }` every 5 min until 07:47:34; after restart (`Listening` 07:52:01) both providers `installed=true status=ready`. No `[server] Failed to read PATH from login shell` warning, so the startup probe succeeded; it just ran before the PATH change.

Related issues

Fix applied or workaround

Restarting the server fixes it. As an extra safeguard I also added ~/.local/bin to EnvironmentVariables.PATH in ~/Library/LaunchAgents/com.t3tools.t3code.service.plist and reloaded it with launchctl bootout / bootstrap. Setting Settings → Providers → Binary path to the absolute path should also work.

Filed by

Claude Code (Claude Opus 5.5, claude-opus-5-5) via t3 triage.

Activity

  1. Igloczek commented on Nov 12, 2026

    @Igloczek

    Same root cause hit on the desktop app (not the service), with OpenCode, on 0.1.10-nightly.20261112.4564, macOS 27 arm64, zsh.

    Timeline (local): 11:12 reboot → 11:16 desktop launches, the zsh -ilc capture writes shell-environment-cache.json without ~/.opencode/bin (at that point the opencode export PATH line in ~/.zshrc was missing) → 11:20 opencode reinstall adds the line to ~/.zshrc → 11:21 the provider check still reports "OpenCode CLI (opencode) is not installed or not on PATH." The server's process.env.PATH matches the 11:16 cache exactly; zsh -lic 'command -v opencode' finds it straight away.

    On the desktop path the server is started with shellEnvironmentPrepared, so fixPath() skips its own read too. Nothing refreshes PATH until a full app restart. #23610 (merged after this nightly) lets Source Control Rescan refresh it, but provider re-checks still don't, so the "re-read before a provider re-check when the binary is missing" fix proposed here would cover the desktop case as well.

    Workaround: symlink the binary into a directory that's already on the captured PATH (e.g. ~/.local/bin), or restart T3 Code.

    Produced by Claude Opus 5.5 (Claude Code) following the T3 Code triage playbook.

  2. viktorce commented on Nov 20, 2026

    @viktorce
    Contributor

    This bug still reproduces on main at e6e1ce70c8 from 2026-11-20 on macOS.

    Reproduction

    I ran vp run dev and the web client on macOS 27.2.1 arm64 with zsh 5.9. I pointed the server's ZDOTDIR at a throwaway folder. Its .zshrc sets PATH and appends a line to a log each time zsh sources it. I set Claude's Binary path to claude-late and Codex's to codex-late. Neither name existed in any PATH folder. Settings → Providers showed both as "Not found".

    With the server running:

    1. I symlinked claude-late to the real Claude Code 2.1.311 and codex-late to the real Codex CLI 0.170.0 in one new folder. I appended that folder to PATH in the throwaway .zshrc. A new zsh -ilc ran both.
    2. I clicked "Refresh provider status" in Settings → Providers. The server checked both again and wrote a new checkedAt for both to the provider cache. Both still showed "Not found". The log had no new entry from the server, so the refresh did not start the login shell.
    3. I opened Settings → Source control & issues. The server process appended a log entry through the login shell re-read that fix(server): Rescan finds tools installed after T3 Code started #23610 added for source control discovery. I clicked "Refresh provider status" again. Codex showed as installed, v0.170.0. Claude still showed "Not found".
    4. I restarted the server without changing anything else. Both showed as installed, Claude v2.1.311 and Codex v0.170.0.

    Fix path

    In step 3, the source control re-read added the folder to the server's PATH, so the server found Codex, not Claude. Codex reads the server's live environment when it has no per-instance variables. apps/server/src/provider/Drivers/ClaudeDriver.ts:121 copies process.env at instance creation, so the server must rebuild a Claude instance.

    Since #37632 added refreshHostPath at apps/server/src/provider/ProviderRegistry.ts:750, fixing macOS and Linux is a small change in existing code. On refresh it re-reads PATH with a 10-second cache. When PATH gains a folder, it rebuilds enabled instances that are not installed. To read PATH, refreshHostPath calls only refreshWindowsPath at apps/server/src/os-jank.ts:225. On macOS and Linux, refreshWindowsPath returns false on its first line, so a refresh re-reads nothing. refreshPathFromLoginShell at apps/server/src/os-jank.ts:194 already re-reads the login shell. Only apps/server/src/sourceControl/SourceControlDiscovery.ts:83 calls it. Calling refreshPathFromLoginShell from refreshHostPath uses the refresh-only design from #34514, so nothing new runs on the 5-minute health check.

    On macOS and Linux, the source control re-read can add the folder to PATH before a refresh runs, as in step 3. Rebuilding only when the refresh's own PATH read adds a folder would miss a Claude instance that is still stale.

    I can send that as a small PR, or test any other fix on macOS.

    Tested with Claude Fable 5.2 in T3 Code. Written by Gemini 4 Neon.

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

    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