Skip to content

Commit d84b4e3

Browse files
vkodithalaoz-agent
andauthored
[fix](VA) Keep non-zero wait action groups in computer-use recordings (#14540)
## Description Computer-use recordings on Linux are smart-trimmed: only committed action groups produce keep-windows, and everything else is hard-cut. `is_meaningful_action_group` treated every `Wait`-only batch as non-meaningful, so a standalone "wait for the UI to settle" call was never committed and its settling period was cut from the video, even though it plays out in real time on screen. This changes the predicate to count any non-zero `Wait` as meaningful (via the existing `Action::is_no_op()` helper), while `Wait(0)` no-op batches — emitted for screenshot/zoom/cursor-position-only calls — remain excluded so empty frames are still trimmed. Non-`Wait` actions are unaffected. The commit path already records the full wait duration in the group's `[offset, finish_offset]` span, so no other changes are needed. ## Linked Issue N/A — recording-quality fix from the CU video trim pipeline work. - [ ] 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 Updated the existing `is_meaningful_action_group` unit test: a 500 ms wait-only group now asserts meaningful, while the `Wait(0)` and empty-slice cases keep asserting non-meaningful. Ran locally (macOS): - `cargo nextest run -p computer_use` — 62 passed, 0 skipped - `./script/format --check` — clean - `cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings` — clean - `cargo clippy -p warp --all-targets --tests -- -D warnings` — clean - `cargo clippy -p warp_completer --all-targets --tests -- -D warnings` — clean Not manually tested with `./script/run`: the trim only runs on Linux recordings, and the change is fully covered by the unit test on the pure predicate. - [ ] I have manually tested my changes locally with `./script/run` ## Agent Mode - [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode Conversation: https://staging.warp.dev/conversation/df74c6da-5f2a-4a0f-99a6-7b9e8b64cb1f Run: https://oz.staging.warp.dev/runs/019fb41e-c9c2-778f-844e-afcf68f7bf0e CHANGELOG-BUG-FIX: Computer-use video recordings now keep real (non-zero) wait periods at real time instead of trimming them out. Co-Authored-By: Oz <oz-agent@warp.dev> Co-authored-by: Oz <oz-agent@warp.dev>
1 parent b462e01 commit d84b4e3

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

crates/computer_use/src/overlay.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ pub enum PointerEventKind {
5252
}
5353

5454
/// Returns true if a `UseComputer` action batch contains at least one real
55-
/// interaction — any non-`Wait` action (keyboard, typing, pointer, or scroll).
56-
/// A wait-only or zero-duration no-op batch (for example a screenshot-only
57-
/// call, which emits a single `Wait(0)`) is not a qualifying action group and is
58-
/// not committed to the recording timeline. A pointer-only batch still
59-
/// qualifies (with empty labels) so its on-screen effects are retained.
55+
/// interaction — any non-`Wait` action (keyboard, typing, pointer, or scroll)
56+
/// or an explicit non-zero wait, whose settling time should be kept in the
57+
/// recording. Only batches made entirely of `Wait(0)` no-ops (for example a
58+
/// screenshot-only call) fail to qualify and are not committed to the
59+
/// recording timeline. A pointer-only batch still qualifies (with empty
60+
/// labels) so its on-screen effects are retained.
6061
pub fn is_meaningful_action_group(actions: &[TargetedAction]) -> bool {
61-
actions
62-
.iter()
63-
.any(|targeted| !matches!(targeted.action, Action::Wait(_)))
62+
actions.iter().any(|targeted| !targeted.action.is_no_op())
6463
}
6564

6665
enum LabelCandidate {

crates/computer_use/src/overlay_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ fn is_meaningful_action_group_true_for_real_interactions() {
136136
}
137137

138138
#[test]
139-
fn is_meaningful_action_group_false_for_wait_only_or_empty() {
139+
fn is_meaningful_action_group_keeps_nonzero_waits_but_not_no_ops() {
140140
let zero_wait = [screen(Action::Wait(Duration::ZERO))];
141141
assert!(!is_meaningful_action_group(&zero_wait));
142142

143143
let nonzero_wait = [screen(Action::Wait(Duration::from_millis(500)))];
144-
assert!(!is_meaningful_action_group(&nonzero_wait));
144+
assert!(is_meaningful_action_group(&nonzero_wait));
145145

146146
assert!(!is_meaningful_action_group(&[]));
147147
}

0 commit comments

Comments
 (0)