Skip to content

Add local agent selection to dispatch#1797

Open
peyton-alt wants to merge 11 commits into
mainfrom
feat/dispatch-agent-flag
Open

Add local agent selection to dispatch#1797
peyton-alt wants to merge 11 commits into
mainfrom
feat/dispatch-agent-flag

Conversation

@peyton-alt

@peyton-alt peyton-alt commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

https://entire.io/gh/entireio/cli/trails/894

Summary

  • add a local-only --agent <name> override to entire dispatch
  • when Local is selected without an override, reuse the configured summary provider or discover enabled text-generation agents and show the interactive picker when a choice is needed
  • persist first-run picker selections while keeping explicit --agent overrides scoped to one invocation
  • inject the selected text generator and model into local dispatch instead of hard-coding Claude Code
  • preflight local time-window and repository inputs before agent selection and before the Bubble Tea loading UI starts
  • preserve actionable errors from explicitly selected external agents while scan-all discovery remains best-effort
  • keep cloud dispatch unchanged on the Entire server-side generator

Behavior

Interactive first-run flow:

  1. Run entire dispatch.
  2. Choose Local.
  3. If no summary provider is configured, Entire inspects installed/enabled summary-capable agents.
  4. With multiple candidates in an interactive terminal, Entire shows Choose a summary provider.
  5. The selected provider is saved locally and used for dispatch generation.

If only one compatible provider is available, it is selected automatically. An explicit command such as:

entire dispatch --local --agent codex --since 7d

bypasses 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 check passed after merging current main
  • Go lint: 0 issues
  • race-enabled unit and integration tests passed
  • Vogon canary: 59/59 passed
  • Roger-Roger external-agent canary: 4/4 passed
  • remote Windows named-discovery check passed
  • manual local generation exercised both Claude Code and Codex

Risk 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.

Entire-Checkpoint: 01KXPFG4E8FBAX2C5W6XYBZYGC
Entire-Checkpoint: 01KXPKVZ0XZVYM3S01VQKDHBT5
Copilot AI review requested due to automatic review settings July 17, 2026 14:34
@peyton-alt
peyton-alt marked this pull request as ready for review July 17, 2026 14:35
@peyton-alt
peyton-alt requested a review from a team as a code owner July 17, 2026 14:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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 --agent flag to entire dispatch and 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.

Comment thread cmd/entire/cli/agent/external/discovery.go Outdated
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
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.

2 participants