Repository navigation
Commit ca7c6fc
fix(providers): secure web text entry, harden WebDriver transport and buttons, honor --relaunch (#4362)
* fix(platform-web): send fill and type text to agent-browser on stdin
Web fill, fillRef, and typeText passed the typed text as agent-browser
argv, which every host user can read in the process table, and copied
that argv into error details. Text entry now runs as a one-entry batch
read from stdin; a failed entry raises a typed text-entry-failed error
whose details carry no text.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(provider-webdriver): retry session delete and keep status on non-JSON errors
A gateway error with a non-JSON body (a 502 HTML page) threw before the
status was read, so it carried no status, was never retried, and lost
its dispatch disclosure. The status now decides as for a JSON error;
the raw body is truncated evidence.
DELETE /session/{id} had a single attempt, so one transient failure
left a billed session with nothing left to retry it. It now uses the
idempotent retry budget, and a W3C invalid session id answer reads as
the session already ended.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(provider-webdriver): route system buttons and app opens per Appium driver
UiAutomator2 registers no `mobile: pressButton`, so Android home and
app-switcher now press KEYCODE_HOME and KEYCODE_APP_SWITCH through
`mobile: pressKey`. XCUITest pressButton has no app-switcher button, so
the iOS capability map now declares appSwitcher unsupported and the
command refuses before the driver.
openDevice sent `mobile: activateApp` with no app id, which both drivers
reject; a leased session is already the foreground device, so it now
sends nothing. An iOS deep link names its app `bundleId`, the field the
XCUITest extension reads, instead of `package`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(contracts): carry open --relaunch through the direct lifecycle binding
The shared direct lifecycle closed before a relaunch only when an owner
opted in, and otherwise never forwarded terminateRunningApp, so on
Linux, web, HarmonyOS, Vega, and the CDP TV owner `open --relaunch`
returned success after a plain open. `closeBeforeRelaunch` is now a
required choice: the local direct owners close first, and an owner
whose open restarts the app (CDP TV) receives terminateRunningApp.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(tv-cdp): drop unreadable CDP frames instead of throwing in the socket handler
A non-JSON frame, a non-object message, or a throwing event listener
threw inside the WebSocket message handler, which Node reports as an
uncaught exception that ends the daemon. The handler now drops an
unreadable frame with a debug diagnostic, isolates each listener, and
the page log tolerates events that lack their payload fields.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(provider-webdriver): bound and type hosted app uploads, stream the build
postHubAppUpload had no deadline, let a network failure escape as a raw
TypeError, and reported a rejected credential as generic COMMAND_FAILED;
appFileUploadForm read the whole build into memory. The upload now runs
under a 15 minute deadline combined with the caller signal, wraps
transport failures with a typed reason and their cause, answers 401/403
as UNAUTHORIZED, and streams the file through a file-backed blob.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(provider-webdriver): look up Device Farm artifacts in the session's region
Artifact lookup preferred AWS_REGION over the region in the session ARN,
so a session created with --aws-region in another region listed its
artifacts against the wrong region and failed. The ARN names where the
session ran and now decides; the environment is the fallback.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-linux): launch an app binary detached from daemon pipes
`open <binary>` ran the app through the captured command runner, which
pipes stdio and appends every output chunk to memory until the child
exits, so a long-running desktop app grew daemon memory without bound.
The app now runs detached with ignored stdio; a spawn failure still
emits the linux_app_launch diagnostic.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* style: format provider remediation changes
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* test(provider-webdriver): keep new cases within the file line limit
Moves the session-delete release cases to runtime-session.test.ts and
the app-open interactor cases to their own file, so neither existing
test file passes the 1000-line lint limit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* test: fix typecheck in the new web and CDP test cases
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(providers): address review findings on text entry, CDP frames, and transport
- Web text entry checks that the one-entry batch answer echoes the
command it sent, and its failure message no longer carries the
backend's error text, which could quote the typed text.
- A CDP frame whose method is not a string is dropped instead of
answering a pending request; a listener's thrown value is described
without String(), and null console arguments are skipped.
- A 2xx WebDriver answer that is not JSON discloses dispatched unknown;
a non-2xx JSON null body stays null.
- Tests: upload deadline actually fires, the iOS app-switcher refusal
names its operation, and Device Farm runs exactly two lookups.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-web): drop backend output from text-entry failures
A failed text-entry batch call could still quote the typed text through
the generic error paths: stdout and stderr from a non-JSON answer or a
non-zero exit, and the envelope's error text. Text-entry failures now
keep only an allowlist of details (cmd, args, exitCode, dispatched,
reason, timeoutMs, hint), a generic message, and no cause chain. A
caller cancellation passes through unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(tv-cdp): load the diagnostics emitter only on the error path
The listener guard imported host-kit diagnostics eagerly, which grew the
tv-cdp eager import closure from 6 to 8 modules and failed the eager
closure budget. The emitter now loads with a function-scoped import
when an unreadable frame or a failing listener is reported.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-web): scrub only executed backend output from text-entry failures
The previous scrub rebuilt every text-entry failure with a generic
message, which replaced setup guidance for a missing backend and the
message of a canceled request. Redaction now happens where the output
enters the error: a failure read from the executed batch's answer gets
a generic message and loses stdout, stderr, the envelope error, and its
cause; a run failure keeps its code and message and loses only the
captured output; a failure from before the command ran passes through
unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-linux): report app launch exits and inject the detached launcher
The detached `open <binary>` launch reported only a spawn failure and
called the detached runner directly, past the provider's injectable
executors. A launch that exits non-zero or is killed by a signal now
emits the linux_app_launch diagnostic from the typed exit fields, and
the launcher is a `launchDetached` provider seam beside `runCommand`
with the detached runner as its default, so the app still never runs as
a captured child.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* test(platform-linux): assert each launch exit outcome reports its own diagnostic
The launch-report test counted three events across four exits, which a
path reporting twice could mask. Each exit now runs in its own
diagnostics scope, and the test checks the written event: a start error,
exit code 3, and SIGKILL each emit exactly one event carrying that
field, and a clean exit emits none.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(provider-webdriver): never read a non-JSON error page as an unsupported route
Since the non-JSON error body became truncated evidence, a gateway's
HTML 404, 405, or 501 page matched the bare-status unsupported-route
rule, so app activation, termination, and orientation fell back to a
sibling mutation that could repeat an action that already ran. A
non-JSON error answer is now built from its status alone with
dispatched unknown and never carries the route-unsupported reason. A
JSON answer keeps the existing W3C-code-or-bare-status rule.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-linux): launch through an injected executor unless a launcher is given
A caller that injected runCommand but no launchDetached got the
host-local detached runner, which silently bypassed its executor. The
detached runner is now the default only beside the default runCmd;
otherwise launches go through the injected executor. Also: the upload
deadline comment now says it is a total deadline, the activation test
no longer splits the #1774 comment from its test, and the unread
`error` field on AgentBrowserBatchEntry is gone.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-web): point a refused text entry at a fresh snapshot, not setup
A live stale-ref fill showed text-entry-failed carrying the "run web
setup" hint, but the backend ran and refused the entry. The hint now
tells the caller to take a new snapshot and retry with its ref.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* fix(platform-linux): keep the detached app launch on the ambient provider
The ambient Linux tool provider named `runCommand: runCmd` explicitly,
so after the injected-executor rule it launched apps through the
captured runCmd instead of the detached runner. It now names no
executor and takes the host-local defaults. A real-process test pins
the ambient provider: the launched app's stderr is /dev/null, where it
was a socket before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* refactor(platform-linux): require a launcher beside an injected executor
LinuxToolProviderOverrides is now a union: a caller that injects
runCommand must also inject launchDetached, so the host-local detached
runner never stands in beside an injected executor. The presence-keyed
default and launchThroughExecutor are gone; fixtures that inject
runCommand pass a launcher, and a compile-time pin keeps the refusal.
The ambient-provider detachment test stays.
A refused web text entry now hints per command: fill retries with a
fresh snapshot ref, and type (which takes no ref) focuses the field
again and retries.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
* test(platform-web): pin each text-entry operation to its own hint
The assertion chose the expected hint from the error message, so a
regression that relabelled typeText as fill would still pass.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016qAu53rMak1bXMuR5U2gF4
---------
Co-authored-by: Claude <[email protected]>1 parent 00c1d33 commit ca7c6fc
29 files changed
Lines changed: 1234 additions & 90 deletions
File tree
- packages
- contracts/src
- platform-linux/src
- __tests__
- platform-web/src
- provider-testmu/src
- provider-webdriver/src
- tv-cdp/src
- test/integration/provider-scenarios
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
95 | 159 | | |
96 | 160 | | |
97 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
273 | 277 | | |
274 | 278 | | |
275 | 279 | | |
| |||
327 | 331 | | |
328 | 332 | | |
329 | 333 | | |
| 334 | + | |
330 | 335 | | |
331 | 336 | | |
332 | 337 | | |
| |||
405 | 410 | | |
406 | 411 | | |
407 | 412 | | |
| 413 | + | |
| 414 | + | |
408 | 415 | | |
409 | 416 | | |
410 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | 10 | | |
5 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
6 | 20 | | |
7 | 21 | | |
8 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
9 | 28 | | |
10 | 29 | | |
11 | 30 | | |
| |||
18 | 37 | | |
19 | 38 | | |
20 | 39 | | |
| 40 | + | |
21 | 41 | | |
22 | 42 | | |
23 | 43 | | |
| |||
41 | 61 | | |
42 | 62 | | |
43 | 63 | | |
| 64 | + | |
44 | 65 | | |
45 | 66 | | |
46 | 67 | | |
| |||
64 | 85 | | |
65 | 86 | | |
66 | 87 | | |
| 88 | + | |
67 | 89 | | |
68 | 90 | | |
69 | 91 | | |
| |||
93 | 115 | | |
94 | 116 | | |
95 | 117 | | |
| 118 | + | |
96 | 119 | | |
97 | 120 | | |
98 | 121 | | |
| |||
101 | 124 | | |
102 | 125 | | |
103 | 126 | | |
| 127 | + | |
104 | 128 | | |
105 | 129 | | |
106 | 130 | | |
| |||
143 | 167 | | |
144 | 168 | | |
145 | 169 | | |
| 170 | + | |
146 | 171 | | |
147 | 172 | | |
148 | 173 | | |
| |||
162 | 187 | | |
163 | 188 | | |
164 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
165 | 309 | | |
166 | 310 | | |
167 | 311 | | |
| 312 | + | |
168 | 313 | | |
169 | 314 | | |
170 | 315 | | |
| |||
181 | 326 | | |
182 | 327 | | |
183 | 328 | | |
| 329 | + | |
184 | 330 | | |
185 | 331 | | |
186 | 332 | | |
| |||
0 commit comments