Skip to content

Comments

Always show agent selection on entire enable#443

Merged
dipree merged 7 commits intomainfrom
feat/enable-always-shows-agent-selection
Feb 20, 2026
Merged

Always show agent selection on entire enable#443
dipree merged 7 commits intomainfrom
feat/enable-always-shows-agent-selection

Conversation

@dipree
Copy link
Contributor

@dipree dipree commented Feb 20, 2026

Summary

  • Remove early exit: entire enable no longer says "Already enabled" and exits when fully set up. It always proceeds to agent selection.
  • Re-run awareness: On subsequent runs (hooks already installed), the interactive agent multi-select is always shown with currently active agents pre-selected.
  • Deselection support: When a user deselects a previously active agent, its hooks are uninstalled.

Behavior

CleanShot 2026-02-20 at 12 59 32@2x CleanShot 2026-02-20 at 12 59 38@2x

First run (no hooks installed)

Unchanged:

  • Single detected agent (e.g., .claude/ exists) → auto-uses it
  • Multiple/no detected agents → shows interactive multi-select

Subsequent runs (hooks already installed)

New behavior:

  • Always shows the interactive agent multi-select
  • Agents with hooks already installed are pre-selected
  • Newly detected agents (e.g., .gemini/ added since last run) are also pre-selected
  • Deselecting an agent removes its hooks
  • Selecting a new agent installs its hooks

Non-interactive (no TTY)

  • First run: falls back to detected or default agent (unchanged)
  • Re-run: keeps currently installed agents (new)

Test plan

  • mise run fmt — passes
  • mise run lint — passes
  • mise run test:ci — all tests pass (unit + integration)
  • New tests cover re-run agent selection, no-TTY re-run, and deselected agent uninstall
  • Manual: first run in repo with .claude/ — auto-detects Claude Code
  • Manual: second run — shows multi-select with Claude Code pre-selected
  • Manual: deselect agent — hooks removed

🤖 Generated with Claude Code

dipree and others added 3 commits February 20, 2026 12:12
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
@dipree dipree requested a review from a team as a code owner February 20, 2026 11:15
Copilot AI review requested due to automatic review settings February 20, 2026 11:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 enable always 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.

@cursor
Copy link

cursor bot commented Feb 20, 2026

PR Summary

Medium Risk
Changes CLI enable flow and hook install/uninstall behavior; mistakes could remove agent hooks unexpectedly or alter non-interactive behavior in CI.

Overview
Updates entire enable to always proceed to agent selection by removing the interactive early-exit path that printed “Already enabled”.

Adds re-run behavior to detectOrSelectAgent: if any agent hooks are already installed, it always shows the multi-select with installed+newly-detected agents pre-selected, and in non-TTY re-runs it keeps the currently installed agents instead of falling back to detection/default.

Introduces cleanup via uninstallDeselectedAgentHooks, invoked in both interactive and --strategy flows, to uninstall hooks for agents the user deselects; expands tests to cover re-run prompting, no-TTY re-run behavior, and hook removal on deselection.

Written by Cursor Bugbot for commit 44dd933. Configure here.

dipree and others added 3 commits February 20, 2026 12:21
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
squishykid
squishykid previously approved these changes Feb 20, 2026
Copy link
Member

@squishykid squishykid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

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
@dipree dipree merged commit c8ac8e6 into main Feb 20, 2026
3 checks passed
@dipree dipree deleted the feat/enable-always-shows-agent-selection branch February 20, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants