Skip to content

refactor(limrun): own connection callbacks in the provider - #4730

Merged
thymikee merged 3 commits into
refactor/0.22-limrun-plugin-factoryfrom
refactor/0.22-limrun-connection-callbacks
Nov 19, 2026
Merged

thymikee merged 3 commits into
refactor/0.22-limrun-plugin-factoryfrom
refactor/0.22-limrun-connection-callbacks

Conversation

@thymikee

@thymikee thymikee commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Route connect limrun resolve and verify through the provider’s v2 callbacks. Load the verifier only when verification runs.
  • Keep the saved run ID for named sessions and forward capture options into the generated profile.
  • Cover named reconnect, callback validation, and account and attached-instance verification through SDK fixtures.

Part of #3311. Based on #4723 alongside #4728.

Validation

  • Head 5e0a406565fafee92181ade25bbc99251a0f2e21 on base 4b7e61602b331331b9ef6d01881ad1a52d55638a.
  • Exact clean pnpm check:affected --run --head 5e0a406565fafee92181ade25bbc99251a0f2e21 passed. Receipt run-iikswj records 42 checks passed and 25 skipped, including package, unit, provider integration, and production exports.
  • Independent review findings on saved run identity and verifier ownership are addressed. Live Limrun account verification remains pending.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

…wn v2 connection callbacks

Move the connect decisions into one provider-owned set of callbacks: the connect-flag
refusals (including --device), the per-platform credential narrowing, the connection
capabilities, and the verification read-only check now live in the provider package's
connection module, which the plugin declares lazily. The CLI composition drops its
hand-written Limrun adapter and runs the same callbacks through the plugin shape, wired
to the host the way the daemon's registry wires an installed plugin's, so both answers
come from the provider. The profile fields the host owns stay with the host: tenant,
session, run identity, state dir, and Metro settings.
The built-in `connect` composed its provider's callbacks through the provider package's root entry
just to inject that provider's own read-only check, which evaluated the runtime the composition was
meant to keep lazy, and let a caller replace a verification it does not own. The connection now
loads the provider's own verification in the `verify` path alone, so the built-in and an installed
plugin answer with the same entry and nothing above the connection decides what it verifies through;
the plugin option, the verifier type, and the root's verification export go with it. The suites read
the Limrun SDK boundary instead of the provider package, so they assert what the account or the
attached instance is asked for: the scoped credentials, the host's version, and the selected
platform, with no runtime set up on `connect`.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.10 MB 6.10 MB +724 B
Package (unpacked) 6.09 MB 6.10 MB +724 B
Package (download) 1.85 MB 1.85 MB +352 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.5 ms 24.7 ms -2.9 ms
CLI --help 51.3 ms 48.7 ms -2.6 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 5e0a406

No open findings.

2 findings below minor hidden (user_settings.min_severity).

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

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

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready: I found no problems in the code at 5e0a406. The Smoke Tests failure looks unrelated, because it fails in the Android Home/Recents pixel assertion (live-automation-scenario.ts:244) on a route that never calls connect limrun or the Limrun provider. Main fixed that race in #4716 (b566dca), and this head does not include it. The failed Smoke Tests job has been re-run; a rebase of the stack base onto main also works. No live connect limrun run has happened yet, so the lazy chunk chain through connection-verification.ts is checked from source only.

Not blocking, take or leave: limrunRunId in packages/provider-limrun/src/connection.ts:73 repeats the buildConnectClientId hash format, so it is encoded twice and pinned only by a test; and providerConnection in src/cli/connection/connect-provider-adapters.ts:91 could use LIMRUN_ID instead of the 'limrun' literal, with the unreachable untyped throw in builtinLimrunConnection dropped or typed. There are no conflicts.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 19, 2026
@thymikee
thymikee merged commit 254805f into refactor/0.22-limrun-plugin-factory Nov 19, 2026
15 of 16 checks passed
@thymikee
thymikee deleted the refactor/0.22-limrun-connection-callbacks branch November 19, 2026 09:00
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.

1 participant