Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c3d84bc. Configure here.
|
|
||
| // GenerateText sends a prompt to the Copilot CLI and returns the raw text response. | ||
| func (c *CopilotCLIAgent) GenerateText(ctx context.Context, prompt string, model string) (string, error) { | ||
| args := []string{"-p", prompt, "--allow-all-tools"} |
There was a problem hiding this comment.
Copilot and Cursor pass large prompts as CLI arguments
Medium Severity
The Copilot and Cursor GenerateText implementations embed the full prompt as a command-line argument via -p. When used through TextGeneratorAdapter for summarization, this prompt includes the entire formatted transcript, which can be very large. This can exceed OS argument length limits (e.g., ~256 KB on macOS), causing the exec call to fail. Other providers (Claude Code, Codex, Gemini) correctly pass the prompt via stdin.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit c3d84bc. Configure here.
There was a problem hiding this comment.
Pull request overview
Adds a configurable “summary provider” pipeline for entire explain --generate, allowing users to choose (and persist) which agent/provider + model to use for on-demand checkpoint summary generation, while reusing the shared summarization prompt and JSON parsing.
Changes:
- Introduces a
TextGeneratorAdapterto generate summaries via anyagent.TextGeneratorusing the shared summarization prompt + parser. - Adds summary-provider resolution + persistence for
explain --generate, including interactive selection when multiple providers are available. - Extends settings/configure flow with
summary_generationsettings and newentire configureflags (--summarize-provider,--summarize-model), plus shared CLI isolation helpers for provider CLIs.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/summarize/text_generator.go | Adds adapter to use any agent.TextGenerator for summary generation with shared prompt/parsing. |
| cmd/entire/cli/summarize/text_generator_test.go | Tests adapter passes model + includes condensed transcript in prompt. |
| cmd/entire/cli/summarize/claude.go | Refactors Claude generator to use shared isolated CLI runner and shared summary parsing. |
| cmd/entire/cli/summarize/claude_test.go | Updates env-stripping test to use shared agent.StripGitEnv. |
| cmd/entire/cli/setup.go | Adds configure flags + settings update path for summary provider/model. |
| cmd/entire/cli/setup_test.go | Adds tests verifying settings updates, validation, and non-leakage for new summary settings. |
| cmd/entire/cli/settings/settings.go | Adds summary_generation settings struct + merge logic. |
| cmd/entire/cli/settings/settings_test.go | Adds coverage for loading/merging summary_generation. |
| cmd/entire/cli/explain.go | Wires explain --generate to resolve and use the selected summary provider + prints provider/model details. |
| cmd/entire/cli/explain_summary_provider.go | Implements provider discovery, interactive selection, persistence, and formatting of provider details. |
| cmd/entire/cli/explain_summary_provider_test.go | Tests provider resolution from config, persistence when single provider is available, and formatting output. |
| cmd/entire/cli/agent/text_generator_cli.go | Introduces shared isolated CLI runner and exported StripGitEnv. |
| cmd/entire/cli/agent/geminicli/generate.go | Adds Gemini CLI text generation implementation via isolated runner. |
| cmd/entire/cli/agent/cursor/generate.go | Adds Cursor agent CLI text generation implementation via isolated runner. |
| cmd/entire/cli/agent/copilotcli/generate.go | Adds Copilot CLI text generation implementation via isolated runner. |
| cmd/entire/cli/agent/codex/generate.go | Adds Codex CLI text generation implementation via isolated runner. |
| cmd/entire/cli/agent/claudecode/generate.go | Refactors Claude Code agent text generation to use shared isolated runner. |
| func (g *GeminiCLIAgent) GenerateText(ctx context.Context, prompt string, model string) (string, error) { | ||
| args := []string{"-p", ""} | ||
| if model != "" { | ||
| args = append(args, "--model", model) | ||
| } | ||
|
|
||
| result, err := agent.RunIsolatedTextGeneratorCLI(ctx, geminiCommandRunner, "gemini", "gemini", args, prompt) | ||
| if err != nil { |
There was a problem hiding this comment.
Gemini CLI prompt is currently passed via stdin while the args use -p "". In this repo’s E2E harness, Gemini expects the prompt to be provided as the -p <prompt> argument (and typically includes -y plus ACCESSIBLE=1 to avoid interactive/TUI flows). As written, this is likely to generate an empty prompt or hang on interactivity. Update the invocation to pass prompt in the args (and add the non-interactive flags/env needed for reliable headless execution).
| func listEnabledSummaryProviders() ([]checkpointSummaryProvider, error) { | ||
| installed := listInstalledAgents(context.Background()) | ||
| providers := make([]checkpointSummaryProvider, 0, len(installed)) | ||
| for _, name := range installed { | ||
| ag, err := getSummaryAgent(name) | ||
| if err != nil { |
There was a problem hiding this comment.
listEnabledSummaryProviders ignores the caller’s context by calling listInstalledAgents(context.Background()). This drops cancellation/deadline propagation and makes tests/behavior harder to control. Thread ctx through (e.g., accept ctx as a parameter and call listInstalledAgents(ctx)) so hook-install checks and agent loading respect the command context.


Summary
This stacks on top of #875 and adds summary provider selection for
entire explain --generate.When a summary provider is already configured,
explain --generateuses it. If none is configured, the command resolves one at first use:This PR also adds
entire configure --summarize-providerand--summarize-model, plus shared CLI execution cleanup for provider transports.Changes
summary_generationsettings for persisted provider/model preferenceexplain --generateconfigureflags for updating summary provider and modelTesting
mise run fmtmise run testmise run lintNotes
codex-explain-generate).