You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Pi extensions are installed even when Pi agent is disabled #7814
The Pi managed extensions are installed for every bare-shell PTY whenever Agent Status Hooks is enabled, regardless of the Pi agent being disabled in Settings > Agents.
Root cause — src/main/ipc/pty.tsbuildPtyHostEnv (~L964-971) gates the Pi extension install ONLY on opts.agentStatusHooksEnabled + piAgentKind === 'pi'. piAgentKind (src/shared/pi-agent-kind.tsdetectPiAgentKindFromCommand) defaults to 'pi' for any non-OMP / bare-shell command. Neither the pty:spawn handler nor buildPtyHostEnv ever reads the per-agent disabledTuiAgents / isTuiAgentEnabled setting — a grep shows those symbols exist only in src/renderer. So piTitlebarExtensionService.buildPtyEnv(id, …, 'pi') still runs and unconditionally writes orca-agent-status.ts, orca-prefill.ts, orca-titlebar-spinner.ts (src/main/pi/titlebar-extension-service.tsinstallManagedExtensions).
Re-run:
pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/repro-7814-pi-extensions-installed-when-disabled.test.ts
The test drives a real bare-shell pty:spawn with getSettings()->{ agentStatusHooksEnabled: true, disabledTuiAgents: ['pi'] }. Key assertion (passes, encoding the bug):
expect(piBuildPtyEnvMock).toHaveBeenCalledWith(expect.any(String),undefined,'pi')expect(env.ORCA_PI_SOURCE_AGENT_DIR).toBe('/tmp/default-pi-agent')// Pi env injected into the PTY
Contrast case confirms the ONLY working gate is the global agentStatusHooksEnabled toggle (with it off, piBuildPtyEnvMock is not called). 2/2 tests pass.
A fix would gate the piAgentKind === 'pi' (and OMP) install branch on isTuiAgentEnabled(settings, kind) — threading the per-agent disable flag into BuildPtyHostEnvOptions the same way agentStatusHooksEnabled already is — after which piBuildPtyEnvMock would not be called with 'pi' in this scenario.
Reproduced on macOS (Darwin 24.6) with Orca 1.4.159.
I disabled these unused Agent integrations in Orca, fully exited Orca, removed their configuration roots, and relaunched Orca. The relaunch used a new PID and runtime ID. Orca recreated every root below:
~/.commandcode
~/.config/amp
~/.config/devin
~/.factory
~/.gemini
~/.copilot
~/.grok
~/.hermes
~/.kimi-code
The regenerated contents are Orca-managed Hook registrations, plugins, or extensions; for example they reference ~/.orca/agent-hooks/..., and the Kimi block explicitly says managed by Orca; do not edit.
This reproduces after an Agent is disabled, so it is broader than the Pi-specific behavior described here. It also relates to #10196.
Expected behavior: a disabled Agent must not materialize its configuration root or install/write Orca-managed Hooks, plugins, or extensions during startup.
Orca was still preparing Pi's managed extension files for a plain terminal even after Pi was disabled in Settings. The PTY setup now carries the per-agent disabled list through every local and daemon spawn path and only installs managed extensions for enabled agents.
What changed
Gate Pi, OMP, and Prime managed-extension installation on disabledTuiAgents.
Thread the setting through local PTYs, daemon PTYs, and runtime preflight.
Add regression coverage for direct environment assembly and a real bare-PTY spawn.
Proof
pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-spawn-env-terminal-basics.test.ts — 32 passed.
pnpm tc:node — passed.
pnpm run check:code-quality:changed — passed with 0 findings.
git diff --check — passed.
The regression exercises the same spawnAndGetEnv path used by a bare terminal and verifies Pi's extension installer is not called when Pi is disabled.
No visual proof applies: this is filesystem/process-environment setup with no rendered UI change.
Readiness checklist
Functional correctness: disabled agents receive no managed extensions.
Scope: only PTY extension selection and its tests changed.
Compatibility: absent disabledTuiAgents preserves the existing enabled behavior.
Cross-platform: local, daemon, and runtime spawn paths share the same gate.
User-facing trade-offs: disabling an agent no longer writes its Orca-managed files; enabled agents are unchanged.
Activity
nwparker commentedon Jul 21, 2026
Reproduced on current tree (
main-based).The Pi managed extensions are installed for every bare-shell PTY whenever Agent Status Hooks is enabled, regardless of the Pi agent being disabled in Settings > Agents.
Root cause —
src/main/ipc/pty.tsbuildPtyHostEnv(~L964-971) gates the Pi extension install ONLY onopts.agentStatusHooksEnabled+piAgentKind === 'pi'.piAgentKind(src/shared/pi-agent-kind.tsdetectPiAgentKindFromCommand) defaults to'pi'for any non-OMP / bare-shell command. Neither thepty:spawnhandler norbuildPtyHostEnvever reads the per-agentdisabledTuiAgents/isTuiAgentEnabledsetting — agrepshows those symbols exist only insrc/renderer. SopiTitlebarExtensionService.buildPtyEnv(id, …, 'pi')still runs and unconditionally writesorca-agent-status.ts,orca-prefill.ts,orca-titlebar-spinner.ts(src/main/pi/titlebar-extension-service.tsinstallManagedExtensions).Re-run:
The test drives a real bare-shell
pty:spawnwithgetSettings()->{ agentStatusHooksEnabled: true, disabledTuiAgents: ['pi'] }. Key assertion (passes, encoding the bug):Contrast case confirms the ONLY working gate is the global
agentStatusHooksEnabledtoggle (with it off,piBuildPtyEnvMockis not called). 2/2 tests pass.A fix would gate the
piAgentKind === 'pi'(and OMP) install branch onisTuiAgentEnabled(settings, kind)— threading the per-agent disable flag intoBuildPtyHostEnvOptionsthe same wayagentStatusHooksEnabledalready is — after whichpiBuildPtyEnvMockwould not be called with'pi'in this scenario.arch3rPro commentedon Jul 30, 2026
Reproduced on macOS (Darwin 24.6) with Orca 1.4.159.
I disabled these unused Agent integrations in Orca, fully exited Orca, removed their configuration roots, and relaunched Orca. The relaunch used a new PID and runtime ID. Orca recreated every root below:
~/.commandcode~/.config/amp~/.config/devin~/.factory~/.gemini~/.copilot~/.grok~/.hermes~/.kimi-codeThe regenerated contents are Orca-managed Hook registrations, plugins, or extensions; for example they reference
~/.orca/agent-hooks/..., and the Kimi block explicitly saysmanaged by Orca; do not edit.This reproduces after an Agent is disabled, so it is broader than the Pi-specific behavior described here. It also relates to #10196.
Expected behavior: a disabled Agent must not materialize its configuration root or install/write Orca-managed Hooks, plugins, or extensions during startup.
nwparker commentedon Sep 19, 2026
Fixes #7814.
ELI5
Orca was still preparing Pi's managed extension files for a plain terminal even after Pi was disabled in Settings. The PTY setup now carries the per-agent disabled list through every local and daemon spawn path and only installs managed extensions for enabled agents.
What changed
disabledTuiAgents.Proof
pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/pty-spawn-env-terminal-basics.test.ts— 32 passed.pnpm tc:node— passed.pnpm run check:code-quality:changed— passed with 0 findings.git diff --check— passed.spawnAndGetEnvpath used by a bare terminal and verifies Pi's extension installer is not called when Pi is disabled.No visual proof applies: this is filesystem/process-environment setup with no rendered UI change.
Readiness checklist
disabledTuiAgentspreserves the existing enabled behavior.