Skip to content

feat: auto-discover external agents during enable, rewind, and resume#724

Open
alishakawaguchi wants to merge 4 commits intomainfrom
alisha/external-agent-auto-discovery
Open

feat: auto-discover external agents during enable, rewind, and resume#724
alishakawaguchi wants to merge 4 commits intomainfrom
alisha/external-agent-auto-discovery

Conversation

@alishakawaguchi
Copy link
Contributor

@alishakawaguchi alishakawaguchi commented Mar 18, 2026

Summary

  • Fix chicken-and-egg problem in setup: External agent discovery was gated behind the external_agents setting, which doesn't exist until after entire enable writes it. Added DiscoverAndRegisterAlways() that bypasses the settings check for interactive setup flows, so external agents appear in first-time agent selection.
  • Auto-enable external_agents setting: When a user selects an external agent during setup, the external_agents setting is automatically enabled in the written config.
  • Discover external agents in rewind/resume: entire rewind and entire resume now call DiscoverAndRegister() so checkpoints from external agents can be resolved.
  • Add discovery timeout: 10s timeout prevents PATH scanning from blocking the CLI if the filesystem is slow.

Test plan

  • Unit tests for DiscoverAndRegisterAlways (finds agents without settings)
  • Unit tests for IsExternal (true for wrapped agents, false for built-ins)
  • Unit test for dynamically registered agents resolving by type in ResolveAgentForRewind
  • Manual: run entire enable with an entire-agent-* binary on PATH — verify it appears in agent selection
  • Manual: select an external agent during enable — verify external_agents: true in settings
  • Manual: create checkpoints with external agent, then entire rewind --list — verify checkpoints show

🤖 Generated with Claude Code


Note

Cursor Bugbot is generating a summary for commit 609fc3b. Configure here.

alishakawaguchi and others added 2 commits March 18, 2026 12:17
External agent discovery was gated behind the `external_agents` setting,
creating a chicken-and-egg problem: the setting doesn't exist until after
`entire enable` writes it, so external agents never appeared in first-time
setup. This replaces the gated discovery with unconditional discovery in
setup flows, auto-enables the setting when an external agent is selected,
and adds a 10s overall timeout to prevent PATH scanning from blocking setup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
External agents (e.g., Kiro) registered via discovery were not found
during `entire rewind` or `entire resume` because DiscoverAndRegister
only ran during enable/hooks flows, not these commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 3eec0a039143
Copilot AI review requested due to automatic review settings March 18, 2026 19:45
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 66ac4e0c436b
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

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 improves support for external (PATH-discovered) agent plugins across initial setup and session-management commands, so external-agent checkpoints and hook flows can work without manual preconfiguration.

Changes:

  • Add DiscoverAndRegisterAlways() to allow external agent discovery during interactive setup even before external_agents exists in settings.
  • Auto-enable external_agents in settings when an external agent is selected during interactive enable.
  • Run external agent discovery in entire rewind and entire resume, and add a 10s discovery timeout to prevent long PATH scans.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cmd/entire/cli/setup.go Uses always-discovery in interactive setup/add flows; auto-enables external_agents; updates --agent help text.
cmd/entire/cli/rewind.go Discovers external agents before resolving checkpoint agents.
cmd/entire/cli/resume.go Discovers external agents before resolving checkpoint agents.
cmd/entire/cli/agent/external/discovery.go Adds DiscoverAndRegisterAlways() and introduces a 10s discovery timeout.
cmd/entire/cli/agent/external/capabilities.go Adds IsExternal() helper for detecting wrapped external agents.
cmd/entire/cli/agent/external/discovery_test.go Adds unit tests for always-discovery and IsExternal().
cmd/entire/cli/strategy/rewind_test.go Adds a unit test covering resolving dynamically registered agents by type.

…up commands

Address PR #724 review comments:
- runAddAgents now persists external_agents: true after installing hooks
- Move PATH discovery after interactivity check to avoid unnecessary scan
- configure/enable --agent use DiscoverAndRegisterAlways for fresh repos
- setupAgentHooksNonInteractive sets ExternalAgents when agent is external

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: fd6189edccc6
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