Commit 52061d2
[fix](VA) Keep in-progress playwright-cli commands in computer-use recordings (#14544)
## Description
On Linux, computer-use video recordings are smart-trimmed after
stopping: only committed recording action groups produce keep-windows,
and everything else is hard-cut. Shell commands never enter the
recording timeline, so when the agent drives the browser via
`playwright-cli`, all of that on-screen work was cut from the video.
This PR keeps in-progress `playwright-cli` commands in the recording:
- `ShellCommandExecutor` now detects `playwright-cli` invocations
(skipping leading env-var assignments and resolving the program path's
file name, so `npm install playwright-cli` or `echo playwright-cli`
don't match) and opens a recording action group before the command
starts.
- When the command finishes (any exit code), the pending group is
committed; if the action is cancelled or the block is not found, it is
discarded.
- A `playwright-cli` command that outlives the executor's poll window
returns a long-running snapshot; the group stays open and is committed
when a later `ReadShellCommandOutput` poll observes the finished block.
Since that poll runs in a separate executor call, a new
`RecordingController::commit_action_group_now` helper commits the
pending group using the recording's own elapsed clock (no-op when no
recording is active or no group is pending).
- If the recording is stopped/finalized while a group is still pending
(e.g. a long-running `playwright-cli` session never observed finished),
claiming the active recording for finalization settles the pending group
at the stop point instead of dropping it, via a shared
`ActiveRecording::commit_pending_group_now` helper also used by
`begin_action_group`'s auto-commit.
Other shell commands (npm/cargo/etc.) never open a group, so they remain
trimmed exactly as before. Behavior is unchanged when no recording is
active: all recording calls no-op unless a recording is Active for the
conversation.
## Linked Issue
None — recording-quality fix scoped and dispatched via Oz orchestration.
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
- [ ] Where appropriate, screenshots or a short video of the
implementation are included below (especially for user-visible or UI
changes).
## Testing
- Added a unit test for the `playwright-cli` command detector
(`detects_playwright_cli_commands`) covering plain, env-prefixed, and
absolute-path invocations plus non-matches (`npm install
playwright-cli`, `echo playwright-cli`, `cargo build`).
- Added a regression test (`finalization_commits_open_pending_group`)
asserting that finalizing while a group is pending commits its window
instead of dropping it.
- `cargo nextest run -p warp -E 'test(detects_playwright_cli_commands)
or test(block_working_directory_updated_does_not_drain_finish_senders)
or test(/recording_controller/)'` — 17/17 passed.
- `./script/format --check` — clean.
- `cargo clippy --workspace --exclude warp_completer --all-targets
--tests -- -D warnings`, `cargo clippy -p warp --all-targets --tests --
-D warnings`, and `cargo clippy -p warp_completer --all-targets --tests
-- -D warnings` — all green.
- [ ] I have manually tested my changes locally with `./script/run`
Runtime behavior only differs on Linux (macOS recordings keep
everything, no smart cut), so this was verified on macOS via build +
unit tests rather than a live recording.
## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
CHANGELOG-BUG-FIX: In-progress playwright-cli browser automation is now
preserved in computer-use video recordings instead of being trimmed out.
Co-Authored-By: Oz <oz-agent@warp.dev>
---------
Co-authored-by: Oz <oz-agent@warp.dev>1 parent d84b4e3 commit 52061d2
3 files changed
Lines changed: 166 additions & 17 deletions
File tree
- app/src/ai/blocklist/action_model
- execute
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
261 | 270 | | |
262 | 271 | | |
263 | 272 | | |
| |||
278 | 287 | | |
279 | 288 | | |
280 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
281 | 308 | | |
282 | 309 | | |
283 | 310 | | |
| |||
358 | 385 | | |
359 | 386 | | |
360 | 387 | | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
361 | 395 | | |
362 | 396 | | |
363 | 397 | | |
| |||
372 | 406 | | |
373 | 407 | | |
374 | 408 | | |
| 409 | + | |
375 | 410 | | |
376 | 411 | | |
377 | 412 | | |
| |||
383 | 418 | | |
384 | 419 | | |
385 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
386 | 432 | | |
387 | 433 | | |
388 | 434 | | |
| |||
Lines changed: 82 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
138 | 158 | | |
139 | 159 | | |
140 | 160 | | |
| |||
277 | 297 | | |
278 | 298 | | |
279 | 299 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 300 | + | |
294 | 301 | | |
295 | 302 | | |
296 | 303 | | |
| |||
305 | 312 | | |
306 | 313 | | |
307 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
308 | 336 | | |
309 | 337 | | |
310 | 338 | | |
| |||
335 | 363 | | |
336 | 364 | | |
337 | 365 | | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
338 | 379 | | |
339 | 380 | | |
340 | 381 | | |
| |||
396 | 437 | | |
397 | 438 | | |
398 | 439 | | |
399 | | - | |
| 440 | + | |
400 | 441 | | |
401 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
402 | 448 | | |
403 | 449 | | |
404 | 450 | | |
| |||
515 | 561 | | |
516 | 562 | | |
517 | 563 | | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
518 | 585 | | |
519 | 586 | | |
520 | 587 | | |
| |||
Lines changed: 38 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
| 379 | + | |
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
385 | 386 | | |
386 | 387 | | |
387 | 388 | | |
388 | | - | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
389 | 425 | | |
0 commit comments