Skip to content

Add --agent to runner setup so -y can run without a provider picker - #2306

Merged
gtrrz-victor merged 3 commits into
mainfrom
victor/runner-setup-agent-flag
Sep 7, 2026
Merged

Add --agent to runner setup so -y can run without a provider picker#2306
gtrrz-victor merged 3 commits into
mainfrom
victor/runner-setup-agent-flag

Conversation

@gtrrz-victor

@gtrrz-victor gtrrz-victor commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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

Stacked on #2272. Addresses finding 1 on https://entire.io/gh/entireio/cli/trails/1239.

Why

-y answers setup's own questions, but the summary provider is resolved outside the mode decision. With no summary_generation.provider configured and several agents installed, a terminal still gets the provider picker after the defaults are created, so -y was not promptless.

What changed

  • entire runner setup --agent <name> names the text-generation agent for this run. It takes the same override path as dispatch --local --agent: validated, used once, nothing written to settings.local.json.
  • -y --agent codex opens no picker.
  • --agent is rejected with --defaults-only and --print-prompt, which never call a provider. The check runs before the scaffold so a usage error leaves no files behind.
  • One sentence in the Long help says when the picker appears and how --agent avoids it. The shared resolver is untouched, so explain --generate and dispatch behave as before.

Testing

Two tests in runner_setup_test.go. TestRunRunnerSetup_AgentFlagIsPromptless stubs the resolver's worst case (no configured provider, two candidates, terminal available) with the picker and the settings writer both failing the test if reached, and asserts the named agent is called once and no local settings are written. TestRunRunnerSetup_AgentRequiresAProviderMode pins the rejection for the two provider-free modes.

Runner and dispatch tests pass; golangci-lint v2 reports 0 issues on the package. The full-package TestRunUninstall_* failures on my machine are the known stale mise shim issue and reproduce on the base branch.

Follow-up

Once this lands, the -y flag help on runner_setup.go:138 should drop "without asking" or point at --agent, which closes the trail finding.

🤖 Generated with Claude Code


Note

Low Risk
CLI-only change to runner setup provider selection with validation before writes; shared resolver is reused, not modified.

Overview
entire runner setup now accepts --agent <name> so -y / --dry-run can pick a text-generation agent for tailoring without the interactive provider picker and without writing to settings.local.json.

Provider resolution switches from resolveCheckpointSummaryProvider to the shared resolveDispatchSummaryProvider path (same one-off override behavior as dispatch). --agent is rejected early for --defaults-only and --print-prompt, before any runner files are scaffolded. Command help documents when the picker appears and how --agent avoids it.

Tests cover promptless -y --agent (picker/settings save must not run) and invalid flag combinations.

Reviewed by Cursor Bugbot for commit b6446d5. Configure here.

-y answers setup's own questions, but with no summary_generation.provider
configured and several agents installed the resolver still opened the
provider picker in a terminal. --agent <name> takes dispatch's override
path: the named agent is validated, used for this run, and nothing is
written to settings.local.json. It is rejected with --defaults-only and
--print-prompt, which never call a provider, before anything is scaffolded.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Entire-Checkpoint: 01M1XK0V8D3GWMBGZ1TJ0SJW88
Copilot AI lite review requested due to automatic review settings September 7, 2026 09:31

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.

🟡 Changes recommended

The new --agent help/usage messaging is misleading about when the flag is valid (it’s not strictly limited to --yes/--dry-run), so user-facing guidance should be corrected before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a one-off --agent override to entire runner setup so non-interactive flows (notably -y) can tailor runners without triggering the interactive provider picker or persisting a provider choice.

Changes:

  • Add --agent <name> to runner setup and route provider resolution through resolveDispatchSummaryProvider(..., override) so the choice is validated/used once and not saved.
  • Reject --agent for provider-free modes (--defaults-only, --print-prompt) before scaffolding to avoid leaving files behind on usage errors.
  • Add tests to pin promptless -y --agent behavior and invalid flag combinations.
File summaries
File Description
cmd/entire/cli/runner_setup.go Adds the --agent flag, validates its compatibility with the chosen setup mode, and switches provider resolution to the shared dispatch resolver.
cmd/entire/cli/runner_setup_test.go Adds coverage ensuring --agent avoids picker/persistence behavior and is rejected for modes that never call a provider.
Review details

Suppressed comments (1)

cmd/entire/cli/runner_setup.go:188

  • The usage error for --agent currently tells users to "pass it with --yes or --dry-run", but the actual rule is that --agent only makes sense when tailoring runs, and it’s incompatible with provider-free modes like --defaults-only and --print-prompt. Tightening the message makes it clearer and avoids implying --yes/--dry-run are the only valid paths.
	if opts.agent != "" && !mode.needsProvider() {
		return errors.New("--agent only applies when setup calls a provider: pass it with --yes or --dry-run")
	}
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread cmd/entire/cli/runner_setup.go Outdated
…der choice

-y answers setup's own questions. The provider choice is a separate prompt
that --agent skips, so the help says so instead of claiming no prompt at all.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Entire-Checkpoint: 01M1XQ13VS20020VCEWVC95Q90
Base automatically changed from soph/runner-setup-modes to main September 7, 2026 11:47
--print-prompt scaffolds the default runners when the repo has none, because
the caller's agent needs files to write tailored templates into. Two things
were wrong about how that was presented.

The scaffold's six `created .entire/runners/trail-*.json` lines went to the
same writer the prompt then went to, so `--print-prompt > prompt.txt` produced
a file whose first six lines were narration and piping it into an agent fed
them as instructions. They now go to stderr, where every other message in this
mode already went. Both help strings also said only "print", while -y,
--defaults-only and --dry-run all state their write behaviour; they now
disclose the create.

Separately, the --agent messages named the wrong rule. The gate is
!mode.needsProvider(), which Adapt satisfies via -y, --run, or choosing to
tailor at the interactive prompt — so --agent works with no -y in a terminal,
and telling a `--defaults-only --agent codex` caller to pass --yes was advice
that cannot work, since --defaults-only outranks -y when the mode is resolved.
The gate is unchanged; the flag help and the error now describe tailoring, and
a table case pins that -y does not rescue --defaults-only.

Entire-Checkpoint: 01M1XVCJDX03XD7Z2QREHK9HSN
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Soph
Soph marked this pull request as ready for review September 7, 2026 12:23
@Soph
Soph requested a review from a team as a code owner September 7, 2026 12:23
@gtrrz-victor
gtrrz-victor merged commit 3d36ef3 into main Sep 7, 2026
13 checks passed
@gtrrz-victor
gtrrz-victor deleted the victor/runner-setup-agent-flag branch September 7, 2026 12:38
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