feat(cli): stream product frames to a wire debugger behind --debugger - #656
Open
decrypto21 wants to merge 1 commit into
Open
feat(cli): stream product frames to a wire debugger behind --debugger#656decrypto21 wants to merge 1 commit into
decrypto21 wants to merge 1 commit into
Conversation
decrypto21
force-pushed
the
nidish/debugger-cli-flag
branch
from
September 9, 2026 12:13
0935dcc to
429df49
Compare
Collaborator
|
can you add some screenshot / recording how how it looks in action? |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds a
--debuggerflag so the headlesstruapi-hostCLI streams its product frames to the wire debugger.Why: the debugger only ever sees the browser host.
wasm.rswas the sole non-testset_debug_sinkcaller, so every frame the CLI serves was unobservable, includingtruapi-host devand the wholee2e-*family.WsDebugSinkalready existed and was tested, with no caller outside its own tests.How:
frame_server.rsgains aDebugTappedRuntimethat wraps aProductRuntimeFactoryand installs a sink on every runtime it hands out;main.rsresolves the switch into that sink and wraps the factory each host role uses.global = trueputs it onpairing-host,signing-hostanddev, andTRUAPI_DEBUGGER_URLsets the same thing, which is how a harness attaches without a script change.connection_reset. The trait default would leave product connections alive across a session switch that exists to invalidate them, and nothing in the accept loop reports the omission, so it has a test that fails when the override is removed.dispatch, before any command binds a port, so a non-loopback orwss://target aborts on the argument rather than half-way through startup. A loopback URL succeeds with nothing listening, since the sink dials lazily and reconnects.Implements §9's native enablement path. §9 of the design doc spelled out only the browser rule and said no host wired the native sink up. It now states the native rule too.
Two changes beyond the flag:
truapi-server'sws-bridgefeature, which is whereWsDebugSinklives. Nothing declared it before; the mobile builds pass it on the command line. No new crates enter the tree, butcargo build --workspacenow compiles more oftruapi-server.host_core.rsrested on the CLI installing no sink. The lock-poisoning argument still holds on a narrower basis: not that wasm32 cannot unwind, but that every caller builds a freshSinkTransportperproduct_runtime()and installs at most once on it, sopreviousis alwaysNone.Verified against a live host.
scripts/battery.sh --signing-hostwithTRUAPI_DEBUGGER_URLset and no other change reaches the debugger as 148 ops over 484 frames and 1,003,511 bytes,codecMismatch: false,malformed: 0,truncated: 0. Sorting that capture by duration putsresourceAllocation.requestat 53.9s against an 821ms average, which is the kind of tail this exists to make visible. A/framedrill-down returns"kind": "decoded". fmt clean, clippy at zero, 222 crate tests pass.That run also rewrites
explorer/diagnosis-reports/spa/signing-host-cli.md. This branch leaves it alone: its new failures are the run's ephemeral identity, not this change.