Repository navigation
fix(browserstack): carry the full provider-allocation config over the lease_allocate envelope (#2494) - #2495
Conversation
…nvelope `--provider-project`, `--provider-build`, and `--provider-session-name` are stored in the connection profile and reach the daemon on the line transport (which forwards the whole request), but the compact JSON-RPC lease envelope carried only `providerApp`. Over HTTP/remote daemons the daemon's lease-lifecycle provider therefore saw no session-naming metadata and created BrowserStack sessions as "Untitled Project" / "Untitled Build" with an empty name. Read the four provider session-metadata flags through one shared projection (`readLeaseAllocateProviderMetadata`) used by both the client's `buildHttpRpcPayload` and the daemon's `toLeaseDaemonRequest`, so the transports agree and the producer and consumer cannot drop a sibling again. Closes #2494
Size Report
Startup median (7 runs, lower is better):
|
…n file The provider-scenario daemon-http-server test is over the 1000-line tripwire and may not grow; the lease_allocate metadata assertion now lives in daemon-http-lease-allocate.test.ts, mirroring the lease projection in http-server.ts.
|
The shared naming-field projection is correct, but the claimed fresh HTTP BrowserStack path is still incomplete at 7e36094. readLeaseAllocateProviderMetadata drops platform, device and providerOsVersion; toLeaseDaemonRequest reconstructs no other flags, and leaseLifecycleContext passes that bag directly to the provider. BrowserStack prepareSession requires those fields before creating the session, so a fresh remote allocation still fails before the names can take effect. Configured BrowserStack device-feature flags are also dropped by this projection. This omission predates the PR, but it is at the same allocation boundary and blocks the advertised fix. Carry the required provider configuration through the shared contract and extend the HTTP regression through the real lease/provider preparation path to assert the outgoing session capabilities. The current test substitutes handleRequest and only proves the intermediate flags bag. The iOS smoke failure is RUNNER_BUSY at the WebView wait and appears unrelated. |
|
Addressed in 176e8eb. The shared projection is now The reviewer's "carries the required provider configuration" and "assert the outgoing session capabilities" points are both in. New Proof it is a real guard, not a green-by-construction test: narrowing the projection back to the label trio makes that end-to-end test fail (the daemon returns not-ok because Wire digests re-pinned; ack rationale updated. |
… lease envelope The lease envelope named only the session-label fields, so a fresh remote allocation still failed in prepareSession before the names could take effect: device selection (platform, device), providerOsVersion, and the configured device-feature/AWS knobs were dropped on the HTTP transport, while the line transport forwards the whole request for free. readLeaseAllocateProviderMetadata becomes readLeaseAllocateProviderFlags and projects the full set the lease-lifecycle provider reads, pinned exhaustive against CloudProviderProfileFields so a new field cannot silently miss it. The producer and consumer already share this reader, so both transports agree. Covered end to end in cloud-webdriver-lease-http.test.ts: the exact client envelope is driven through a real daemon HTTP server into the real BrowserStack prepareSession, asserting the capabilities that reach the hub.
176e8eb to
d99226b
Compare
|
No remaining findings at d99226b. The shared projection carries the full allocation configuration, and the HTTP regression now reaches the real BrowserStack preparation path and checks the outgoing capabilities. Ready for human review; live BrowserStack acceptance was not tested, and the iOS WebView RUNNER_BUSY failure appears unrelated to this transport change. Revalidate iOS smoke before merge. |
|
…s are honoured (#2608) BrowserStack's hub classifies a create-session request as legacy JSON Wire as soon as any legacy top-level key (`device`, `os_version`, `app`) is present. In that mode it reads project/build/name from the legacy top-level keys, which agent-device never sets, and ignores `bstack:options` entirely — so every session still landed in "Untitled Project" / "Untitled Build" with an empty name after #2495 carried the `--provider-project` / `--provider-build` / `--provider-session-name` flags through to the provider (#2494). `buildBrowserStackCapabilities` now emits `appium:deviceName`, `appium:platformVersion` and `appium:app` instead, leaving `bstack:options` as the only vendor block. Verified against live App Automate sessions: the same `bstack:options` payload is ignored with the legacy keys present and honoured without them, independent of Appium version. Integration assertions updated to the W3C shape and extended to reject any legacy key at the top level. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
--provider-project,--provider-build, and--provider-session-namewere captured in the connection profile and reach the daemon on the line transport (which forwards the whole request), but the compact JSON-RPClease_allocateenvelope forwarded onlyproviderApp. Over an HTTP/remote daemon the daemon's lease-lifecycle provider received no session metadata, so BrowserStack sessions landed in "Untitled Project"/"Untitled Build" with an empty name. Project and build names are immutable after creation, so there is no post-hoc workaround.The envelope is a hand-written projection, so it also dropped the fields
prepareSessionneeds to create the session at all — device selection (platform,device),providerOsVersion, and the configured device-feature/AWS knobs — meaning a fresh remote allocation still failed before the names could take effect. Fix at the construction seam: one shared projection,readLeaseAllocateProviderFlags, now carries the full provider-allocation set that both the client's producer and the daemon's consumer read, so the two transports agree and a sibling cannot be dropped again (the drift #2110 left when it forwardedproviderAppalone). The key list is pinned exhaustive againstCloudProviderProfileFields. Additive on the wire: each field rides only when supplied; a request carrying none is byte-identical.Closes #2494
Validation
Tested at commit d99226b.
pnpm check:affected --rungreen (unit-core 3172 tests, provider scenarios,check:daemon-wire-compat: 2 changed, protocol unchanged — acked additive inledger.json).Regression coverage at each seam: a contract unit test for the shared projection, a producer test that the flags ride the
lease_allocatepayload, an HTTP reconstruct check (daemon-http-lease-allocate.test.ts), andcloud-webdriver-lease-http.test.ts, which drives the exact client envelope through a real daemon HTTP server into the real BrowserStackprepareSessionand asserts thePOST /wd/hub/sessioncapabilities (deviceName/os_version/app+bstack:options.{projectName,buildName,sessionName,…}). Narrowing the projection back to the label trio makes that end-to-end test fail, so it is a real guard.tsc(contracts + root),oxlint,oxfmt --check,check:layering, andcheck:production-exportspass. Not device-verified against live BrowserStack.