cli: register external agents in attach command#986
Merged
Conversation
Without this, `entire attach --agent <external-name>` fails with "unknown agent" because external agent discovery runs in configure, rewind, resume, and the hook commands but not in attach. Call external.DiscoverAndRegister before resolving the --agent flag, matching the pattern used in rewind and resume. Entire-Checkpoint: a61f264a9a07
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes entire attach --agent <external-name> failing with “unknown agent” by ensuring external agent plugins are discovered/registered during attach, aligning behavior with rewind/resume and hook commands.
Changes:
- Import the external agent discovery package in
attach. - Invoke external agent discovery before resolving the
--agentflag.
3 tasks
Stop enumerating built-in agents in the attach help text — the list
went stale the moment external agents became supported. Point users at
'entire configure' for the authoritative list.
Add TestAttach_DiscoversExternalAgents, which stands up a fake
entire-agent-<name> on PATH, enables external_agents in settings, and
asserts that `attach --agent <external-name>` gets past the registry
check. Without the DiscoverAndRegister call, the test reports a
registry miss ("unknown agent"), so a future regression that removes
discovery from attach will fail loudly instead of silently reappearing.
Entire-Checkpoint: 21249c964d00
fba8137 to
7662e6e
Compare
CI flagged `buildSummaryGenerator` for ireturn after the previous commit accidentally stripped the `//nolint:ireturn` suppression. The strip happened because a stale golangci-lint cache made nolintlint think the directive was unused; `--fix` then removed it. A clean cache reproduces no such strip. Restoring the directive brings the branch back in line with main and unblocks the PR. Cache-clean discipline is left as a follow-up decision. Entire-Checkpoint: b8623c735c57
pjbgf
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
entire attach --agent <external-name>failed with "unknown agent" because external agent discovery runs in configure, rewind, resume, and the hook commands but not in attach. Discovery is now called before the --agent flag is resolved, matching rewind/resume.Test plan:
entire attach <session-id> --agent pino longer errors on the registry check (requiresentire-agent-pion PATH andexternal_agentsenabled in settings)go test ./cmd/entire/cli -run TestAttachstill greenNote
Low Risk
Low risk: a small change that only triggers external agent discovery before resolving
--agent, affecting CLI behavior but not core checkpoint or git mutation logic.Overview
Fixes
entire attach --agent <external-name>failing with "unknown agent" by running external agent discovery/registration inattachbefore the agent flag is resolved.This also allows
attach’s transcript auto-detection to consider externally provided agents whenexternal_agentsis enabled.Reviewed by Cursor Bugbot for commit 0b9d29d. Configure here.