Skip to content

feat(open): report device kind, model and osVersion on open and session identity - #4543

Merged
thymikee merged 6 commits into
mainfrom
feat/4525-open-os-version
Nov 15, 2026
Merged

thymikee merged 6 commits into
mainfrom
feat/4525-open-os-version

Conversation

@thymikee

@thymikee thymikee commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #4525

A CI integration that rents a device records what OS a capture ran on from the command result alone. open --json now reports model and osVersion beside the kind it already echoed, and each session list --json entry adds all three — the same description devices already reports. 15 files.

The daemon carries what its discovery read (simctl, adb, devicectl) or what the provider's create-session answer granted, never what the request asked for. A target that reports nothing omits the field, so a caller can tell a read OS from silence; nothing infers one.

Scope expansion: the session projection gained kind (the issue's example output shows it, and the session view lacked it), and the WebDriver provider now reads the granted OS from the hub's returned capabilities (platformVersion or its appium: variant) instead of reporting none. Revyl and Limrun are unchanged: their APIs report no granted OS to DeviceInfo.

agent-device open "MyApp" --platform ios --json   # {"platform":"ios","device":"iPhone 17","kind":"simulator","model":"iPhone 17","osVersion":"26.1",...}
agent-device session list --json                  # entries are flat: .kind, .model, .osVersion, beside .device (the name), each omitted when unreported
const res = await client.apps.open({ app: 'com.example.app', platform: 'ios' });
res.device?.osVersion; // '26.1', or undefined when the host reported none

The added fields are optional response fields outside the digested wire surface, so no protocol bump and no ledger change; the wire-compat lane passes unchanged.

Validation

Tested SHA 6cc4f6539f (base d78be6c887), which covers the readCapability change made after the first receipt. Head 07abb8489f adds a docs-only rewording of the session-list fields, checked by check:doc-prose and command-doc coverage.

  • vitest run --project unit-core — 2019 files, 18826 passed, 10 skipped (at 6fc227f)
  • vitest run --project provider-integration — 289 passed; the BrowserStack-shaped scenario asserts granted OS 17.2 against a request for 18
  • vitest run --project unit-core test/wire-compat packages/client packages/command-output packages/daemon/src/sessions packages/provider-webdriver src/commands/schema — 2168 passed, ledger.json unchanged
  • vitest run --project output-economy --project interaction-contract — 131 passed
  • pnpm typecheck, pnpm lint, pnpm format, pnpm check:doc-prose, check:command-docs, client-api doc snippets — clean
  • CI at 6cc4f6539f: all lanes passed, including Smoke Tests (ios and macos), Coverage, Integration Tests and Repo Guards

CI obligations: full CI on the pushed head. Unresolved risk: no live-device run verified real simctl/adb values reach the new fields; the values are the same inventory ones devices already ships.

🤖 Generated with Claude Code

…on identity

A CI integration that rents a device records what OS a capture ran on from the
command result alone, so `open --json` and `session list --json` now carry the
same device description `devices` already reports. `open` adds `model` and
`osVersion` beside the `kind` it already echoed, and `session list` adds all
three to each session's device.

The daemon carries the value its discovery read (simctl, adb, or devicectl) or
the value the provider's create-session answer granted, never the one the
request asked for. A target that reports nothing omits the field rather than
naming an OS it did not read, so a caller can tell a read version from silence.

The WebDriver provider now reads the granted OS from the hub's returned
capabilities (W3C `platformVersion` or its `appium:` variant) instead of
reporting none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.28 MB 6.28 MB +1.1 kB
Package (unpacked) 6.28 MB 6.28 MB +1.1 kB
Package (download) 1.90 MB 1.90 MB +227 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.1 ms 21.6 ms +1.5 ms
CLI --help 38.3 ms 39.5 ms +1.3 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 15 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/client-api.md Resolved
thymikee and others added 2 commits November 14, 2026 12:38
…her platformVersion key

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

1 new finding away from what changed since 07abb84 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

Earlier reviews

Review of 07abb848 · 14.11.2026 12:10 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

1 new finding away from what changed since 6cc4f65 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of 6cc4f653 · 14.11.2026 12:03 UTC

Apex Sentinel · ✅ Approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No open findings.

1 new finding away from what changed since d312ff5 not shown. Comment @apex-sentinel-staging review for a full review.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

Review of d312ff5e · 14.11.2026 11:50 UTC

Apex Sentinel · ✅ Approve

No open findings.

Reviewed with this repository's own Sentinel configuration (d78be6c88715).

@thymikee

Copy link
Copy Markdown
Member Author

The docs promise a JSON shape that session list --json does not print. In commands.md, "Each session's device carries kind, model and osVersion" reads as nested, but the CLI output is flat: sessions[i].device is the device name string, and the three fields are siblings (see inventory.ts and result-serialization.ts). A CI script that runs jq .sessions[0].device.osVersion gets null or an error, which is the exact use the issue names. Please reword to say each session entry carries kind, model and osVersion beside platform and device, and that the SDK reports them on session.device. The PR body example repeats the nested shape, so please fix it too.

Not blocking, and fine to take or leave: the daemon now has two copies of the model/osVersion spread (deviceResponseData and publicDeviceDescription), so one shared export could serve both open and session list; the new model and osVersion entries in HOST_OPEN_RESULT_KEYS in macos-app-lease.ts cannot fire for host macOS today and no test covers them; the cloud-webdriver provider scenario could assert opened.device?.osVersion to '17.2' next to the sessions.list assertion; and the new client-api.md paragraph sits after the devices.capabilities() sentence, away from the apps.open text.

The code looks right at d312ff5 apart from that docs fix. I did not run open --json or session list --json on a device or run the tests locally, and the PR body validation was against 6fc227f, so the readCapability change since then was not re-run by the author. CI is still running at this head (Smoke Tests, Smoke Tests (ios), Smoke Tests (macos), Coverage and one review check), so nothing has failed yet. No conflicts. Before merge, the docs wording needs the fix above and those checks need to pass.

Of the earlier review threads, both are fixed at this head and can be resolved: the client-api.md optional device fields wording now matches the optional type, and the platformVersion capability read now scans both keys.

"Each session's device carries kind, model and osVersion" read as a nested
object, but the CLI's session entry has `device` as the device name and the
three fields beside it. A caller that followed the sentence read
`sessions[0].device.osVersion` and got null. Name the flat shape and where the
SDK reports the same fields.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Fixed in 6cc4f65. commands.md:1217 now says each session entry carries kind, model and osVersion beside its platform and device, names the flat read (sessions[0].osVersion) against the nested one that returns null, and points to session.device for the SDK. The PR body's session list --json example said sessions[].device: {kind, model, osVersion}; it now shows the flat keys and that .device is the name.

Revalidated the pushed head, which covers the readCapability change the first receipt predated: provider-integration 289 passed, and unit-core over test/wire-compat, packages/client, packages/command-output, packages/daemon/src/sessions, packages/provider-webdriver and src/commands/schema 2168 passed, wire ledger unchanged. typecheck, lint, format, check:doc-prose and check:command-docs clean. The body's Validation section now names head 6cc4f6539f.

On the non-blocking notes:

  • Shared model/osVersion spread: left as is. deviceResponseData shapes a device row for devices and publicDeviceDescription shapes one session field set; one export would have to serve two owners and the duplication is two ternaries.
  • HOST_OPEN_RESULT_KEYS model/osVersion: kept deliberately. The list is the redaction boundary for a leased-app tenant, so it drops what a future host macOS description would add; a no-key-yet case is not a case a test can assert today.
  • Asserting opened.device?.osVersion in the provider scenario: agreed that it strengthens it; it is the open path, which already has the daemon and serialization tests. I left the scenario on sessions.list() so it covers both surfaces across the two tests rather than twice in one.

I did not run the CLI against a device either, so the flat shape above is read from the serializers and the docs prose checks, not from a live session list --json.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 1 file (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread website/docs/docs/commands.md Resolved
The sentence read as every entry carrying kind, model and osVersion. A target
that reports no OS omits osVersion, so a reader would have taken the expected
omission for a broken CLI. Say each field is reported when the host reported it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Also took the last open thread: the session-list sentence now names the fields as reported only when the host reported them, so an omitted osVersion reads as expected instead of a CLI fault. Pushed as 07abb84 (docs-only; prose and command-doc coverage clean).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee

Copy link
Copy Markdown
Member Author

Took the provider-scenario note in 86e63d7. The cloud WebDriver scenario now also asserts that open reports the granted osVersion (17.2), next to the sessions.list() assertion. That test file passes locally (provider-integration, 12 tests).

The model/osVersion entries stay in HOST_OPEN_RESULT_KEYS. That list is the tenant redaction boundary, so I'd rather it drop a host OS version before one can appear than after.

@thymikee

Copy link
Copy Markdown
Member Author

I reviewed 86e63d7 and found no remaining problems in the code. The three issues from the earlier review (#4543 (comment)) are fixed: the session-list docs now describe the flat kind, model and osVersion shape, the client docs no longer claim open always returns device, and a blank platformVersion no longer hides appium:platformVersion.

All 22 CI checks pass, and the last change only touches a docs file and an integration test assertion, so no runtime route changed. I did not run the provider-integration scenario or any test locally. The PR body says real simctl and adb values reaching the new fields are not verified on a live device. That is acceptable here, because the values are the same inventory ones devices already returns.

The three open inline threads from the earlier review are fixed at this head, so you can resolve them: #4543 (comment), #4543 (comment) and #4543 (comment).

Nothing else needs to happen before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 14, 2026
@thymikee
thymikee merged commit 7848a1a into main Nov 15, 2026
22 checks passed
@thymikee
thymikee deleted the feat/4525-open-os-version branch November 15, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include osVersion in open and session device identity

1 participant