Add local agent selection to dispatch#1797
Open
peyton-alt wants to merge 11 commits into
Open
Conversation
Entire-Checkpoint: 01KXPFG4E8FBAX2C5W6XYBZYGC
Entire-Checkpoint: 01KXPKVZ0XZVYM3S01VQKDHBT5
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates local entire dispatch to use a configurable or explicitly selected text-generation agent instead of hard-coding Claude Code, while keeping cloud dispatch on the server-side generator.
Changes:
- Add a local-only
--agentflag toentire dispatchand validate it early (reject for cloud mode, reject empty values). - Resolve the local dispatch provider from configured summary settings by default, or from an explicit override (including targeted external-agent discovery).
- Refactor local dispatch generation to accept an injected
TextGenerator+Model, and update tests accordingly.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/setup_test.go | Extends external-agent test stub to record model args passed to generate-text. |
| cmd/entire/cli/explain_summary_provider.go | Adds dispatch-specific provider resolution (override vs configured) and exposes raw TextGenerator + effective model. |
| cmd/entire/cli/explain_summary_provider_test.go | Adds coverage for explicit override behavior (no persistence, default model, targeted external discovery). |
| cmd/entire/cli/dispatch/mode_local.go | Passes injected generator/model into local dispatch generation. |
| cmd/entire/cli/dispatch/mode_local_test.go | Updates local-mode tests to inject a generator (removes global factory stubbing). |
| cmd/entire/cli/dispatch/generate.go | Reworks local generation to require an injected generator/model (removes hard-coded Claude factory). |
| cmd/entire/cli/dispatch/generate_test.go | Makes generation tests parallel-safe and asserts prompt/model propagation + nil-generator error. |
| cmd/entire/cli/dispatch/dispatch.go | Adds TextGenerator interface and new Options fields for injection (TextGenerator, Model). |
| cmd/entire/cli/dispatch.go | Wires new --agent flag, validates constraints, resolves provider, and injects generator/model for local mode. |
| cmd/entire/cli/dispatch_test.go | Adds flag/help validation tests and verifies local provider resolution stays on stderr while markdown stays on stdout. |
| cmd/entire/cli/agent/external/discovery.go | Adds targeted external discovery (DiscoverAndRegisterNamedAlways) and refactors registration into registerExternalAgent. |
Entire-Checkpoint: 01KXRKXP0E2Z7X5PVB982TEX37
Entire-Checkpoint: 01KXRS1P0SX6GDTY0D7R035FTJ
Entire-Checkpoint: 01KXRT8F8Z6NTJXMGBQDZGFEKV
Entire-Checkpoint: 01KXRV52M3989P5VTHYBKFVQQ7
Entire-Checkpoint: 01KXRXQZFHBN48GYRKPNREGKYV
Entire-Checkpoint: 01KXRZ6FQ85EQGF1S3PP3S9JDA
Entire-Checkpoint: 01KXS001P21KYQBC8961Z63TKP
Entire-Checkpoint: 01KXS081JZY622YW97AH9RTMK7
Entire-Checkpoint: 01KXS28PXFVTCQBQ8GTQCWH3EE
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.
https://entire.io/gh/entireio/cli/trails/894
Summary
--agent <name>override toentire dispatch--agentoverrides scoped to one invocationBehavior
Interactive first-run flow:
entire dispatch.If only one compatible provider is available, it is selected automatically. An explicit command such as:
entire dispatch --local --agent codex --since 7dbypasses the picker, uses the selected CLI default model, and does not modify the configured provider.
Why
Local dispatch previously always invoked Claude Code, even when another supported agent was configured or authenticated. That could surface Claude-specific authentication failures and made dispatch inconsistent with the existing summary-provider flow used by Explain.
Explicit agent selection is intentionally limited to
--local. Cloud dispatch never inspects local agent configuration.Validation
mise run checkpassed after merging currentmainRisk and follow-up
The main behavioral change is limited to local text generation and provider selection. Cloud dispatch is untouched.
Manual testing still produced empty activity for the tested repository. Activity/checkpoint enumeration is a separate issue and is intentionally unchanged by this PR.