You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b46ac6d
Browse filesBrowse the repository at this point in the historyBrowse files
fix(ios): classify the keyboard dismiss refusal by what it dispatched
`keyboard dismiss` refused two different things with one untyped message, so a caller had to match
prose to tell them apart. A keyboard that exposes no dismiss key and a dismiss control that was tapped
and left the keys up are different verdicts: the first sent nothing, the second dispatched.
The runner now answers the no-dismiss-key refusal with its own wire code, KEYBOARD_DISMISS_UNAVAILABLE,
declared in RunnerWireErrorCode and classified by the existing runner-code table. It keeps the code the
command already refused with, UNSUPPORTED_OPERATION, through a wireCode row, so the published code
contract is unchanged, and it gains details.reason keyboard_dismiss_unavailable with dispatched: no.
dismissKeyboard answers a RunnerKeyboardDismissOutcome carrying dismissControlFound, which also decides
which of the two verdicts a tvOS keyboard stayed up for. Help, the runner protocol, and the command
docs state which refusal sends nothing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
returnResponse(ok:false,error:ErrorPayload(message:"keyboardDismiss produced no result"))
596
596
}
597
597
ifresult.wasVisible&&!result.dismissed{
598
-
returnResponse(
599
-
ok:false,
600
-
error:ErrorPayload(
601
-
code:"UNSUPPORTED_OPERATION",
602
-
message:"Unable to dismiss the iOS keyboard: the keyboard exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)",
603
-
hint:
604
-
"An element whose center sits behind the on-screen keyboard is refused with tap_keyboard_occludes_target; one whose center stays above the keys presses normally. To end editing, tap the app's own Done/Cancel control, or use keyboard enter to press the return key when submission is wanted."
message:"Unable to dismiss the keyboard: it exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)",
281
+
hint:keyboardDismissRefusalHint
282
+
)
283
+
}
284
+
285
+
privatevarkeyboardDismissRefusalHint:String{
286
+
return
287
+
"An element whose center sits behind the on-screen keyboard is refused with tap_keyboard_occludes_target; one whose center stays above the keys presses normally. To end editing, tap the app's own Done/Cancel control, or use keyboard enter to press the return key when submission is wanted."
288
+
}
289
+
229
290
230
291
// AX-free on purpose (screenshot bytes, not the accessibility tree) so it holds
231
292
// under the same AX degradation the synthesized gesture lane is built to survive.
Copy file name to clipboardExpand all lines: apple/runner/RUNNER_PROTOCOL.md
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -252,12 +252,19 @@ Successful and failed responses use the same top-level envelope:
252
252
{
253
253
"ok": false,
254
254
"error": {
255
-
"code": "UNSUPPORTED_OPERATION",
256
-
"message": "Unable to dismiss the iOS keyboard: the keyboard exposes no dismiss key (background taps are never attempted)"
255
+
"code": "KEYBOARD_DISMISS_UNAVAILABLE",
256
+
"message": "Unable to dismiss the keyboard: it exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)"
257
257
}
258
258
}
259
259
```
260
260
261
+
The example is a `keyboard dismiss` the keyboard would not come down for; a refusal that can name a
262
+
next step also carries `hint`, omitted here. A keyboard that stayed up answers one of two codes:
263
+
`KEYBOARD_DISMISS_UNAVAILABLE` when it found no dismiss control and so sent nothing, or
264
+
`UNSUPPORTED_OPERATION` when a dismiss control was tapped, or the tvOS remote's Menu press was sent,
265
+
and the keyboard stayed visible. The host reports both under `UNSUPPORTED_OPERATION` and publishes the
266
+
first one's `details.reason`.
267
+
261
268
`data` is command-specific. Common fields include snapshot nodes, text lookup results, gesture timing, visibility metadata, and screenshot or recording output details.
262
269
263
270
Capture-plan snapshots carry `snapshotViewport`, the acquisition's declared viewport evidence.
@@ -310,7 +317,9 @@ declaration for the current rules.
310
317
the main-thread watchdog in [`RunnerTests+Transport.swift`](AgentDeviceRunner/AgentDeviceRunnerUITests/RunnerTests+Transport.swift). The daemon
311
318
classifies a runner-reported code in `classifyRunnerReportedError`
312
319
([`runner-contract.ts`](../../packages/apple-runner/src/runner-contract.ts)): codes listed in `DIAGNOSTIC_ONLY_RUNNER_ERROR_CODES`
313
-
arrive as `COMMAND_FAILED` with `details.runnerErrorCode`, and other codes pass through as typed
314
-
codes. How the daemon reacts to a failure (retry, resend, session-fatal) is declared in
320
+
arrive as `COMMAND_FAILED` with `details.runnerErrorCode`, unless their row names the wire code the
321
+
caller already reads that family under. Other codes pass through as typed codes. A code with a
322
+
`RUNNER_REPORTED_ERROR_REASONS` row also publishes `details.reason`, so a caller never reads the
323
+
refusal off `message`. How the daemon reacts to a failure (retry, resend, session-fatal) is declared in
Copy file name to clipboardExpand all lines: contracts/fixtures/dispatch-disclosure.json
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -301,6 +301,12 @@
301
301
"trigger": "structured runner reply with code COMMAND_ALREADY_FINISHED: the journal refused a repeat of a spent commandId and kept no outcome to replay, so it cannot say what that command did",
"trigger": "structured runner reply with code KEYBOARD_DISMISS_UNAVAILABLE: `keyboard dismiss` refused because the visible keyboard exposes no dismiss key, before any tap",
test('parseRunnerResponse keeps the keyboard-dismiss refusal under the code the command reports',async()=>{
14
14
constresponse=newResponse(
15
15
JSON.stringify({
16
16
ok: false,
17
17
error: {
18
-
code: 'UNSUPPORTED_OPERATION',
19
-
message: 'Unable to dismiss the iOS keyboard without a safe native dismiss control',
18
+
code: 'KEYBOARD_DISMISS_UNAVAILABLE',
19
+
message:
20
+
'Unable to dismiss the keyboard: it exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)',
@@ -40,8 +45,9 @@ test('parseRunnerResponse surfaces the keyboard-dismiss hint naming the occlusio
40
45
JSON.stringify({
41
46
ok: false,
42
47
error: {
43
-
code: 'UNSUPPORTED_OPERATION',
44
-
message: 'Unable to dismiss the iOS keyboard without a safe native dismiss control',
48
+
code: 'KEYBOARD_DISMISS_UNAVAILABLE',
49
+
message:
50
+
'Unable to dismiss the keyboard: it exposes no dismiss key, and background taps are never attempted (no tap outside the keyboard can be proven side-effect-free)',
45
51
hint,
46
52
},
47
53
}),
@@ -54,9 +60,6 @@ test('parseRunnerResponse surfaces the keyboard-dismiss hint naming the occlusio
0 commit comments