Skip to content

Default to an installed build, and report missing video tooling - #331881

Merged
Bryan Chen (bryanchen-d) merged 5 commits into
mainfrom
copilot/vscode/scenario-defaults
Aug 21, 2026
Merged

Default to an installed build, and report missing video tooling#331881
Bryan Chen (bryanchen-d) merged 5 commits into
mainfrom
copilot/vscode/scenario-defaults

Conversation

@bryanchen-d

@bryanchen-d Bryan Chen (bryanchen-d) commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Three problems found running the validate-ui-scenario skill from a fresh checkout against #244597.

Nothing ran without a target flag

With no flags the runner used the build from the checkout, which only exists after compiling the product. Verified on unmodified main: the documented starting point fails to launch.

Failed to launch Electron within 60000ms.
Original error: electronApplication.waitForEvent: Target page, context or browser has been closed

Reproducing a reported issue means running the shipped product anyway, so with no target flag the runner now finds an installed VS Code Insiders — falling back to Stable — and logs the choice:

No target given, using the installed build at C:\...\Microsoft VS Code Insiders. Pass --dev to run this checkout instead.

--dev selects the checkout build, and --build <app-root> still pins an exact install. Existing callers that pass --build are unaffected.

A missing ffmpeg was only discovered after the run

Captions are rendered once the scenario finishes, so a missing ffmpeg surfaced as a raw spawnSync ffprobe ENOENT after VS Code had been driven and the report written — and it threw out of runScenario, so the run never printed its outcome.

The runner now checks before launching anything and names the fix for the platform:

Warning: ffmpeg and ffprobe not found on PATH, so the recording will not be captioned with step titles.
         The run still produces the raw video, screenshots, trace and report.
         To caption it, install ffmpeg (winget install Gyan.FFmpeg), make sure it is on PATH, and re-run,
         or annotate the finished run with: node test/scenario/out/renderEvidenceChapters.js <run-dir>

Caption rendering can no longer fail a run that has already produced its evidence, and the post-run message is actionable rather than an ENOENT stack.

The window did not fill the recording

The recording canvas is 1920x1080, but VS Code sizes its own window — DEFAULT_WORKSPACE_WINDOW_SIZE is 1440x900 and DEFAULT_EMPTY_WINDOW_SIZE is 1200x800 — so the capture showed the window in the top-left corner of a larger frame, wasting about 30% of every pixel recorded.

Measured on the reporting machine:

Window viewport 1440 x 900
Video canvas 1920 x 1080
Display work area 1512 x 901

The window is now sized to the canvas once recording is enabled. The display being smaller than the canvas is fine — confirmed by probing before implementing: after setBounds, innerWidth/innerHeight report 1920x1080 and both the screenshot and the video come back full frame on a 1512x901 display. Sizing only happens when video recording is on, so non-recording smoke runs are untouched.

Verification

Against installed Insiders on Windows, with the skill's own documented example:

  • no flags, ffmpeg absent: warns up front, runs both steps, writes the report, warns again with the install command, exits 1 for the reproduced failure
  • no flags, ffmpeg present: same run, plus videos/annotated.mp4 at 1920x1300 (1080 of workbench + the caption band) with no dead space
  • screenshots and raw recording are both 1920x1080, where they were 1440x900 inside a 1920x1080 frame before
  • --dev still resolves the checkout build; it fails to launch here only because this checkout is not built, identically to unmodified main

ffmpeg was installed, and still not found

A PATH edit only reaches processes started afterwards, so an editor that was already running never sees it. On the reporting machine ffmpeg was installed and present in the persisted user PATH, yet invisible to the shell the skill ran in — so the run produced no annotated video.

The runner now probes the usual install locations (winget Links and Packages, chocolatey, Program Files, Homebrew, /usr/local/bin) in addition to PATH. Verified with ffmpeg deliberately off PATH:

$ node test/scenario/out/runScenario.js .build/vscode-playwright-mcp/issue-250159.cjs
Captioned 2 steps into videos/annotated.mp4

No warning, no manual setup.

Steps flowed past too quickly to read

A caption is only legible for as long as its step is on screen, and an asserting step can finish in a few hundred milliseconds. Each finished step is now held briefly — stepPauseMs, default 1000, set 0 for timing-sensitive scenarios.

Blocked steps are classified and reported

skip previously recorded only that a step did not run. It now takes needs:

needs Meaning Consequence
human A person is required — hardware, a judgement call, a sign-in that cannot be scripted Reported so someone can check it by hand
infrastructure Automatable, but the harness cannot do it yet Reported as an enhancement request against the skill

The distinction is recorded in manifest.json, highlighted in a Needs attention section of report.html, shown on the caption band, and printed at the end of the run:

  SKIP B-02 Verify the printed page matches [needs human]: Comparing physical print output requires a person with a printer.
Needs a person: B-02 Verify the printed page matches - Comparing physical print output requires a person with a printer.
Outcome: aborted

Both variants were exercised end to end; the caption band renders SKIPPED - NEEDS HUMAN in amber, later steps do not run, and the outcome is aborted rather than passed. test/mcp still compiles against the widened EvidenceService.step signature.

Authored with Copilot

Three problems surfaced running the skill from a fresh checkout.

Nothing ran without a target. With no flags the runner used the build from the
checkout, which only exists after compiling the product, so the documented
starting point failed to launch. Reproducing a reported issue means running the
shipped product anyway, so with no target flag it now finds an installed VS Code
Insiders (falling back to Stable) and logs which one it chose. `--dev` selects the
checkout build, and `--build` still pins an exact install.

A missing ffmpeg was only discovered after the run, as a raw ENOENT, and it threw
out of `runScenario` after the report had been written. The runner now checks for
ffmpeg and ffprobe before launching anything and prints the install command for
the platform, and caption rendering can no longer fail a run that has already
produced its evidence.

The window did not fill the recording. The canvas is 1920x1080 while VS Code
sizes its own window (1440x900 with a workspace, 1200x800 empty), so the capture
showed the window in the top-left corner surrounded by dead space. The window is
now sized to the canvas once recording is on; a window larger than the display
still renders at that size, so this holds on smaller screens.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485
Copilot AI balanced review requested due to automatic review settings August 20, 2026 22:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves UI scenario validation for fresh checkouts and installed VS Code builds.

Changes:

  • Defaults to installed Insiders/Stable, with --dev for checkout builds.
  • Reports missing video tools and makes caption failures non-fatal.
  • Sizes desktop windows to the recording canvas and updates guidance.
Show a summary per file
File Description
test/scenario/src/runScenario.ts Adds video-tool checks and safe caption rendering.
test/scenario/src/renderEvidenceChapters.ts Exposes non-failing caption rendering.
test/scenario/src/options.ts Adds the --dev option.
test/scenario/src/application.ts Discovers installed VS Code builds by default.
test/automation/src/playwrightElectron.ts Resizes recorded Electron windows.
.github/skills/validate-ui-scenario/SKILL.md Documents new targeting and tooling behavior.

Review details

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment thread test/scenario/src/application.ts Outdated
Comment thread .github/skills/validate-ui-scenario/SKILL.md Outdated
Comment thread test/scenario/src/options.ts
Comment thread test/scenario/src/application.ts
Follow-up to the same skill run.

Captions were missing even though ffmpeg was installed. A PATH edit only reaches
processes started afterwards, so an editor that was already running never sees
it, and the runner concluded ffmpeg was absent. It now looks in the usual install
locations as well as PATH, which is the difference between an annotated recording
and a raw one on a machine that already has ffmpeg.

Steps flowed past too quickly to read. A caption is only legible for as long as
its step is on screen, and steps that assert rather than type can complete in a
few hundred milliseconds. Each finished step is now held briefly, controlled by
`stepPauseMs` and disabled with `0` for timing-sensitive scenarios.

Steps that cannot be automated were indistinguishable from ones that were merely
unavailable. `skip` now takes `needs: human` or `needs: infrastructure`: the first
means a person has to check it, the second means the harness could do it but
cannot yet, which is an enhancement request rather than a permanent limit. The
distinction is recorded in the manifest, highlighted in the report, shown on the
video caption, and printed at the end of the run.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485
@bryanchen-d
Bryan Chen (bryanchen-d) marked this pull request as draft August 20, 2026 23:19
Review follow-ups.

The evidence labelled every installed run `Dev`. Quality was read from the
environment, which only describes a build made from this checkout, so a run
against installed Insiders was reported as Dev in both the manifest and the
report - the evidence named the wrong product. An installed build stamps its own
quality in `product.json`, so that is now the source when a build path is given.
This also corrects `--build`, which had the same problem before this change.

Linux missed Snap installs. Snap keeps the app under a read-only revision root,
so a machine with VS Code installed only through Snap found nothing and fell back
to the unbuilt checkout - the exact failure the new default exists to avoid.

The web launcher recorded 1920x1080 while sizing the page to 1440x900, so the
no-empty-margins claim did not hold there. It now matches the canvas while
recording and keeps its established size otherwise, so smoke runs are unchanged.

`--dev` was accepted but undocumented in the runner's own help, which now lists
all three targets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485
VS Code on Windows applies a downloaded update by swapping the executable during
startup, so a launch attempt exits before showing a window. Playwright then waits
the full launch timeout and reports that the process "likely crashed or hung",
which sends the reader looking for crash dumps that do not exist.

Insiders downloads an update most days, so anyone reproducing an issue will meet
this. A `new_<exe>` beside the target is the marker, and checking for it turns a
60s misleading timeout into an immediate statement of the cause and the fix.

Confirmed the launch failure is environmental rather than harness behaviour: a
bare Playwright launch of the same installed build, with none of this code in the
path, also never receives a window while the update is staged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: adb443eb-11e5-40a1-8608-7f593fa79485
@bryanchen-d
Bryan Chen (bryanchen-d) marked this pull request as ready for review August 21, 2026 17:27
@bryanchen-d
Bryan Chen (bryanchen-d) merged commit c1ca63f into main Aug 21, 2026
27 checks passed
@bryanchen-d
Bryan Chen (bryanchen-d) deleted the copilot/vscode/scenario-defaults branch August 21, 2026 18:14
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants