Add --agent to runner setup so -y can run without a provider picker - #2306
Merged
Conversation
-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
Contributor
There was a problem hiding this comment.
🟡 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>torunner setupand route provider resolution throughresolveDispatchSummaryProvider(..., override)so the choice is validated/used once and not saved. - Reject
--agentfor provider-free modes (--defaults-only,--print-prompt) before scaffolding to avoid leaving files behind on usage errors. - Add tests to pin promptless
-y --agentbehavior 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
--agentcurrently tells users to "pass it with --yes or --dry-run", but the actual rule is that--agentonly makes sense when tailoring runs, and it’s incompatible with provider-free modes like--defaults-onlyand--print-prompt. Tightening the message makes it clearer and avoids implying--yes/--dry-runare 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.
…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
--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
marked this pull request as ready for review
September 7, 2026 12:23
gtrrz-victor
enabled auto-merge
September 7, 2026 12:26
Soph
approved these changes
Sep 7, 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.
https://entire.io/gh/entireio/cli/trails/1254
Stacked on #2272. Addresses finding 1 on https://entire.io/gh/entireio/cli/trails/1239.
Why
-yanswers setup's own questions, but the summary provider is resolved outside the mode decision. With nosummary_generation.providerconfigured and several agents installed, a terminal still gets the provider picker after the defaults are created, so-ywas not promptless.What changed
entire runner setup --agent <name>names the text-generation agent for this run. It takes the same override path asdispatch --local --agent: validated, used once, nothing written tosettings.local.json.-y --agent codexopens no picker.--agentis rejected with--defaults-onlyand--print-prompt, which never call a provider. The check runs before the scaffold so a usage error leaves no files behind.--agentavoids it. The shared resolver is untouched, soexplain --generateanddispatchbehave as before.Testing
Two tests in
runner_setup_test.go.TestRunRunnerSetup_AgentFlagIsPromptlessstubs 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_AgentRequiresAProviderModepins 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
-yflag help onrunner_setup.go:138should 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 setupnow accepts--agent <name>so-y/--dry-runcan pick a text-generation agent for tailoring without the interactive provider picker and without writing tosettings.local.json.Provider resolution switches from
resolveCheckpointSummaryProviderto the sharedresolveDispatchSummaryProviderpath (same one-off override behavior as dispatch).--agentis rejected early for--defaults-onlyand--print-prompt, before any runner files are scaffolded. Command help documents when the picker appears and how--agentavoids 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.