Skip to content

fix: Gemini e2e tests stall#413

Draft
peyton-alt wants to merge 1 commit intomainfrom
fix/gemini-e2e-test-hanging
Draft

fix: Gemini e2e tests stall#413
peyton-alt wants to merge 1 commit intomainfrom
fix/gemini-e2e-test-hanging

Conversation

@peyton-alt
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 18, 2026 18:25
@cursor
Copy link

cursor bot commented Feb 18, 2026

PR Summary

Low Risk
Test-runner-only changes that primarily adjust CLI flags and environment to avoid non-interactive hangs; minimal impact outside Gemini e2e execution.

Overview
Fixes Gemini-based e2e runs that can stall waiting for interactive tool approvals by switching the Gemini invocation to --yolo/-y (auto-approve all tools) and removing the prior --approval-mode auto_edit + --allowed-tools allowlist logic.

Also forces ENTIRE_TEST_TTY=0 in the Gemini runner environment to prevent git hooks (e.g. prepare-commit-msg) from reading /dev/tty and hanging in non-interactive CI.

Written by Cursor Bugbot for commit dc72086. Configure here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Gemini e2e agent runner to avoid non-interactive stalls when running Gemini CLI-driven workflows in Entire’s e2e test suite.

Changes:

  • Switch Gemini runner invocation to use Gemini’s full auto-approval mode (-y / --yolo) to prevent hanging on tool confirmations.
  • Add ENTIRE_TEST_TTY=0 to the Gemini runner subprocess environment to prevent git hooks from attempting /dev/tty interaction during agent-driven commits.

Comment on lines 265 to 276
func (r *GeminiCLIRunner) RunPromptWithTools(ctx context.Context, workDir string, prompt string, tools []string) (*AgentResult, error) {
// Build command: gemini -m <model> -p "<prompt>" --approval-mode auto_edit --allowed-tools <tools>
// --approval-mode auto_edit: auto-approves edit tools (write_file, replace) while prompting for others
// --allowed-tools: comma-separated list of tools that bypass confirmation (e.g., git commands)
// Build command: gemini -m <model> -p "<prompt>" --yolo
// --yolo (-y): auto-approves all tools, required for non-interactive e2e tests
// Note: --approval-mode auto_edit + --allowed-tools doesn't work because
// tool matching is exact (e.g., "ShellTool(git commit)" won't match
// "ShellTool(git commit -m "msg")"), causing the agent to hang waiting
// for approval in a non-interactive context.
args := []string{
"-m", r.Model,
"-p", prompt,
"--approval-mode", "auto_edit",
}

// Add default git tools that should be allowed without confirmation
defaultAllowedTools := []string{
"ShellTool(git status)",
"ShellTool(git add)",
"ShellTool(git commit)",
"ShellTool(git diff)",
"ShellTool(git log)",
}

// Merge with any additional tools passed in
allTools := append(defaultAllowedTools, tools...)
if len(allTools) > 0 {
args = append(args, "--allowed-tools", strings.Join(allTools, ","))
"-y",
}
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tools is now unused for the Gemini runner (everything is auto-approved via -y), which makes RunPromptWithTools misleading and may trigger unparam/unused-arg linting when the e2e build tag is included. Consider renaming the parameter to _ (or explicitly consuming it with a short comment) and documenting that tool allowlisting isn’t supported for Gemini in this runner.

Copilot uses AI. Check for mistakes.
// --yolo (-y): auto-approves all tools, required for non-interactive e2e tests
// Note: --approval-mode auto_edit + --allowed-tools doesn't work because
// tool matching is exact (e.g., "ShellTool(git commit)" won't match
// "ShellTool(git commit -m "msg")"), causing the agent to hang waiting
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanatory comment here is hard to read because of nested quotes (e.g., "... -m "msg""). Rephrasing the example (or using single quotes in the example strings) would avoid confusion when someone later revisits why --allowed-tools was removed.

Suggested change
// "ShellTool(git commit -m "msg")"), causing the agent to hang waiting
// "ShellTool(git commit -m 'msg')"), causing the agent to hang waiting

Copilot uses AI. Check for mistakes.
Comment on lines +285 to +287
// ENTIRE_TEST_TTY=0 prevents git hooks (prepare-commit-msg) from trying to
// read /dev/tty for interactive confirmation, which hangs in non-interactive tests.
cmd.Env = append(os.Environ(), "ENTIRE_TEST_TTY=0")
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting ENTIRE_TEST_TTY=0 here prevents interactive git-hook prompts during agent-driven git commit -m, but this same hang risk applies to other agent runners too (e.g., Claude). Consider applying the same environment override consistently for all agent subprocesses so e2e behavior doesn’t depend on which agent is selected or whether the developer has a real /dev/tty available.

Copilot uses AI. Check for mistakes.
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.

1 participant

Comments