)]}'
{
  "commit": "3fc5f07964c76be1ff2ee291bfd61cd652ffe139",
  "tree": "4816962186213ba9ead717c70df5ab347beb6069",
  "parents": [
    "629df07148561e4180238d67de92628b77fbaed0"
  ],
  "author": {
    "name": "Ben Konyi",
    "email": "bkonyi@google.com",
    "time": "Tue Jul 07 21:16:51 2026 -0400"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jul 08 01:16:51 2026 +0000"
  },
  "message": "[flutter_tools] Prevent interactive device selection in machine mode (#188267)\n\nFixes a crash when running `flutter run --machine` (or other commands in\nmachine mode) when multiple devices are connected and no device is\nspecified.\n\nPreviously, if multiple devices were connected, the tool would attempt\nto prompt the user interactively to select a device, even in machine\nmode. This interactive prompt listens to `stdin` (via a broadcast stream\nwrapper). Since `stdin` is a single-subscription stream, once it has\nbeen listened to by the prompt, it cannot be listened to again. When the\nmachine daemon later attempts to listen to `stdin` to receive JSON-RPC\ncommands, it throws a `StateError: Bad state: Stream has already been\nlistened to.` and crashes.\n\nThis fix introduces a `canPrompt` flag to device discovery and selection\nmethods (defaulting to `!outputMachineFormat` in `FlutterCommand`),\nwhich disables interactive prompting when running in machine mode.\nInstead, the tool will print the available devices and exit gracefully,\nwhich is the correct behavior for machine-to-machine communication when\na required parameter is missing.\n\nFixes #175948",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "2173f9e45c5008844209fa140704262ecc05e2cf",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/runner/flutter_command.dart",
      "new_id": "95b5f395a181cc2788b6a4d5567fe60b201efe94",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/runner/flutter_command.dart"
    },
    {
      "type": "modify",
      "old_id": "1f49b8e93637f05f6f252518c09aa2793e00189e",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/runner/target_devices.dart",
      "new_id": "235a3413d1e38edf24da4ce76f5f0475df5e4532",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/runner/target_devices.dart"
    },
    {
      "type": "modify",
      "old_id": "5dbf8c4c2ff1a072b492404ff9a7204bef8ebb52",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart",
      "new_id": "c5b62ab47b8f9c1ad33243802848f49107e93f9c",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart"
    },
    {
      "type": "modify",
      "old_id": "003795c6576d7afe9b5b15fe9e90f6921721e914",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/general.shard/runner/target_devices_test.dart",
      "new_id": "0d2919b3e51de1644bc28394cb088822058bdd51",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/general.shard/runner/target_devices_test.dart"
    }
  ]
}
