Repository navigation
fix: report an unregistered extension and a still-building start without a stack - #67
Conversation
…out a stack A connected command run before the app registered its extension printed the raw `(-32601) Method not found` RPC error with a vm_service stack. The client now maps -32601 (retries included) to ExtensionNotRegisteredException, and the dispatcher prints one line and exits 75 (ArtisanCommand.exitTryAgain). `start` on a cold native build let the scrape timeout escape as an unexpected error. The plain branch now checks the flutter run pid: alive, it keeps the booting session, prints a still-building line and exits 75; gone, it reaps the FIFO holder, removes the session, names the log and exits 1. A connected command against a booting session whose app is alive also exits 75.
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. The change looks correct to me, and I have no findings; the one gap is that the repo's own Why I think it is correct:
TestsNew tests cover every new path:
CI
|
…sion-and-start-timeout # Conflicts: # CHANGELOG.md
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. The only new commit merges The new commit is TestsThe tests for this PR are the same as in my last review. The merge only adjusts the existing XML and installer tests that came from #64. CI
|
Summary
Two defects from a field test of app-local connected commands (Watchools
player:*, which callext.watchools.playerfrombin/dispatcher.dart):Connected command player:state failed: ext.watchools.player: (-32601) Method not foundplus a vm_service stack (exit 3), then worked a few seconds later. A consumer cannot catch this itself without importingpackage:vm_service, which tripsdepend_on_referenced_packages.start --device macoson a fresh worktree: the first native build (CocoaPods, SwiftPM) outlasted the 90 s scrape, the timeout'sStateErrorescaped as an unexpected error whose visible tail was<asynchronous suspension>, and the session was leftbooting: truewith no URI while the app kept building.Changes:
VmServiceClient.callServiceExtensionmaps JSON-RPC-32601to a new publicExtensionNotRegisteredException, on the first call and on both retries (collected promise, refreshed isolate after a hot restart).ArtisanApplicationprints it as one line and exits 75.ArtisanCommand.exitTryAgain = 75(EX_TEMPFAIL): "not ready yet, retry".start, plain branch: the scrape throwsTimeoutException. Withflutter runalive,startkeeps the booting session, printsflutter run (pid <n>) is still building after <n>swith thestatus/ retry /--timeouthints and exits 75. With it gone, it stops the FIFO holder, removes the session (the log stays), names the log and exits 1.startto the first command that connects.--cdp-portbranch: behaviour unchanged (fail + reap, exit 1); the message drops theTimeoutException after <duration>prefix.doc/commands/start.md,skills/.../state-and-recovery.md,mcp-tools.md,SKILL.md, CHANGELOG under[Unreleased].Left as is: a permanent
-32601(a typo in the method, or a plugin newer than the app's copy) also exits 75 with "retry"; telling it apart would need anextensionRPCslookup per failure. A web runtime that reports a missing extension with a code other than-32601(older DWDS) keeps the old output.Verification
dart test: 1432 passed;dart analyze lib/ test/ bin/anddart formatclean; line coverage 87.78%;dart pub publish --dry-run0 warnings. Each new test failed first. The extension tests run against a fake JSON-RPC WebSocket server; a real Dart VM with no extension registered printed the one line and exited 75. The cold-build path is covered through the start seams; it has not been run against a real multi-minute macOS build.