Skip to content

fix(server): provider refresh finds CLIs installed after launch on macOS and Linux - #40693

Merged
juliusmarminge merged 2 commits into
mainfrom
factory/issue-34354-a34365
Nov 22, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
factory/issue-34354-a34365

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

On macOS and Linux the server read the login-shell PATH only at startup. A claude or codex installed afterwards stayed "not found on PATH" through every provider refresh until the server restarted. A provider refresh now re-reads the login shell and rebuilds providers still missing their CLI whenever PATH has changed.

  • ProviderRegistry's host-PATH refresh now calls refreshPathFromLoginShell() alongside the Windows registry refresh.
  • Providers missing their CLI are rebuilt when PATH differs from what the registry last saw. A PATH already refreshed by Source control discovery then also reaches Claude, whose driver copies the environment when it is built.
  • Provider registry tests use a login shell that prints nothing, so they never read the developer's profile or change the test process's PATH.

Fixes #34354

Reproduction on main

Commit f9b19a7 (origin/main), Linux. Started T3CODE_DEV_SEED=0 vp run dev with SHELL pointing at a scratch login-shell wrapper that sources a scratch rc file and logs each read. Set Claude's Binary path to claude-late and Codex's to codex-late (neither on PATH). Settings → Providers showed both 'Not found'. Then put symlinks to the real claude/codex in a new folder and appended it to PATH in the rc file; a new -ilc login shell resolved both. Clicked 'Refresh provider status': the provider caches got a new checkedAt (05:35:22, after the rc change), both still installed=false ('Claude Agent CLI (claude) was not found on PATH.', 'Could not start Codex CLI (codex-late)'), and the rc log showed no read by the server. The server process's environment PATH had no entry for the new folder. Opening Settings → Source control & issues made the server read the login shell (rc log entry 05:35:51); the next refresh showed Codex installed v0.171.0 while Claude stayed 'not found on PATH'. Failing test: ProviderRegistry.test.ts 'rebuilds only instances missing their CLI when a refresh finds a new login-shell PATH' fails on main (PATH stays '/usr/bin', expected '/opt/late:/usr/bin'); the existing Windows row passes. A local change making refreshHostPath also call refreshPathFromLoginShell made both rows pass (not committed).

Evidence

Linux, Chromium, 1280×800, light theme; fresh isolated state on each commit. Configure claude-late and codex-late while absent from PATH, refresh to establish Not found, add their real CLI symlink folder to the login-shell profile, verify resolution in a new login shell, wait for Checked 1m ago, and refresh again without restarting.

Before After
Commit f9b19a7f85 29f11c3c3a
Initial state Base: both CLIs missing Head: both CLIs missing
After refresh Before: both remain Not found After: Claude v2.1.330 and Codex v0.171.0 discovered
Recording Before interaction After interaction

Scenario · Fixture setup · Runner proof

The runner exited 0: failsOnBase=true and passesOnHead=true. Limitation observed in an earlier run: refreshing again immediately after the initial check still leaves both missing on head because the PATH probe is cached for 10 seconds. The paired proof above waits beyond that cache.

Not shown:

  • macOS was not exercised; this proof used Linux.
  • Periodic health checks were not exercised; this proof used the explicit refresh button.
  • The path where Source control discovery refreshes PATH before provider refresh was not exercised.

Tests

  • vp test run src/provider/ProviderRegistry.test.ts -t "rebuilds only instances" on the repro branch before the fix: the login-shell row failed (expected '/opt/late:/usr/bin', got '/usr/bin') and the Windows row passed
  • vp test run src/provider/ProviderRegistry.test.ts src/provider/providerCompatibility.test.ts src/secrets/SecretCheck.test.ts src/sourceControl src/os-jank.test.ts: 9 files, 209 tests passed
  • vp run check:changed: format, lint, knip, graphql, typecheck (3 packages) and tests (3 files, 105 tests) all passed
  • CI on the pull request: all 8 required checks passed on 29f11c3

Not in this change

  • refreshWindowsPath still returns a boolean that ProviderRegistry no longer reads; left as is to keep the change small.
  • Provider registries built in other test suites (for example SecretCheck and server integration tests) can still spawn the real login shell if they trigger a refresh; none failed.
  • No end-to-end check in a running dev server; only the unit tests above.

Who did the work

  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
  • Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5

Run by the t3code factory in T3 Code.

juliusmarminge and others added 2 commits November 22, 2026 05:37
…OS and Linux

Failing test for #34354: refresh re-reads only the Windows registry PATH,
so a CLI installed after startup stays not found until the server restarts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cOS and Linux

Refreshing provider status re-read PATH only from the Windows registry, so
on macOS and Linux a claude or codex added to the shell profile after the
server started stayed "not found on PATH" until a restart. The refresh now
also re-reads the login shell, and rebuilds instances still missing their
CLI whenever PATH differs from what the registry last saw, so a PATH that
Source control discovery already refreshed also reaches Claude's driver.

Fixes #34354

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Other scenarios

All 64 scenario measurements match main.

All 64 scenario measurements
Provider Scenario Metric Main baseline This PR Impact PR ceiling
Codex short turn resume WebSocket decoded 10.5 KiB 10.5 KiB 0 B (0.0%) 12.7 KiB ✅
Codex short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn running, cold open HTTP decoded 281.7 KiB 281.7 KiB 0 B (0.0%) 302.7 KiB ✅
Codex long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Codex long turn running, history page HTTP decoded 92.4 KiB 92.4 KiB 0 B (0.0%) 107.4 KiB ✅
Codex long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Codex long turn finished, cold open HTTP decoded 381.5 KiB 381.5 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, socket cold open WebSocket decoded 381.6 KiB 381.6 KiB 0 B (0.0%) 410.2 KiB ✅
Codex long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Codex long turn finished, work page HTTP decoded 186.2 KiB 186.2 KiB 0 B (0.0%) 200.2 KiB ✅
Codex long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Codex idle thread resume WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell snapshot HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Codex fleet shell subscribe WebSocket decoded 65 B 65 B 0 B (0.0%) 200 B ✅
Codex fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Codex fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Codex fleet shell resume check rows 0 0 0 0 ✅
Codex stale shell reload HTTP decoded 42.4 KiB 42.4 KiB 0 B (0.0%) 53.7 KiB ✅
Codex stale shell reload rows 27 27 0 (0.0%) 27 ✅
Codex stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Codex stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Codex stale todo list cold open HTTP decoded 72.4 KiB 72.4 KiB 0 B (0.0%) 83.0 KiB ✅
Codex stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Codex stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Codex stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Codex stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅
Claude short turn resume WebSocket decoded 10.6 KiB 10.6 KiB 0 B (0.0%) 12.7 KiB ✅
Claude short turn resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn running, cold open HTTP decoded 283.3 KiB 283.3 KiB 0 B (0.0%) 302.7 KiB ✅
Claude long turn running, cold open rows 75 75 0 (0.0%) 75 ✅
Claude long turn running, history page HTTP decoded 93.4 KiB 93.4 KiB 0 B (0.0%) 107.4 KiB ✅
Claude long turn running, history page rows 75 75 0 (0.0%) 75 ✅
Claude long turn finished, cold open HTTP decoded 384.2 KiB 384.2 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, socket cold open WebSocket decoded 384.3 KiB 384.3 KiB 0 B (0.0%) 410.2 KiB ✅
Claude long turn finished, socket cold open WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude long turn finished, socket cold open rows 151 151 0 (0.0%) 151 ✅
Claude long turn finished, work page HTTP decoded 188.1 KiB 188.1 KiB 0 B (0.0%) 200.2 KiB ✅
Claude long turn finished, work page rows 150 150 0 (0.0%) 150 ✅
Claude idle thread resume WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude idle thread resume WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell snapshot HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude fleet shell snapshot rows 27 27 0 (0.0%) 27 ✅
Claude fleet shell subscribe WebSocket decoded 66 B 66 B 0 B (0.0%) 200 B ✅
Claude fleet shell subscribe WebSocket messages 1 1 0 (0.0%) 1 ✅
Claude fleet shell resume check HTTP decoded 18 B 18 B 0 B (0.0%) 100 B ✅
Claude fleet shell resume check rows 0 0 0 0 ✅
Claude stale shell reload HTTP decoded 43.0 KiB 43.0 KiB 0 B (0.0%) 53.7 KiB ✅
Claude stale shell reload rows 27 27 0 (0.0%) 27 ✅
Claude stale shell resume WebSocket decoded 140 B 140 B 0 B (0.0%) 400 B ✅
Claude stale shell resume WebSocket messages 2 2 0 (0.0%) 2 ✅
Claude stale todo list cold open HTTP decoded 73.4 KiB 73.4 KiB 0 B (0.0%) 83.0 KiB ✅
Claude stale todo list cold open rows 75 75 0 (0.0%) 75 ✅
Claude stale todo list cold open nodes 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open subagents 2 2 0 (0.0%) 4 ✅
Claude stale todo list cold open plans 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open providerTurns 1 1 0 (0.0%) 2 ✅
Claude stale todo list cold open checkpoints 1 1 0 (0.0%) 2 ✅

Baseline: 0fb6ac6 · PR result: 29f11c3 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Provider PATH refresh now checks Windows and login-shell PATH sources. When the observed PATH changes, the existing rebuild path can recreate eligible provider instances. Tests cover Windows and Linux PATH refresh behavior.

Changes: Provider PATH refresh

Layer / File(s) Summary
Refresh host PATH and validate provider rebuilds
apps/server/src/provider/ProviderRegistry.ts, apps/server/src/provider/ProviderRegistry.test.ts, apps/server/src/provider/providerCompatibility.test.ts
refreshHostPath refreshes Windows and login-shell PATH and reports whether PATH changed. Tests cover Windows and Linux PATH values and continue to check that only the instance missing its CLI is rebuilt. Test environments set SHELL to /usr/bin/true.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: dieterstemmet, macroscopeapp

Merge Risk: Minimal · up to 29f11

Provider refresh now re-reads the login-shell PATH and rebuilds providers still missing their CLI when PATH changes, so CLIs installed after server launch can be detected without a restart. No concrete merge-blocking defect remains after review.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: provider refresh now detects CLIs installed after launch on macOS and Linux. It follows the conventional commit form and matches the objectives and linked issue #3435…
Linked Issues check Passed Objective [#34354]: detect CLIs (claude, codex) installed after server startup without a server restart, or indicate that a restart is needed. At head, ProviderRegistry.ts refreshHostPath runs `refr…
Out of Scope Changes check Passed Changes at head are limited to the provider PATH refresh path and its tests. ProviderRegistry.ts adds the HostProcess and ChildProcessSpawner imports and the login-shell refresh with PATH comparison. …
Description check Passed The description covers the problem, the change, scope, and verification in detail. It explains that login-shell PATH is read only at startup on macOS and Linux, so CLIs installed later stay undetected…
Full details: Title check

Explanation

The title states the main change: provider refresh now detects CLIs installed after launch on macOS and Linux. It follows the conventional commit form and matches the objectives and linked issue #34354. It is specific and does not use vague terms.

Full details: Linked Issues check

Explanation

Objective [#34354]: detect CLIs (claude, codex) installed after server startup without a server restart, or indicate that a restart is needed. At head, ProviderRegistry.ts refreshHostPath runs refreshWindowsPath() and then refreshPathFromLoginShell() (imported from ../os-jank.ts). It compares the resulting host PATH with lastHostPathRef, the PATH last seen by the registry. When the PATH changed, it rebuilds enabled provider instances that are still uninstalled. Drivers copy the environment at build time, so the rebuilt instances use the new PATH. This covers the stale-PATH cause described in the issue. The issue suggested rate-limiting. The refresh path already shares one probe across a burst, as stated in the code comment, so no separate rate limit is added. The diff adds no new automated test for the login-shell case in this diff review. The PR description reports that the registry test 'rebuilds only instances missing their CLI when a refresh finds a new login-shell PATH' covers this path and that it passes. The PR also reports that no end-to-end check ran in a running dev server. The code path and the reported unit test support compliance. No non-coding requirement applies to this issue.

Full details: Out of Scope Changes check

Explanation

Changes at head are limited to the provider PATH refresh path and its tests. ProviderRegistry.ts adds the HostProcess and ChildProcessSpawner imports and the login-shell refresh with PATH comparison. ProviderRegistry.test.ts and providerCompatibility.test.ts set SHELL to /usr/bin/true so tests do not read the real login shell, and the PATH-refresh test covers the login-shell case. Each change connects to the objective in #34354. The PR description states that refreshWindowsPath's boolean return is now unused by ProviderRegistry and was left unchanged. This is a deliberate, limited choice and not an unrelated change.

Full details: Description check

Explanation

The description covers the problem, the change, scope, and verification in detail. It explains that login-shell PATH is read only at startup on macOS and Linux, so CLIs installed later stay undetected until restart. It describes the fix in ProviderRegistry (refreshHostPath calls refreshPathFromLoginShell and rebuilds providers missing their CLI when PATH changes) and links issue #34354. Verification includes a Linux reproduction on main, before/after evidence, and specific test commands with results. Gaps: the template asks for a conventional commit title, and the description does not show one. The description also notes macOS was not exercised and that Source control discovery was not exercised in the proof. The template also asks for model and harness information, which the description includes. Overall the description is mostly complete and matches the template.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 0fb6ac6 and 29f11c3.

Files selected for processing: 3

  • apps/server/src/provider/ProviderRegistry.test.ts
  • apps/server/src/provider/ProviderRegistry.ts
  • apps/server/src/provider/providerCompatibility.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@juliusmarminge
juliusmarminge merged commit 122d3bf into main Nov 22, 2026
39 checks passed
@juliusmarminge
juliusmarminge deleted the factory/issue-34354-a34365 branch November 22, 2026 06:14
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Nov 22, 2026
**v0.1.12-nightly.20261122.5085** · 20 changes from 10 contributors

- **Reliable image sends.** Messages now wait for images to finish uploading before sending.
- **Rich text pasting.** Paste text from Microsoft Word and other rich text apps into the composer instead of attaching an image.
- **Provider refresh.** Refresh providers to find newly installed Claude or Codex without restarting the server on macOS and Linux.
- **Scheduled task drafts.** Clicking outside the scheduled task editor no longer discards your draft.

### Plus 16 more bug fixes and performance improvements.

<details>
<summary>Full changelog</summary>

## What's Changed
* perf(shared): Windows command lookups reuse PATH listings across requests by @juliusmarminge in pingdotgg/t3code#40634
* fix(mcp): t3_thread_wait no longer has parents poll a task's first run by @navidnadali in pingdotgg/t3code#40633
* fix(server): reveal no longer opens Explorer's default folder for a missing file by @juliusmarminge in pingdotgg/t3code#40637
* fix(server): a steer that missed its turn keeps its place in the queue by @navidnadali in pingdotgg/t3code#40622
* fix(web): wrapped prompt suggestion no longer overlaps the composer toolbar by @juliusmarminge in pingdotgg/t3code#40654
* fix(server): refuse ref switches while a thread works in the shared checkout by @gbrasil720 in pingdotgg/t3code#38271
* fix(server): label speaker notes in OpenDocument attachments by @geezoria in pingdotgg/t3code#38542
* fix(server): folder discovery skips the walk when t3.json ignores the whole project by @juliusmarminge in pingdotgg/t3code#40664
* fix(server): checkpoint repository scopes walk the project folder once per turn by @Sidreyas in pingdotgg/t3code#40671
* fix(server,cursor): preserve inline handoff when a failed Cursor turn drops its prompt by @MIT-Consulting in pingdotgg/t3code#40670
* perf(web): Markdown renders with Words as static islands under one shared tooltip; remark leaves the web app by @juliusmarminge in pingdotgg/t3code#27866
* fix(web): pasting text copied from Word inserts the text instead of an image by @juliusmarminge in pingdotgg/t3code#40686
* fix(web): wait for image uploads before sending by @Yash-Singh1 in pingdotgg/t3code#40672
* fix(server): provider refresh finds CLIs installed after launch on macOS and Linux by @juliusmarminge in pingdotgg/t3code#40693
* fix(mobile): replace undefined text-foreground-subtle token with text-foreground-muted by @MIT-Consulting in pingdotgg/t3code#40676
* fix(antigravity): a long shell command keeps its start, not its last 8,000 characters by @juliusmarminge in pingdotgg/t3code#40702
* fix(server): setup script output no longer ends in half an emoji by @tiliakoos in pingdotgg/t3code#40701
* fix(server): text generation no longer falls back to a model that cannot generate text by @tiliakoos in pingdotgg/t3code#40699
* fix(client-runtime): typing a bare Windows drive lists its folders by @brunobola in pingdotgg/t3code#40682
* fix(web): a click outside the scheduled task editor no longer discards the draft by @Jardo-51 in pingdotgg/t3code#40708

## New Contributors
* @gbrasil720 made their first contribution in pingdotgg/t3code#38271
* @MIT-Consulting made their first contribution in pingdotgg/t3code#40670
* @brunobola made their first contribution in pingdotgg/t3code#40682

**Full Changelog**: pingdotgg/t3code@v0.1.12-nightly.20261122.5071...v0.1.12-nightly.20261122.5085

</details>


Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.1.12-nightly.20261122.5085
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant