Skip to content

Conversation

@bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Oct 7, 2025

Fixes #176310

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 7, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 introduces two new daemon events, app.dtd and app.devTools, to expose the Dart Tooling Daemon and DevTools URIs in machine mode. The changes span across the daemon implementation, resident runners (hot, cold, and web), and test files to support and verify this new functionality. The documentation for the daemon protocol has also been updated accordingly.

My review found a minor inconsistency in the documentation where the new events are documented to use a url field, but the implementation uses uri. I've left comments to correct this in the documentation for consistency.

@bkonyi bkonyi requested a review from gspencergoog October 7, 2025 20:58
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 7, 2025

autosubmit label was removed for flutter/flutter/176655, because - The status or check suite Windows tool_integration_tests_2_9 has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2025
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 7, 2025

autosubmit label was removed for flutter/flutter/176655, because - The status or check suite Windows tool_integration_tests_5_9 has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2025
@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 7, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Oct 7, 2025
Merged via the queue into master with commit c8c09f6 Oct 8, 2025
152 of 153 checks passed
@auto-submit auto-submit bot deleted the dtd_daemon_events branch October 8, 2025 00:41
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 8, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Oct 8, 2025
Roll Flutter from 908012d58baa to e11e2c11288b (39 revisions)

flutter/flutter@908012d...e11e2c1

2025-10-08 [email protected] Configure FfiNative resolver on dart:io (flutter/flutter#176621)
2025-10-08 [email protected] Marks Linux_pixel_7pro service_extensions_test to be unflaky (flutter/flutter#176700)
2025-10-08 [email protected] Keyboard Animation Fix (flutter/flutter#176418)
2025-10-08 [email protected] Feat: Add carousel view builder (flutter/flutter#172837)
2025-10-08 [email protected] Roll Skia from d10a0d877ff4 to ea7cdbc6b986 (15 revisions) (flutter/flutter#176686)
2025-10-08 [email protected] Roll Fuchsia Linux SDK from jJr3my9C6TwYWPygi... to xrIAL91ngrd-wNr9S... (flutter/flutter#176682)
2025-10-08 [email protected] Fix InputDecoration helper/error padding is not compliant (flutter/flutter#176353)
2025-10-08 [email protected] Fix PopupMenu does not update when PopupMenuTheme in Theme changes. (flutter/flutter#175513)
2025-10-07 [email protected] Roll Dart SDK to 3.10.0-290.1.beta (flutter/flutter#176629)
2025-10-07 [email protected] [ Tool ] Output `app.dtd` and `app.devTools` in machine mode (flutter/flutter#176655)
2025-10-07 [email protected] Rename UIScene integration test projects and fix Xcode compatibility (flutter/flutter#176635)
2025-10-07 [email protected] Selecting an implementation widget with the on-device inspector opens the code location for the nearest project widget (flutter/flutter#176530)
2025-10-07 [email protected] Migrate to `WidgetStateInputBorder` (flutter/flutter#176386)
2025-10-07 [email protected] Make it clear that you need to install clangd in VSCode intellisense c++ config (flutter/flutter#176609)
2025-10-07 [email protected] Bump the customer tests to pick up an update to Zulip's tests. (flutter/flutter#176463)
2025-10-07 [email protected] Roll Packages from d3ef88b to 8ca6416 (2 revisions) (flutter/flutter#176633)
2025-10-07 [email protected] Add fallback for 'scene:willConnectToSession:options' (flutter/flutter#176580)
2025-10-07 [email protected] Roll Skia from d09786dfb854 to d10a0d877ff4 (11 revisions) (flutter/flutter#176616)
2025-10-07 [email protected] [ Widget Preview ] Rework UI and theming (flutter/flutter#176581)
2025-10-07 [email protected] Handle FlutterEngine registration when embedded in Multi-Scene apps (flutter/flutter#176490)
2025-10-07 [email protected] Fix code style in Linux embedder template (flutter/flutter#176256)
2025-10-07 [email protected] Add tooling to migrate to UIScene (flutter/flutter#176427)
2025-10-06 [email protected] Bump customer tests.version to 986c4326b4e4bb4e37bc963c2cc2aaa10b943859 (flutter/flutter#176594)
2025-10-06 [email protected] Fix typo in pages.dart (flutter/flutter#176438)
2025-10-06 [email protected] Fix: Update anchorRect for overlayBuilder when anchor moves (flutter/flutter#169814)
2025-10-06 [email protected] Roll Fuchsia Linux SDK from Zm6K_3gP3VCaMy9rH... to jJr3my9C6TwYWPygi... (flutter/flutter#176591)
2025-10-06 [email protected] Fix deprecated configureStatusBarForFullscreenFlutterExperience for Android 15+ (flutter/flutter#175501)
2025-10-06 [email protected] updates docs for flutter engine footprint (flutter/flutter#176217)
2025-10-06 [email protected] [ Widget Preview ] Fix `WidgetInspectorService` override (flutter/flutter#176550)
2025-10-06 [email protected] Fix NavigatorBar lacks visual feedback (flutter/flutter#175182)
2025-10-06 [email protected] Roll Packages from e401aeb to d3ef88b (4 revisions) (flutter/flutter#176582)
2025-10-06 [email protected] Roll Dart SDK from 898380a41c90 to 6b0193498f09 (2 revisions) (flutter/flutter#176576)
2025-10-06 [email protected] Roll Skia from bc7cf194f4ee to d09786dfb854 (1 revision) (flutter/flutter#176577)
2025-10-06 [email protected] Roll vulkan-deps to a9e2ca3b (flutter/flutter#176322)
2025-10-06 [email protected] Add an AppDelegate callback for implicit FlutterEngines (flutter/flutter#176240)
2025-10-06 [email protected] Roll Skia from 45191c22b15c to bc7cf194f4ee (2 revisions) (flutter/flutter#176572)
2025-10-06 [email protected] [ Widget Preview ] Fix type error when retrieving flags from persistent preferences (flutter/flutter#176546)
2025-10-06 [email protected] Roll Skia from 1fd0ca1f2120 to 45191c22b15c (3 revisions) (flutter/flutter#176556)
2025-10-05 [email protected] Roll Dart SDK from 016a8c0045fd to 898380a41c90 (1 revision) (flutter/flutter#176549)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

...
@DanTup
Copy link
Contributor

DanTup commented Oct 9, 2025

@bkonyi I just saw this in the output when running from VS Code and noticed that the DTD URI included does not match the one VS Code is using. Looking back at the args, Dart-Code is only passing a DevTools server and not a DTD URI to the flutter run --machine instance:

        "toolArgs": [
            "-d",
            "windows",
            "--devtools-server-address",
            "http://127.0.0.1:9100/",
            "-v"
        ],

This seems like an oversight - I don't think we want to be spawning a new DTD for all app runs when the IDE is already running one (and it will prevent some features from working if the app needs to talk back to the IDE over DTD).

I can't see any flags in flutter run --help -v to pass a DTD URI though - is there already a mechanism for it? If not, I can file an issue.

@bkonyi
Copy link
Contributor Author

bkonyi commented Oct 21, 2025

I can't see any flags in flutter run --help -v to pass a DTD URI though - is there already a mechanism for it? If not, I can file an issue.

Hm, I thought we had exposed --dtd-url as a top-level option but I can't seem to find it. I think we'll need an issue filed for this.

@DanTup
Copy link
Contributor

DanTup commented Oct 21, 2025

I've opened #177329

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 <[email protected]>
Reviewed-by: Ivan Inozemtsev <[email protected]>
Reviewed-by: Alexander Thomas <[email protected]>
@gspencergoog
Copy link
Contributor

Hm, I thought we had exposed --dtd-url as a top-level option but I can't seem to find it. I think we'll need an issue filed for this.

Is this different from flutter run --print-dtd?

@DanTup
Copy link
Contributor

DanTup commented Oct 23, 2025

Is this different from flutter run --print-dtd?

It's for letting you provide a DTD URI rather than having one given back to you. In the case of an IDE which has already spawned DTD, we want to tell flutter run to use that one instead or starting another one (since it's the one the IDE and other tools are already connected to).

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DTD URI isn't printed if --machine is specified along with --print-dtd

3 participants