Repository navigation
Conversation
Tencent#313 lists the connected browsers on a selector miss so the caller can pick a real instance or label instead of probing every browser in turn. The list reaches the `bsk --json` envelope as `data.browsers`, but `parseBskJson` reads only `code`, `message` and `hint`, so it stops at the plugin boundary. Carrying it on the error object would not help either: the tool layer re-throws and the host shows `error.message`. The list now renders into that message, between the summary and the hint, which is the order the CLI's own renderer uses. It stays on one line because `tools.ts` keeps only the first line of the message for the action card. Only `data.browsers` renders. `data` also carries `reason` for the session-busy retry and the ambiguous-label ids, and those envelopes are unchanged, as is every other error, timeout, interrupt and success path - checked by running both revisions over twelve envelopes, of which exactly two differ.
PerryLink
force-pushed
the
fix/dsh-plugin-selector-miss-candidates
branch
from
October 7, 2026 05:02
a1906ff to
0f19398
Compare
This branch has not been deployed
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.
#313 taught the CLI to list the connected browsers when a selector matches nothing, so a caller can pick a real instance or label instead of probing every browser in turn. The list reaches the JSON envelope; it does not reach a DSH user.
bsk --jsonreports the miss asNotFoundwith the candidates indata.browsers:{ "code": "not_found", "message": "requested browser is not connected", "data": { "browsers": [ … ] } }parseBskJsonreadscode,messageandhintand dropsdata, andBskErrorhas no field to carry it, so the candidates stop there. Putting them on the error object would not be enough either: the tool layer re-throws and the host showserror.message, so the list has to travel in the message.Change
One helper, used in the place the CLI's own renderer puts the table — between the summary and the hint:
It is deliberately one line.
tools.tskeepserror.message.split("\n")[0]for the action card, so a multi-line list would be truncated in the UI while looking complete in the transcript.Only
data.browsersrenders. Every other envelope is untouched, including the two that also usedata—session_busy'sreason, which drives the one-shot retry, and the ambiguous-label ids. An empty list renders nothing, matching the CLI, which leaves a miss against an empty registry unrendered too; an entry with noinstance_idis skipped rather than printed as a blank row.Verification
The two revisions were executed side by side over twelve envelopes. Two messages changed — the selector miss, and one case with a malformed candidate — and the other ten are byte-identical, covering
session_busy, thefill_value_mismatchenvelope, timeouts, killed-by-interrupt children, non-JSON stderr, and both success paths.Three cases were added to
tests/runner.test.ts: the candidate list (asserting the wording, the summary → candidates → hint order, and that the result is a single line), an empty list, and adatapayload that is not a candidate list.I have not run the package's own
vitesthere — the plugin's build step is what I could not reproduce locally — so the added cases are written to the file's existing conventions rather than reported green. The envelope comparison above runs the realrunner.tsfor both revisions.Thanks again for #313; this is the follow-up you flagged in review.