Skip to content

Commit bf999b2

Browse files
thymikeeclaude
andcommitted
fix(ios): give a sequence step that may have run its real gesture window
The step's window runs from before dispatch to the failure instead of a zero-length window. RUNNER_PROTOCOL.md says `dispatched: "no"` rides only on a delivered reply; a lost reply is reported as unknown. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 19faa4d commit bf999b2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎apple/runner/AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+SequenceExecution.swift‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ extension RunnerTests {
187187
let longPressDurationMs = min(max(step.durationMs ?? 800, 16), 10000)
188188
if let policyKind = synthesizedPolicyKind(forSequenceStep: step) {
189189
let attempt: SynthesizedGestureAttempt
190+
let attemptStartUptimeMs = currentUptimeMs()
190191
do {
191192
attempt = try performSynthesizedGesture(activeApp, kind: policyKind, context: synthesizedContext, synthesize: {
192193
try synthesizedSequenceStep(
@@ -199,10 +200,11 @@ extension RunnerTests {
199200
)
200201
})
201202
} catch let unknown as RunnerGestureOutcomeUnknown {
202-
// The step may have run, so the sequence stops on it instead of retrying it.
203+
// The step may have run, so the sequence stops on it instead of retrying it. Its window runs
204+
// from before dispatch to the failure, covering whatever part of it ran.
203205
return finishedSequenceStep(
204206
step,
205-
timing: measureGesture {},
207+
timing: (attemptStartUptimeMs, currentUptimeMs()),
206208
outcome: .unsupported(message: unknown.message, hint: unknown.hint)
207209
)
208210
}

‎apple/runner/RUNNER_PROTOCOL.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ Successful and failed responses use the same top-level envelope:
190190

191191
An error may carry `"dispatched": "no"` when the runner provably sent nothing, such as a synthesized
192192
gesture that failed before its events reached XCTest. The daemon reads it as `details.dispatched: no`.
193+
It is carried only on a delivered reply; a reply lost and recovered through the `status` journal is
194+
reported as unknown.
193195
Without it, the code alone decides; a synthesized gesture that failed after its events reached
194196
XCTest answers `UNSUPPORTED_OPERATION` without the field, an unknown outcome, and is never retried
195197
through an XCTest fallback.

0 commit comments

Comments
 (0)