Skip to content

Conversation

@gspencergoog
Copy link
Contributor

@gspencergoog gspencergoog commented Oct 21, 2025

Description

This makes the flutter launcher read the DTD URI from the --machine output instead of parsing it from stdout. It will still fall back to parsing it from stdout to handle (slightly) older versions of Flutter that don't print the DTD URI as part of the --machine output.

Related Issues

Tests

  • Added tests for the new functionality, as well as tests that make sure the timeouts occur correctly.

@github-actions
Copy link

PR Health

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@gspencergoog gspencergoog merged commit 0a85ddf into dart-lang:main Oct 21, 2025
15 checks passed
copybara-service bot pushed a commit to dart-lang/sdk that referenced this pull request Oct 22, 2025
Issue description: Without this change, the dart MCP command launch_app will not work for the `chrome` device target because it won't find any DTD URI.

What is the fix: This starts using the `--machine` along with `--print-dtd` arguments to the `flutter run` command, now that it prints the DTD URI in machine mode.

Why cherry-pick: This will enable Flutter developers to develop web apps using the MCP server without hanging.

Risk: Low, this only affects the Dart MCP server's `launch_app` command so the radius is small, and the likely worst thing that could happen is that it would stop working for other devices as well.

See dart-lang/ai#301 and flutter/flutter#176655 for more information.

Cherry-pick: https://dart-review.googlesource.com/c/sdk/+/456480
Bug: dart-lang/ai#302
Change-Id: Ide1ea8d447de43a0a48fae05d40f9051457eaa2c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/456482
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: Ivan Inozemtsev <iinozemtsev@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DTD URI should be parsed using --machine output in launch_app

2 participants