fix(desktop): skip uninstalled agents when provisioning hooks

KI
2h ago
+201-2

What

Follow-up to #9219 for SUPER-3089. Desktop provisioning no longer writes hooks, settings or plugins into config dirs of agents the user has not installed (~/.codex, ~/.cursor, ~/.gemini, ...).

How

  • New isAgentInstalled in packages/agent-setup: an agent counts as installed when its binary is on PATH or in a usual install dir (~/.local/bin, ~/.bun/bin, Homebrew, ...), or its home config dir exists. Superset's own wrapper dir is ignored.
  • setupAgentIntegrations / setupAgentCapabilities take skipUninstalledAgents. Only desktop passes it; headless/CLI/cloud hosts keep provisioning every agent, so their behavior is unchanged.
  • Re-provision trigger: desktop re-runs provisioning on window focus (at most once a minute, only after post-onboarding setup ran). Installing Claude Code after Paradev picks up hooks without a restart.

Not changed

  • Managed skills (~/.agents/skills) and the zsh/bash wrappers still write after onboarding.
  • Disabled agents still get teardown, whether installed or not.

Verification

  • bun test in packages/agent-setup: new installed-agents.test.ts passes. Two shell-wrappers fallback tests fail in this sandbox, and they fail the same way on #9219's branch.
  • biome check clean; tsc --noEmit clean for agent-setup.
  • Not run in the real app. Focus re-provision is untested outside unit logic.

Stacked on #9219; retarget to main after it merges.


Summary by cubic

Follow-up to #9219: desktop provisioning no longer writes hooks, settings, or plugins into the config dirs of agents the user hasn't installed (~/.codex, ~/.cursor, ~/.gemini, ...). Headless/CLI/cloud hosts still provision all agents, so their behavior is unchanged.

  • Skips agents with no binary on PATH, in a usual install dir (Homebrew, ~/.local/bin, ~/.bun/bin, ...), or no home config dir, and ignores Superset's own wrapper dir when searching.
  • Desktop re-runs provisioning on window focus, at most once a minute and only after onboarding, so installing an agent after Paradev picks up its hooks without a restart.
  • Managed skills (~/.agents/skills) and the zsh/bash wrappers still write after onboarding; disabled agents still get torn down whether installed or not.

This PR is stacked on #9219; retarget to main after it merges.