Repository navigation
feat: VmServiceProxy (for intercepting reloadSources) - #5022
Merged
Merged
Conversation
nielsenko
force-pushed
the
feat-vm-proxy
branch
6 times, most recently
from
May 1, 2026 15:18
a471951 to
52d6247
Compare
This was referenced May 4, 2026
nielsenko
marked this pull request as ready for review
May 4, 2026 10:10
nielsenko
force-pushed
the
feat-vm-proxy
branch
2 times, most recently
from
May 4, 2026 13:49
216eeb5 to
5a3d16d
Compare
marcelomendoncasoares
approved these changes
May 4, 2026
marcelomendoncasoares
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! 🚀
Only one question regarding a related PR.
…tion The pod's --write-service-info now lands at vm-service-info.pod.json; the user-facing vm-service-info.json gets the proxy's URI, so an IDE attaching via the standard Dart attach config hits the proxy instead. The proxy intercepts reloadSources and routes it through WatchSession.forceReload (codegen + hooks + compile + reload) instead of the VM's built-in reloadSources, which crashes kernel_service when the isolate was booted from a precompiled dill. The proxy is retargeted (not rebuilt) on pod restart so the published URI stays stable across the swap.
Replaces the direct `dart bin/main.dart` launch with `serverpod start --watch --no-tui` driven by a background task, then attaches Dart-Code to the proxy's vm-service-info.json. The compound that brings up server + flutter still works the same way. Drops the docker_compose_up task; serverpod start brings up Docker itself when a docker-compose.yaml is present. Anchors the matcher's endsPattern to a comment at the source log line so a future rewording can't break the task->launch handoff silently.
_mountOrRetargetProxy now logs a warning and returns the existing proxy (or null) instead of throwing when the pod's vmServiceUri is null. The watch loop, codegen, MCP socket, and TUI keep running; only IDE-attach is unavailable for that pod. Bumps the VM service info-file poll timeout from 5s to 30s and adds a debug log of the resolved file path so a slow first boot doesn't get misdiagnosed as a missing file. The timeout warning now names the path and lists the most likely causes.
If a server is already running and reachable via the user-facing vm-service-info.json, both the CLI and TUI watch paths now log the existing URI and exit with code 0 instead of trying to bind another pod / proxy on top. Stale info files are cleaned up by _checkExistingServer. Drops the now-redundant 'projectname_server (attach only)' entry from the template launch.json: the primary config's preLaunchTask is safe to run when the server is already up. The existing-server log emits the same 'VM service proxy listening on' prefix a fresh start would emit so the task's problemMatcher fires either way.
nielsenko
force-pushed
the
feat-vm-proxy
branch
2 times, most recently
from
May 4, 2026 20:09
cb86163 to
8ba5241
Compare
WebSocket close reasons are capped at 123 bytes per RFC 6455
- calls applyPendingMigrations once per boot - drops the now-redundant '-- --apply-migrations' arg from tasks.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is an alternative to #dap. It achieves the same intercept on
reloadSourcesthat is needed to work-around dart-lang/sdk#62822.Where each design wins
Custom adapter wins on
Proxy wins on
package:dds/src/...implementation import, no stdio fallback, no announcement protocol, no vendored sdk code)Questions
serverpoddebug adapter a feature or a tax?