Always show agent selection on entire enable#443
Conversation
Previously, running `entire enable` when already set up would print "Already enabled. Everything looks good." and exit immediately. This prevented users from modifying their agent selection on subsequent runs. Remove the isFullyEnabled() early return so the command always proceeds to agent selection. Simplify isFullyEnabled() to return just bool since the extra return values are no longer needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: d1999de90630
On subsequent runs (hooks already installed), detectOrSelectAgent now always shows the interactive multi-select prompt instead of auto-using the single detected agent. Agents with hooks already installed are pre-selected alongside any newly detected agents. On first run (no hooks installed), behavior is unchanged: single detected agent auto-uses, multiple/none shows the prompt. Non-interactive fallback (no TTY) on re-run keeps the currently installed agents rather than falling back to detection only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: f9a59793ef8e
When a user re-runs `entire enable` and deselects a previously active agent, the agent's hooks are now removed. This is handled by the new uninstallDeselectedAgentHooks helper which compares currently installed agents against the new selection. Called from both runEnableInteractive and runEnableWithStrategy before installing hooks for newly selected agents. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 1430640d8159
There was a problem hiding this comment.
Pull request overview
This PR updates the entire enable flow so that re-running the command always surfaces agent selection (instead of exiting early), and it supports uninstalling hooks for agents that the user deselects during reconfiguration.
Changes:
- Removed the “Already enabled” early-exit path so
entire enablealways proceeds to agent selection. - Updated agent detection/selection to treat “re-run” differently (prompt with pre-selected installed + newly detected agents; no-TTY re-run preserves installed agents).
- Added hook cleanup logic to uninstall hooks for deselected agents, plus tests covering re-run prompting, no-TTY re-runs, and deselection uninstall.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cmd/entire/cli/setup.go |
Removes early exit, adds deselection-uninstall behavior, and adjusts agent selection logic for re-runs vs first runs. |
cmd/entire/cli/setup_test.go |
Updates isFullyEnabled tests for new signature and adds new test coverage for re-run selection + uninstalling deselected agent hooks. |
PR SummaryMedium Risk Overview Adds re-run behavior to Introduces cleanup via Written by Cursor Bugbot for commit 44dd933. Configure here. |
Review feedback addressed: - Remove dead isFullyEnabled() function (no production callers after removing the early exit) - Document that --agent flag intentionally skips deselection cleanup (it's a targeted single-agent operation, not a full re-selection) - Rename isReRun → hasInstalledHooks for clarity - Add writeGeminiHooksFixture helper for multi-agent test scenarios - Add test: multi-agent installed, deselect one (keeps other) - Add test: newly detected agent is pre-selected on re-run - Add test: empty selection on re-run returns error - Add comments to fixture helpers explaining minimal hook choice Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: f59e5a0d07ad
On re-run, detected-but-not-installed agents were added to the pre-selection set, causing previously deselected agents to appear checked again. Now only agents with hooks installed are pre-selected on re-run; detected agents still appear as options but unchecked. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 00fe8c62aefe
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: ceeb3ba1f535
Instead of crashing with a hard error after submission, the form now shows an inline message and keeps the prompt open when no agents are selected. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: e924fd03ad4e
Summary
entire enableno longer says "Already enabled" and exits when fully set up. It always proceeds to agent selection.Behavior
First run (no hooks installed)
Unchanged:
.claude/exists) → auto-uses itSubsequent runs (hooks already installed)
New behavior:
.gemini/added since last run) are also pre-selectedNon-interactive (no TTY)
Test plan
mise run fmt— passesmise run lint— passesmise run test:ci— all tests pass (unit + integration).claude/— auto-detects Claude Code🤖 Generated with Claude Code