Skip to content

fix: e2e gemini-cli interactive tests blocked by attribution prompt#776

Closed
alishakawaguchi wants to merge 3 commits intomainfrom
fix/e2e-gemini-interactive-attribution-prompt
Closed

fix: e2e gemini-cli interactive tests blocked by attribution prompt#776
alishakawaguchi wants to merge 3 commits intomainfrom
fix/e2e-gemini-interactive-attribution-prompt

Conversation

@alishakawaguchi
Copy link
Contributor

@alishakawaguchi alishakawaguchi commented Mar 25, 2026

What broke

Gemini CLI E2E interactive tests (TestInteractiveMultiStep, TestInteractiveAttributionOnAgentCommit, TestInteractiveAttributionMultiCommitSameSession, TestInteractiveShadowBranchCleanedAfterAgentCommit) all timed out waiting for the Gemini input prompt.

Root cause: The prepare-commit-msg hook's interactive "Link this commit to session context?" prompt blocks the terminal. The tmux session used by interactive E2E tests provides a real /dev/tty, so hasTTY() returns true. The GEMINI_CLI env var check that would bypass this doesn't take effect in the hook's process context, so the prompt appears and the agent can't respond to it.

Additionally, 7 tests failed with transient Gemini API errors (exhausted 3 retries) and 2 tests had checkpoint timing issues — these are flaky, not CLI bugs.

What was fixed

Set commit_linking: "always" in E2E test settings via PatchSettings() in repo.go. This auto-accepts the attribution prompt, matching the behavior of a user who chose "always". The interactive E2E tests are testing checkpoint/attribution functionality, not the prompt UX itself.

Notes

Auto-generated fix from e2e failure on 3e65909 (main)
Failed agent: gemini-cli


Note

Low Risk
Low risk: only adjusts E2E test repo settings to prevent a blocking interactive prompt during commit hooks; no production logic changes.

Overview
Prevents interactive E2E tests from hanging on the commit attribution/linking prompt by forcing commit_linking: "always" in e2e/testutil/repo.go when seeding test repos.

Keeps existing debug logging configuration while ensuring commits are auto-linked without requiring TTY input (notably in tmux-backed sessions).

Written by Cursor Bugbot for commit 785282a. Configure here.

The prepare-commit-msg hook's interactive "Link this commit to session
context?" prompt blocks Gemini CLI interactive E2E tests. The tmux
session provides a real /dev/tty, so hasTTY() returns true, but the
agent can't respond to the git hook prompt, causing timeouts.

Set commit_linking: "always" in E2E test settings so the prompt is
auto-accepted, matching the behavior of a user who chose "always".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: e8fd0fb8b1aa
Copilot AI review requested due to automatic review settings March 25, 2026 17:13
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

Adjusts E2E repo setup so Gemini CLI interactive tests don’t hang on the prepare-commit-msg attribution prompt, aligning test behavior with a user who previously selected “always link”.

Changes:

  • Patch E2E .entire/settings.json to set commit_linking: "always" during SetupRepo.
  • Keep log_level: "debug" patching in place while expanding the patched settings map.

alishakawaguchi and others added 2 commits March 25, 2026 10:58
stableContent now normalizes braille spinner characters and countdown
timers so animated TUI elements don't prevent the settle timer from
completing. Also bumps WaitForCheckpoint timeout to 30s in the subagent
commit test where condensation can take longer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 9572b2f53c9e
Two gemini-cli E2E fixes:

1. WaitFor now checks session state (via WaitForSessionIdle) after the
   TUI pattern settles, preventing premature settlement when the prompt
   text is permanently visible during processing (gemini-cli always shows
   "Type your message"). Only applies after Send — initial prompt waits
   skip the check since the session may still be starting.

2. TestSingleSessionSubagentCommitInTurn now handles the case where
   subagent commits occur before checkpoint content exists. The hook
   logs "no content to link" and skips the trailer — the test verifies
   the shadow branch instead of asserting checkpoint advancement.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 6462f0838505
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