Repository navigation
fix(pi): do not install extensions for disabled agents - #21711
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe change adds optional Priority: ➖ Normal Severity of issue fixed: Medium 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
ℹ️ No critical issues — one cross-host gap and one type sharp edge.
Reviewed changes
- Local/daemon extension gating —
buildPtyHostEnvnow skips Pi/OMP/prime-agent managed-extension installs when the agent is indisabledTuiAgents(assembly.ts:66-71, gated at:160,:168,:182);clearPiAgentShadowEnvstill runs for all three kinds so no stale shadow env leaks. - Setting threading —
disabledTuiAgentsflows fromptySettingsinto all three spawn-env call sites (local-configure.ts:83,spawn-env-codex.ts:154,spawn-preflight.ts:280) and is added toBuildPtyHostEnvOptions. - Regression tests — direct
buildPtyHostEnvcases for disabled Pi and disabled OMP, plus a real bare-PTY spawn asserting Pi's installer is not called. The 32-test suite passes.
ℹ️ Disabled agents still receive managed extensions over SSH
The new gate sits in buildPtyHostEnv, so local and daemon-host spawns honor disabledTuiAgents. The SSH relay is a parallel installer that this PR does not touch: the host ships every Pi-family extension source to the remote relay, and the relay writes it based on the launched agent kind with no disabled-agent check. A disabled Pi/OMP/Prime therefore still gets orca-agent-status.ts under ~/.pi|.omp|.prime on an SSH target.
Technical details
# SSH relay installs are not gated by `disabledTuiAgents`
## Affected sites
- `src/main/ssh/ssh-relay-session.ts:1531` — `installPluginsOnRelay` ships `piExtensionSource` / `ompExtensionSource` / `primeAgentExtensionSource` unconditionally whenever `areAgentStatusHooksEnabled()` is true.
- `src/relay/relay-agent-hook-runtime.ts:81` — `buildPluginEnvironment` materializes by launched `kind` (default `pi`); the `PtyEnvAugmenter` context carries no disabled list.
- `src/relay/plugin-overlay.ts:293` — `materializePi` writes `<agentDir>/extensions/orca-agent-status.ts`.
## Required outcome
- Decide whether #7814 is local-only. If disabled agents should stay extension-free on every execution host, omit the disabled kinds' sources in `installPluginsOnRelay` (the host has `store.getSettings()`); if local-only, record SSH as a tracked follow-up so the behavior difference is intentional.
## Open questions for the human
- Is SSH deliberately out of scope for this fix, or should the source-shipping gate land here?ℹ️ Nitpicks
- The daemon call sites (
spawn-env-codex.ts,spawn-preflight.ts) add threading but no daemon-path regression test; a single assertion mirroring the local case would lock it in.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| wslDistro?: string | null | ||
| agentStatusHooksEnabled: boolean | ||
| /** Per-agent opt-out; disabled agents must not receive managed extensions. */ | ||
| disabledTuiAgents?: Iterable<unknown> | null |
There was a problem hiding this comment.
Iterable<unknown> is wider than what the gate can actually read: isTuiAgentEnabled delegates to normalizeDisabledTuiAgents, which returns [] for anything that is not an array. A future caller passing a Set would silently be treated as "nothing disabled" and reinstall extensions for disabled agents — the exact bug this PR fixes. GlobalSettings.disabledTuiAgents is already TuiAgent[], so narrowing this option keeps the contract honest.
| disabledTuiAgents?: Iterable<unknown> | null | |
| disabledTuiAgents?: readonly TuiAgent[] | null |
|
Verification update: addressed the independent review finding in
Scope clarification: this PR fixes the original Pi/OMP disabled-extension startup path reported by #7814. It does not claim to suppress every possible root created by every other agent integration; those need separate launch-kind fixes. |
There was a problem hiding this comment.
ℹ️ No new issues in this delta — the fresh OMP config preservation is correct and covered.
Reviewed changes
This run covers the incremental delta 01f2415..52be58bf (two commits since the prior review).
- Preserve fresh OMP config when OMP is disabled — when the managed OMP status extension is skipped because OMP is in
disabledTuiAgents,buildPtyHostEnvnow falls through topiTitlebarExtensionService.buildFreshOmpEnv()on theshouldPrepareOmpShadowpath (assembly.ts:180-184), so a guarded fresh OMP launch still receivesORCA_OMP_FRESH_CONFIG. This mirrors the existing hooks-disabled branch at:208-210. - Regression coverage — the disabled-OMP direct-assembly test now captures the returned env and asserts
ORCA_OMP_FRESH_CONFIGis populated (pty-spawn-env-terminal-basics.test.ts:98).
The materialized fresh config lives under Orca's own userData (omp-managed-status-extension/fresh-session.yml), not ~/.omp, so it does not reintroduce the orca-*.ts extension files that #7814 targets. 72 focused PTY-spawn tests pass locally.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

Fixes #7814 (the original Pi/OMP disabled-extension startup path).
ELI5
Orca was still preparing Pi's managed extension files for a plain terminal even after Pi was disabled in Settings. PTY setup now carries the per-agent disabled list through every local and daemon spawn path and only installs managed extensions for enabled agents. Disabling OMP's status integration still leaves its guarded fresh-launch config available, so the setting does not prevent an explicit OMP launch.
What changed
disabledTuiAgents.ORCA_OMP_FRESH_CONFIGindependent from OMP status-extension installation.Proof
ORCA_BACKGROUND_LAUNCH=1 pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-spawn-env-terminal-basics.test.ts— 32 passed.ORCA_BACKGROUND_LAUNCH=1 pnpm tc:node— passed.ORCA_BACKGROUND_LAUNCH=1 pnpm run check:code-quality:changed— passed with 0 findings.git diff --check— passed.spawnAndGetEnvpath used by a bare terminal, verifies disabled Pi/OMP installers are not called, and verifies guarded OMP launch config remains populated.No visual proof applies: this is filesystem/process-environment setup with no rendered UI change.
Readiness checklist
disabledTuiAgentspreserves the existing enabled behavior.This addresses the original Pi/OMP report in #7814. Later comments about every other agent integration materializing roots are broader follow-up work and are not claimed as fixed here.