Skip to content

fix(server): keep provider CLIs available in the macOS service - #8173

Merged
t3dotgg merged 3 commits into
mainfrom
t3code/fix-launchd-provider-path
Aug 25, 2026
Merged

fix(server): keep provider CLIs available in the macOS service#8173
t3dotgg merged 3 commits into
mainfrom
t3code/fix-launchd-provider-path

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 25, 2026

Copy link
Copy Markdown
Member

The macOS background service starts with launchd's limited PATH, so Codex, Claude, and other provider CLIs disappear if login-shell PATH recovery fails.

Save the installer's PATH in the LaunchAgent, and fall back to the Node directory plus standard macOS binary directories when PATH is missing. Focused tests cover installation, XML escaping, fallback paths, and existing service restarts.

Built by GPT-5.6 Sol in the Codex harness.


Note

Medium Risk
Changes macOS service install and health-check behavior for a critical background daemon; incorrect PATH could break provider CLIs or mask real plist drift via normalization.

Overview
The macOS LaunchAgent plist now sets PATH in EnvironmentVariables, built from the installer’s PATH (with non–XML-safe segments removed), plus the Node binary directory and standard macOS tool locations when entries are missing.

renderBootServicePlist and the launchd wiring take a new environmentPath argument. status.current compares plist content with the PATH value blanked out so a different shell PATH at check time does not force a reinstall.

Tests cover preserved installer paths, empty/minimal PATH fallbacks, XML escaping for PATH, invalid path segments, and unchanged “current” status when only process PATH differs.

Reviewed by Cursor Bugbot for commit e2e1de2. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add PATH environment variable to macOS LaunchAgent plist in bootService

  • The macOS LaunchAgent plist now includes a PATH built from the installer's PATH, the host executable directory, and a fixed set of provider/system directories (/opt/homebrew/bin, /usr/local/bin, /usr/bin, /bin, /usr/sbin, /sbin)
  • Invalid PATH segments containing disallowed XML control characters are dropped, and duplicate directories are de-duplicated
  • renderBootServicePlist and launchdManager accept a new environmentPath option that flows through from make
  • BootService.status now strips the PATH value from both on-disk and freshly rendered plists before comparing, so a changed PATH alone does not mark the installed unit as stale
  • Behavioral Change: selectBootServiceManager and launchdManager now require environmentPath; callers that do not supply it will produce a plist without a PATH entry

Macroscope summarized e2e1de2.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a5b3eee7-5eb4-47c6-a3d1-84a6a25d4303

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 2026

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 13.3 KiB 13.3 KiB +30 B (+0.2%) 15.1 KiB
Codex Thread snapshot wire 6.9 KiB 6.9 KiB +4 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.4 KiB 6.4 KiB +26 B (+0.4%) 7.8 KiB
Codex Live turn WebSocket decoded 55.6 KiB 55.6 KiB +44 B (+0.1%) 66.4 KiB
Codex Live turn messages 10 11 +1 (+10.0%) 21
Claude Total thread wire 13.3 KiB 13.3 KiB −21 B (−0.2%) 15.1 KiB
Claude Thread snapshot wire 6.9 KiB 6.9 KiB +2 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.5 KiB 6.4 KiB −23 B (−0.3%) 7.8 KiB
Claude Live turn WebSocket decoded 56.4 KiB 56.4 KiB −44 B (−0.1%) 66.4 KiB
Claude Live turn messages 11 10 −1 (−9.1%) 21

Baseline: afc8342 · PR result: e2e1de2 · 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: 109.4 KiB
  • Claude decoded thread snapshot: 110.1 KiB

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

Comment thread apps/server/src/cloud/bootService.ts
Comment thread apps/server/src/cloud/bootService.ts
@macroscopeapp

macroscopeapp Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at e2e1de2

Macroscope's review found this PR approvable — The change is a narrowly scoped macOS service fix that preserves provider CLI lookup through a safely constructed LaunchAgent PATH, with focused coverage for fallbacks and status reconciliation. It does not alter Linux behavior, schemas, or unrelated runtime components.

You can add or adjust custom eligibility rules. Learn more.

Comment thread apps/server/src/cloud/bootService.ts Outdated
@t3dotgg
t3dotgg merged commit 1baf991 into main Aug 25, 2026
23 checks passed
@t3dotgg
t3dotgg deleted the t3code/fix-launchd-provider-path branch August 25, 2026 07:35
BarretoDiego added a commit to BarretoDiego/t3code that referenced this pull request Aug 25, 2026
- Providers no server: compatibilidade preservada após upgrades (pingdotgg#8176), CLIs disponíveis no serviço do macOS (pingdotgg#8173) e fim do probing do Cursor enquanto não estiver habilitado (pingdotgg#8175)
- Client-runtime: retry de queries após interrupção de conexão (pingdotgg#8117), com ajustes em authorization/remote e state/runtime
- Claude: compactação de threads antigas antes de estourar o uso (pingdotgg#8144), incluindo novo módulo claudeCompaction em packages/shared e medidor de janela de contexto na web
- Web: dicas de atalho de thread agora atrasadas em 200 ms (pingdotgg#8172)
- Grok: limite nas atualizações cumulativas de saída de ferramentas (pingdotgg#7279)
- Mobile: coleta de modelo de dispositivo e versão de SO (pingdotgg#8169)
- Docs: release passa a verificar atualizações remotas com migrações de banco (pingdotgg#8177) e doc de providers do Claude atualizada
- Conflitos: 2 arquivos conflitaram e foram resolvidos manualmente, mantendo as modificações próprias do fork e incorporando as mudanças do upstream por cima

Sync automatico t3code-sync em 2026-08-25T06:05:15-03:00
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 25, 2026
## What's Changed
* feat(mobile): track device models and OS versions by @t3dotgg in pingdotgg/t3code#8169
* fix(grok): bound cumulative tool output updates by @lnieuwenhuis in pingdotgg/t3code#7279
* fix(web): delay thread shortcut hints by 200 ms by @t3dotgg in pingdotgg/t3code#8172
* fix(server): stop probing Cursor until enabled by @t3dotgg in pingdotgg/t3code#8175
* docs(release): verify remote updates with database migrations by @t3dotgg in pingdotgg/t3code#8177
* fix(server): keep provider CLIs available in the macOS service by @t3dotgg in pingdotgg/t3code#8173
* feat(claude): compact old threads before they burn through usage by @t3dotgg in pingdotgg/t3code#8144
* fix(client-runtime): retry queries after connection interruption by @tris203 in pingdotgg/t3code#8117
* fix(server): keep previously used providers working after upgrades by @t3dotgg in pingdotgg/t3code#8176


**Full Changelog**: pingdotgg/t3code@v0.0.34-nightly.20260825.1182...v0.0.34-nightly.20260825.1183

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.34-nightly.20260825.1183
frankdavidcorona pushed a commit to frankdavidcorona/t3code that referenced this pull request Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant