Skip to content

feat: automatically enable non-interactive mode for AI agents - #10856

Open
joehan wants to merge 1 commit into
mainfrom
enable-noninteractive-agent-mode
Open

feat: automatically enable non-interactive mode for AI agents#10856
joehan wants to merge 1 commit into
mainfrom
enable-noninteractive-agent-mode

Conversation

@joehan

@joehan joehan commented Jul 27, 2026

Copy link
Copy Markdown
Member

This PR automatically sets options.nonInteractive = true when an AI agent is detected in the environment. This makes the CLI more usable for agents by failing fast instead of hanging on prompts.

Evaluation Results

We ran the complete 51-case evaluation suite in google3 (firebase_tools_evals) to compare the baseline (origin/main) against this branch:

Metric Baseline (main) Branch (enable-noninteractive) Change
Pass Rate 51.0% (26/51) 64.7% (33/51) +13.7% (+7 cases)
Input Tokens 7,489.8k 10,413.4k +39.0%
Output Tokens 259.8k 420.6k +61.9%
Total Tokens 7,749.6k 10,834.0k +39.8%
Total Turns 1,553 2,197 +41.5%
Tool Calls 684 838 +22.5%

Note on Token Usage

Automatically enabling non-interactive mode increases token usage and turns because it prevents the agent from hanging on prompts. Instead of waiting and timing out, the agent receives immediate feedback and can use its remaining turns to actively troubleshoot and find alternative non-interactive flags (e.g. appending --project or --non-interactive explicitly). This active recovery is what drove the 13.7% increase in pass rate.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates src/command.ts to import and use the detectAIAgent utility from ./env. It modifies the condition for setting non-interactive mode to automatically enable it if an AI agent is detected (i.e., detectAIAgent() !== 'unknown'). There are no review comments, so I have no feedback to provide.

@joehan
joehan requested a review from yuchenshi July 28, 2026 21:00
@joehan
joehan force-pushed the enable-noninteractive-agent-mode branch from a396028 to 0321a49 Compare July 28, 2026 21:30
@joehan
joehan force-pushed the enable-noninteractive-agent-mode branch from 17237cd to 5b87262 Compare July 28, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants