Repository navigation
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
AzureDetector.isRunningOnAzure probes the Azure Instance Metadata Service (http://169.254.169.254/metadata/instance) on startup and caches isRunningOnBot = true in ~/.flutter_tool_state, which classifies every Azure-hosted developer workstation as a CI bot and forces BotDetector.isRunningOnBot to be asynchronous.
- Root cause:
BotDetector.isRunningOnBotfalls back to an HTTP GET to169.254.169.254whenever no CI environment variable is set, treating any HTTP response (includingHttpExceptionat#L108-L111) as a bot and persisting that result inpersistentToolState. Meanwhile,bot_detector.dart#L42checks_platform.environment.containsKey('CI'), treatingCI=falseandCI=0as bots. - Impact: Human developers using GitHub Codespaces, Microsoft Dev Box, or Azure VMs are permanently flagged as bots—suppressing analytics (
NoOpAnalytics()), skipping update checks (flutter_command_runner.dart#L477), and auto-deleting~/.gradlewithout prompting on Gradle errors (gradle_errors.dart#L195)—while non-Azure users pay up to a 250ms–1s network timeout on first run or hit proxy redirect issues (see#189456). Azure Pipelines CI runs are already detected synchronously viaTF_BUILD(bot_detector.dart#L69).
Proposed Fix
- Remove
AzureDetectorand thepersistentToolState.isRunningOnBotcache frompackages/flutter_tools/lib/src/base/bot_detector.dart, matchingpkg/dartdev. - Require
CIinbot_detector.dart#L42to be non-empty and not'false'or'0'(and delegate topackage:unified_analyticsonce centralized indart-lang/tools#2672).
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
kevmoo commentedon Oct 16, 2026
#194530 removes
AzureDetectorandPersistentToolState.isRunningOnBotcaching and alignsBotDetector.isRunningOnBotwithAnalytics.isBot(landed in dart-lang/tools#2687).Remaining steps to close this issue once
package:unified_analytics >= 8.2.0is published and rolled intoflutter_tools:BotDetector.isRunningOnBotdirectly toAnalytics.isBot(_platform.environment).BotDetector.isRunningOnBotandglobals.isRunningOnBotfromFuture<bool>to synchronousbool.[flutter_tools] Remove AzureDetector IMDS probe from BotDetector (flu…
[flutter_tools] Remove AzureDetector IMDS probe from BotDetector (flu…
[flutter_tools] Share Analytics.isBot and make isRunningOnBot sync (f…