Skip to content

fix(mobile): reject a null device provider with INVALID_CONFIG, list the config and mobileTools errors - #1619

Merged
okwasniewski merged 7 commits into
e2e-inc:mainfrom
karolkulesza:docs/mobile-throws-config-tools
Nov 8, 2026
Merged

okwasniewski merged 7 commits into
e2e-inc:mainfrom
karolkulesza:docs/mobile-throws-config-tools

Conversation

@karolkulesza

@karolkulesza karolkulesza commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

What and why

  • The engine's Throws table had only the empty device list; a blank device name and a malformed device provider also fail with INVALID_CONFIG at config load.
  • mobileTools had no Throws entry: passing a non-mobile() engine fails the config load, and open_app and the other tools have failure modes the model sees.

Issue

Fixes #1629

Verified

Ran it locally: yes

  • Built CLI, e2e list with a blank device, a provider missing release, a provider without name, device: 42, and mobileTools(web()): each message and code matches its row.
  • pnpm check green; @e2e-dev/mobile tools, provider and engine unit tests pass (268).
  • Tool errors during a step not run with a model (no key); wording follows guardedTools in default-agent.ts and the unit tests in tools.test.ts.

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: title carries !, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).
  • Docs updated in the same PR: the docs/**/*.mdx page for the behavior, and skills/e2e/ if the skill describes it.
  • Contract change: emitted .d.ts reviewed, tests/types/sdk-types.ts updated; wire change edits the schema and both fixtures.
  • Engine contract change (e2e/engine): changesets for e2e, @e2e-dev/web, and @e2e-dev/mobile.

View guided diff

@github-actions github-actions Bot added the size:S Up to 29 changed lines, not counting tests, fixtures, translated docs, or the lockfile label Nov 7, 2026

@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

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

View guided diff | Re-trigger cubic

Comment thread docs/reference/mobile.mdx Resolved
Comment thread docs/reference/mobile.mdx Resolved

@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.

0 issues found across 4 files (changes from recent commits).

View guided diff | Re-trigger cubic

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Automated review (agent-run triage).

Every documented error checks out against main: blank/non-string list entries via namedDevice (pool.ts:83), device: 42 failing with "non-empty name", the provider acquire/release/record checks, mobileTools(web()) -> INVALID_STATE wrapped as CONFIG_LOAD_FAILED (config/load.ts:153), the Tool "<name>" failed: prefix (default-agent.ts:201), and the open_app codes (INVALID_STATE / INVALID_ARGUMENT / POLICY_DENIED). No invented codes. CI green.

Should fix

  1. The PR also changes code: provider.ts:151 gets device ?? {} plus a changeset. Retitle to fix(mobile): ... so the changelog and policy check read it right.
  2. asDeviceProvider(device: object) now handles null, so type the parameter unknown instead of ?? on a non-nullable type.

Nits

  • docs/reference/mobile.mdx:916: "No device attempt is running in the worker, or more than one is" leans on internals. Something like "called outside a test, or while several devices are open" reads better for users.
  • Row 1 "not a non-blank string" is a double negative. "A blank or non-string list entry".

@karolkulesza karolkulesza changed the title docs(mobile): list the device config and mobileTools errors the Throws tables omit fix(mobile): reject a null device provider with INVALID_CONFIG, list the config and mobileTools errors Nov 7, 2026
@karolkulesza

Copy link
Copy Markdown
Contributor Author

Thanks. Retitled to fix(mobile): ... since the PR touches provider.ts and carries a changeset. asDeviceProvider now takes unknown (3ec5e78). The open_app row and the double negative are reworded too.

@github-actions github-actions Bot added the needs:compliance Community PR fails CONTRIBUTING.md#pull-requests, closed after 72h if not fixed label Nov 7, 2026

@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 2 files (changes from recent commits).

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

View guided diff | Re-trigger cubic

Comment thread docs/reference/mobile.mdx Resolved

@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.

0 issues found across 1 file (changes from recent commits).

View guided diff | Re-trigger cubic

@karolkulesza

Copy link
Copy Markdown
Contributor Author

@okwasniewski the retitle, the unknown parameter and both wording nits are in (3ec5e78), so this is ready for another look. The one red check, screenshot-navigation.test.ts, is a web screenshot test that fails with "Execution context was destroyed". This PR doesn't touch that code, and I can't rerun it from a fork. The policy bot asks for an issue because the title is now fix. If you'd rather keep this as docs, say so and I'll move the provider.ts change out.

@okwasniewski

Copy link
Copy Markdown
Member

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-review of 2c781ae: all asks are done.

  • The title is fix(mobile), and asDeviceProvider(device: unknown) handles null.
  • The new device: null test at provider.test.ts:72 is a real guard. It fails with the null check reverted (42/43) and passes as is (43/43).
  • Every Throws row and error code matches source (pool.ts:83, tools.ts:30 and :66-75, links.ts assertAppId).

The pr-policy check only wants a linked issue for a fix, and that was caused by our retitle ask. I opened #1629 for it. Please add Fixes #1629 under ## Issue and the needs:compliance label goes away.

The red test (22.22.3) is the known web screenshot-navigation.test.ts flake, unrelated. Labeling this ready for human review.

This was an automated review.

@okwasniewski
okwasniewski dismissed their stale review November 7, 2026 22:12

Asks addressed in 3ec5e78/1e87c01ca (automated review)

@karolkulesza

Copy link
Copy Markdown
Contributor Author

Added Fixes #1629 under ## Issue. Branch updated with main; the red test (22.22.3) is the known screenshot-navigation flake, no code change in this round.

@github-actions github-actions Bot removed Ready for Human Review needs:compliance Community PR fails CONTRIBUTING.md#pull-requests, closed after 72h if not fixed labels Nov 8, 2026
@okwasniewski

Copy link
Copy Markdown
Member

[claude-opus-5-5] automated review on behalf of @okwasniewski

Re-check of a9963f2: Fixes #1629 is in the body, and the two commits since my last review are main merges with no PR changes. All checks are green, including test (22.22.3). Approving and merging. Thanks @karolkulesza!

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Automated review: approved, see comment.

@okwasniewski
okwasniewski added this pull request to the merge queue Nov 8, 2026
Merged via the queue into e2e-inc:main with commit a016b3e Nov 8, 2026
25 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready for Human Review size:S Up to 29 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mobile: a null device provider throws TypeError instead of INVALID_CONFIG

2 participants