diff --git a/packages/dsh-plugin-browserskill/src/runner.ts b/packages/dsh-plugin-browserskill/src/runner.ts index 3f05426..c747177 100644 --- a/packages/dsh-plugin-browserskill/src/runner.ts +++ b/packages/dsh-plugin-browserskill/src/runner.ts @@ -177,7 +177,10 @@ export function parseBskJson(result: BskRunResult, commandLabel: string): unknow } const message = parsed?.message ?? (result.stderr.trim() || body || `bsk ${commandLabel} failed`); - throw new BskError(`bsk ${commandLabel} failed: ${message}`, { + // Surface the envelope's actionable hint in the model-facing message; a + // hint the model cannot see cannot be followed. + const withHint = parsed?.hint !== undefined ? `${message} (hint: ${parsed.hint})` : message; + throw new BskError(`bsk ${commandLabel} failed: ${withHint}`, { code: parsed?.code, hint: parsed?.hint, exitCode: result.code, diff --git a/packages/dsh-plugin-browserskill/tests/runner.test.ts b/packages/dsh-plugin-browserskill/tests/runner.test.ts index 35dc279..dabe046 100644 --- a/packages/dsh-plugin-browserskill/tests/runner.test.ts +++ b/packages/dsh-plugin-browserskill/tests/runner.test.ts @@ -109,6 +109,7 @@ describe("parseBskJson", () => { exitCode: 3, }); expect((error as Error).message).toContain("no browser connected"); + expect((error as Error).message).toContain("hint: open Chrome"); } });