Repository navigation
Conversation
… no PNG adb emu exits 0 when the console refuses a command; the only sign is a KO: line on stdout. Include that reply in the no-PNG error so an auth-token mismatch reaches the user. Closes #1338.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…a capture A missing or symlinked token makes adb skip auth, and the console then answers the screenshot with only 'KO: unknown command'. Join the reply onto one line, say when it is empty, and name the token file adb reads. runEmuConsole reports the whole reply too, so a token mismatch no longer loses its auth line behind the trailing verdict.
latekvo
left a comment
There was a problem hiding this comment.
[Diplomat, Opus 5.5]: Review of the console-reply change, findings already fixed on the branch and answered in each thread. Two PR-description claims were also corrected: coverage was narrowed to screenshot and flow snapshot: steps (settle and failed-step captures swallow capture errors), and the verification no longer shows a single-line KO reply, since real adb prints two lines on a token mismatch. Out of scope, filed as #1589: a temp dir path with a space makes the capture fail with ...: OK and leaves a stray PNG in the emulator's cwd.
…follows it libbase defines O_NOFOLLOW as 0 on Windows, so a symlinked token works there. Also pin that other KO: unknown replies get no token hint.
latekvo
left a comment
There was a problem hiding this comment.
[Diplomat, Opus 5.5]: Second pass over the console-reply change: claims checked against AOSP adb/libbase source, sibling adb emu call sites, failure paths, telemetry export, and 13 mutants against the tool-server tests. One new finding below, plus a test gap on the existing hint-condition thread; both fixed on the branch. Out of scope, filed as #1698: the preview window's "Shut down" reports success when the console refuses adb emu kill.
Closes #1338
adb emuexits 0 when the emulator console refuses a command; the only sign is aKO:line on stdout. Vega capture dropped that output. The no-PNG error now carries the reply on one line. When the reply ends inKO: unknown command(the console never authenticated adb: token missing, a symlink, or mismatched), it also names the token file adb reads.runEmuConsole(shake, fold) reports the whole reply too, so a token mismatch keeps its auth line.The message reaches
screenshotand flowsnapshot:steps; settle and failed-step captures swallow capture errors by design.emulator console wrote no PNG to /var/…/vega-shot-q9pnX7 for emulator-5554emulator console wrote no PNG for emulator-5554: KO: authentication token does not match ~/.emulator_console_auth_token; KO: unknown command, try 'help' (adb authenticates to the console with <HOME>/.emulator_console_auth_token, which must be a regular file, not a symlink, holding the emulator's token)emulator console wrote no PNG for emulator-5554: KO: unknown command, try 'help' (adb authenticates to the console with <HOME>/.emulator_console_auth_token, …)emulator console wrote no PNG for emulator-5554: empty replyNo docs update needed.
Verification
Real VVD (
emulator-5554), branchdist, tool-server started withHOMEpointing at a mismatched token,POST /tools/screenshot:Raw
adb emu screenrecord screenshotreplies on that VVD (all exit 0): matching tokenOK\r\n+ PNG; mismatchedKO: authentication token does not match …\r\nKO: unknown command, try 'help'\r\n; missing or symlinked tokenKO: unknown command, try 'help'\r\n.captureVegaScreenshotPngandrunEmuConsolefromdistwere run against each; the matching token still returns a PNG.New tests in
test/vega-screen.test.tsandtest/emulator-console.test.tsfail on the pre-fix code; mutating the hint condition (anyKO:, any line) or dropping it fromrunEmuConsolefails them too.Checks:
tsc --build,typecheck:tests, prettier, eslint, knip pass; tool-server vitest (6 shards) passes exceptflows/e2e-tool-aliases(81 vs 83 ids), which fails the same way locally on main and passes on CI.