Skip to content

refactor(limrun): ship Limrun as the @agent-device/limrun plugin - #4846

Open
thymikee wants to merge 26 commits into
0.22from
refactor/0.22-limrun-provider-plugin
Open

thymikee wants to merge 26 commits into
0.22from
refactor/0.22-limrun-provider-plugin

Conversation

@thymikee

@thymikee thymikee commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Limrun leaves the core package. The runtime, connection, iOS runner orchestration, download and @limrun/api move to @agent-device/limrun (packages/provider-limrun), installed through the plugin manager. Core adds lazy device capabilities to every provider setup host. Without the plugin, connect limrun answers plugin-not-installed with its install command. Part of #3311.

Auth is unchanged from the base: a login is saved when it is approved. A cloud-discovered Limrun refusal therefore keeps that login; #4940 tracks it. Preflight edge cases: #4914.

agent-device plugins add @agent-device/limrun@nightly-0.22
agent-device connect limrun --platform android

Value

metric base head
core installed size 6.20 MB 5.74 MB
core package download 1.89 MB 1.74 MB

Validation

Head eb28689b6a8bfb6f1ad371b5f59358c7f5b25e59. The affected gate passed all 43 runnable checks against origin/0.22 with exactCommit: true. The full unit suite passed 22,240 tests. The value figures were measured on an earlier head.

The packed CLI and Limrun plugin passed the created-iOS open, snapshot, and press rerun at this head. XCTest passed and the instance inventory was empty. Follow-up fixes and rerun. Prior created Android and token-only iOS evidence.

@thymikee

Copy link
Copy Markdown
Member Author

Live Limrun evidence at 50a016345a (the gated head; the pushed head 4c0e981abf is the same work rebased, context-only per git range-diff).

Setup: branch CLI (node bin/agent-device.mjs), isolated AGENT_DEVICE_HOME and --state-dir, plugin packed with pnpm pack and installed with agent-device plugins add <tarball>. LIMRUN_API_KEY came from the environment. iOS used a simulator runner built from this checkout with Xcode 27.1 (AGENT_DEVICE_LIMRUN_IOS_RUNNER_APP). Android used the snapshot helper built from this checkout.

Commands per platform: connect limrun --platform <p>, open, snapshot -i, press @ref, (back on iOS), fill @ref wifi, snapshot -i, plugins list --json, close, disconnect, daemon stop. The instance list afterward came from @limrun/api androidInstances.list and iosInstances.list.

head 50a016345a9fbad76a983a06b6ec0be37329b41a
cli 0.22.0-dev
plugin sha256 75dc028b489354764044a394269145589e589e7f161c780d48c3c7f3bd57706d
--- plugin absent
{"code":"UNSUPPORTED_OPERATION","reason":"plugin-not-installed","installCommand":"agent-device plugins add @agent-device/limrun@nightly-0.22"}
--- plugins add
{"name":"@agent-device/limrun","version":"0.22.0-dev"}
{"name":"@agent-device/limrun","version":"0.22.0-dev","provider":"limrun","compatible":true}
--- android
connect exit=0
{"leaseProvider":"limrun","leaseBackend":"android-instance","runId":"limrun-612ca9b316011df3","verification":"verified"}
open exit=0
{"id":"limrun:android:029edf2f2cef64ced7dc142d352af3b0","appBundleId":"com.android.settings"}
snapshot exit=0
{"nodes":33,"backend":"android-helper"}
press exit=0
"Tapped @e3 (360, 171)"
snapshot2 exit=0
fill exit=0
"Filled 4 chars"
snapshot3 exit=0
search field value=wifi
{"provider":"limrun","source":"store","package":"@agent-device/limrun","state":"active"}
close exit=0
{"session":"smoke-a","provider":{"limrunInstanceId":"android_euna_01m7x07n42fk9r7kcsv0yynvfb"},"message":"Closed: smoke-a"}
disconnect exit=0
{"connected":false,"session":"smoke-a","released":false}
Daemon stopped (graceful).
--- ios
connect exit=0
{"leaseProvider":"limrun","leaseBackend":"ios-instance","runId":"limrun-d64b0cbaff0f93bd","verification":"verified"}
open exit=0
{"id":"limrun:ios:739a4b68433f46bfa659a791e0234c70","appBundleId":"com.apple.Preferences"}
snapshot exit=0
{"nodes":18,"backends":{"simulator-ax-bridge":1}}
press exit=0
"Tapped @e7 (201, 319)"
back exit=0
snapshot2 exit=0
fill exit=0
"Filled 4 chars"
snapshot3 exit=0
search field value=wifi
{"provider":"limrun","source":"store","package":"@agent-device/limrun","state":"active"}
close exit=0
{"session":"smoke-i","provider":{"limrunInstanceId":"ios_euna_01m7x07xcyea0rdg0592s3dxyr"},"message":"Closed: smoke-i"}
disconnect exit=0
{"connected":false,"session":"smoke-i","released":false}
Daemon stopped (graceful).
--- instances not terminated after the run:
listed

Packed check on 4c0e981abf:

Packed @agent-device/limrun: TypeScript consumer passed.
Packed @agent-device/limrun: failure contract passed.
Packed @agent-device/limrun: isolated install, host-recognized errors, and CLI connect passed.

@github-actions

github-actions Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.07 MB 5.62 MB -455.5 kB
Package (unpacked) 6.07 MB 5.62 MB -455.5 kB
Package (download) 1.86 MB 1.71 MB -142.9 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.2 ms 20.7 ms -0.5 ms
CLI --help 41.9 ms 37.0 ms -4.9 ms

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Reply to the Sentinel finding "Ended Limrun lease stays stored when the command never primes the plugin store" (src/cli/connection/ended-lease.ts:32). No inline thread was posted for it, so this reply is here.

The finding is correct. Route: close and session are in REMOTE_MATERIALIZATION_DEFERRED_COMMANDS (src/cli.ts), so they skip materializeRemoteConnectionForCommand, the only place a device command loads the plugin store. The daemon reply to close names the released lease. forgetEndedConnectionLease then read connectionProviderCapabilities('limrun') from an unloaded store, got the remote-provider default, and kept the lease. The built-in answered that read synchronously, so this was a regression.

Fixed in 82fd39f:

  • connect and connection materialization, where the plugin is loaded, record the provider's declaration on the stored connection (forgetsEndedLease).
  • forgetEndedConnectionLease reads the recorded value. It loads no plugin, so the result is the same with the plugin installed, not loaded, or uninstalled. A connection stored without the value gains it on its next materializing command.
  • Tests: src/cli/connection/ended-lease-unprimed-store.test.ts runs close through the CLI with no plugin installed and a stored ended Limrun lease, and the lease is cleared (it fails without the fix). The same file runs disconnect with the plugin absent, and the stored connection is removed. The connect limrun and materialization tests assert the recorded value.

@apex-sentinel-staging review

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 82fd39f. The verdict and the full list are in the summary comment.

Comment thread src/cli/connection/ended-lease.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 1c803c8. The verdict and the full list are in the summary comment.

Comment thread src/cli/connection/ended-lease.ts Resolved
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed 997f851: a second independent pass found three problems to fix before merge, all where Limrun is now an optional plugin and stored state or the install hint is affected.

The first is in cloud-profile.ts. Run connect cloud with a valid token and no Limrun plugin. If the control plane returns a profile with leaseProvider set to limrun, the command saves the Limrun session and moves the active pointer while it checks only the cloud adapter. Without a daemon URL it leaves the generated profile behind and reports a daemon URL error. Should the provider chosen by the cloud response be checked, and primed, right after the fetch and before the profile is written? The cloud adapter's own check should stay for that route.

The second is in cli.ts. Take a named Limrun remote profile with an HTTP daemon URL that triggers cloud authentication, no current CLI session, and no plugin. Both connect --remote-config and ordinary device commands start authentication before the provider check. Non-interactive calls get an authorization error with no install command. An interactive connect can ask for login and write auth state before it reports the missing plugin. The existing provider admission must run before remote authentication on every known Limrun connect and materialization route. Cleanup commands stay outside that check.

The third is in connection-runtime.ts. Upgrade a state directory that has a named pending Limrun connection A and a newer providerless connection B, with no record named default, and install the plugin. On the 0.22 base, apps --session A leaves B active. At this head, recording forgetsEndedLease makes materialization write A and repoint .active-session.json to it. A later command without a session then refuses the leased fallback instead of using B. An in-memory comparison of the base and head materializers reproduced the pointer switch. A catalog read must not change the active connection. Record the policy only where an existing path already writes the connection, or update only the named record. Until then, use the catalog's policy for older Limrun records.

For a follow-up issue, not for this PR:

  • Provider names are not normalized in provider-policy.ts. A remote profile with leaseProvider set to limrun (with spaces) passes the profile parser unchanged. connect --remote-config then misses both the plugin and catalog lookups, treats the profile as generic, and commits it with no plugin. A later open can reach the daemon, which trims the name to limrun. Provider lookups for profiles and stored connections must use the same name normalization as the daemon, before any capability check. Old records must stay readable, and new state must be written with the canonical name.
  • The daemon-side hint is thin in lease.ts. The documented SDK leases.allocate call with leaseProvider set to limrun, against a daemon that has Limrun credentials but no plugin, fails with a restart hint that names no package or install command. The same happens for an embedded host started without the factory. CLI open can hit this guard when the plugin is in the CLI store but not in the running daemon. apps on a pending connection can say the instance is unallocated. The daemon's missing-runtime and catalog admission paths must use the managed provider catalog and, for an absent managed provider, give the package, the versioned install command, and the restart or embedded-host guidance. Errors for failed registrations and unallocated instances of registered providers should stay as they are.

Not blocking, and fine to take or leave: the stored forgetsEndedLease field in ended-lease.ts duplicates providerForgetsEndedConnectionLease, which already answers from the loaded declaration and then the catalog, so it could be dropped along with withEndedLeasePolicy and the extra state write; the Limrun plugin's setup in plugin.ts fails when LIMRUN_* is unset, so the claim shows as failed where the old built-in stayed dormant, which suits a follow-up issue; and the moved test in cloud-connect-profile-fields.test.ts no longer asserts that no state file exists after the refusal, which its name still says.

The two earlier inline threads on ended-lease policy are fixed at this head and can be resolved: #4846 (comment) and #4846 (comment).

CI is unclear. The failing jobs are the advisory mutation shards kernel-errors-3 and kernel-errors-4, which this PR triggers because it touches package manifests and the lockfile. The diff does not touch errors.ts, but it moves many tests that import AppError, so a failing or slow test in those shards could be related. No failure log was available. Please re-run those shards or say why they fail. Not verified here: whether the failure is a harness timeout or a test failure, any local test run, the emitted dist/agent-device.d.mts, or a live device run at 997f851 (the last transcript is from 50a0163, and the later changes touch CLI connection state only).

Required evidence is present. Before merge, the three fixes above are needed, and the mutation shards need a re-run or an explanation.

@thymikee

Copy link
Copy Markdown
Member Author

Mutation shards kernel-errors-3 and kernel-errors-4: cause

They are not test failures from this diff. Both shards died in the Stryker dry run, before any mutant ran, on one test:

ERROR DryRunExecutor One or more tests failed in the initial test run:
	ensureDaemon reports contention when the daemon keeps changing under it
		Test timed out in 5000ms.

That test is packages/daemon-client/src/__tests__/daemon-client-ensure-explicit-lifecycle.test.ts, which this PR does not touch. It waits out the real contention budget: daemon-client-ensure.ts sleeps 250 ms per attempt for the whole teardown grace. Measured: 1.3–2.4 s on main and 0.8–0.9 s on 0.22 on a developer Mac; 4.7–5.1 s on the 2-core CI runners (it also tripped the slow-test gate once on #4828); over 5 s under the mutation tool. The same failure repeated on three heads of this PR (1c803c8 once, 997f851 twice), so a re-run does not help. Affected decision-kernel mutants is red only because the sweep is incomplete (4 of 6 shard reports).

The fix is in progress as a separate change (inject the wait budget; no timeout raise), as one PR against main and the same patch against 0.22. When the 0.22 one merges, this branch is rebased onto it and the shards run again.

Follow-up notes from the review (provider-name normalization, daemon-side hint naming the package, plugin without credentials listed as failed) are filed as #4852.

@thymikee

Copy link
Copy Markdown
Member Author

Reply to the review of 997f851 (#4846 (comment)).

1. connect cloud saving a Limrun session without the plugin — fixed in cf9e4d4. resolveCloudConnectProfile admits the provider the control plane names right after the fetch and before the profile or any state is written. A missing plugin answers plugin-not-installed with the install command. The cloud adapter's own check is unchanged. Test: connect cloud refuses a Limrun profile from the control plane before anything is written (src/cli/connection/provider-admission.test.ts) compares every file under the state directory before and after, including .active-session.json, with a providerless connection active. The lost assertion in cloud-connect-profile-fields.test.ts is restored: no remote-connections directory exists after the refusal.

2. Provider admission after remote authentication — fixed in cf9e4d4. resolveRemoteContext admits the provider before resolveRemoteAuthForCli, for connect (the named provider, or the remote config profile's) and for commands that materialize a connection (the profile's, or the stored connection's). The deferred-materialization commands (close, session, disconnect, and the rest of that set) admit no provider. The check lives in src/cli/connection/provider-admission.ts and is loaded with a dynamic import only when a remote connection is in play, so src/cli.ts gains no static import. Tests in the same file: connect --remote-config with --no-login and without it, and apps on a stored Limrun connection, each with a daemon URL that triggers cloud auth. Each asserts the install command, that the auth seam was not called, and that no state was written. A disconnect test shows cleanup stays outside the check.

3. A catalog read changing the active connection — fixed in 5d14a0d with the simpler option. The stored forgetsEndedLease field, withEndedLeasePolicy and the extra state write are gone. forgetEndedConnectionLease asks providerForgetsEndedConnectionLease (loaded declaration, then the catalog) at the point of use. A record that still carries the field parses and the field is ignored; no migration. Test: materializing a named Limrun connection leaves the newer active connection active and writes nothing (src/__tests__/cli-config-limrun.test.ts). Kept: the catalog drift test and the unprimed close tests (unrecorded Limrun forgets, unknown provider keeps).

Known limit after dropping the field: a third-party plugin that declares forgetsEndedConnectionLease: true, is not in the catalog, and is not loaded on close keeps its stored lease. close loads no plugin store, so nothing answers for it. That is the behaviour at 4c0e981 too. I added no machinery for it.

Not changed, per the review: provider-name normalization, the daemon-side hint, and the plugin showing as failed without LIMRUN_*. The mutation shards are not changed either.

Checks on the new head: typecheck, lint, format, layering, fallow audit --base origin/0.22, production-exports, eager-closure budgets, 5,876 CLI and remote tests, 1,219 command, repo-guard and plugin-package tests, 20 Limrun provider scenarios. No local check:affected.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Correction to my note above on the mutation shards: the cause of the slow test is not the 250 ms sleeps (those were already mocked). The contention loop runs 300 iterations, and each one re-reads the daemon registration; reading a held lock takes one host ps process-table snapshot. That is about 700 ms locally and several seconds on a 2-core runner. The conclusion is unchanged: the failure is in a daemon-client test this PR does not touch.

The fix is up as #4856 (against 0.22) and #4855 (the same patch against main): the test replays one real lock inspection and asserts the full judge-again budget instead of spending it. The two tests go from 0.7–1.1 s to about 0.2 s locally. After #4856 merges, this branch is rebased and the shards run again.

@thymikee

Copy link
Copy Markdown
Member Author

Two problems remain at cf9e4d4, and both are about when the CLI admits the Limrun provider. The two earlier inline threads on the ended-lease policy are fixed at this head and can be resolved: #4846 (comment) (withEndedLeasePolicy no longer exists) and #4846 (comment) (upgraded connections forget ended leases through the catalog fallback, covered by the ended-lease-unprimed-store.test.ts close test).

A second independent pass found that interactive cloud discovery saves a CLI session before it refuses Limrun. Run connect cloud --session ci, or connect --session ci, with no token, no valid CLI login and no Limrun plugin, then approve the device login for an account whose profile names limrun. resolveCloudAccessForConnect calls loginWithDeviceAuth (auth-session.ts:185), which writes auth/cli-session.json (auth-session.ts:268). The profile is fetched and refused only afterward (cloud-profile.ts:31). The command prints the install hint, but it leaves new stored authentication state on a refused route. The rule: a newly approved login stays in memory until cloud profile discovery admits the selected provider. This must hold for every cloud discovery route, including when --daemon-base-url would otherwise start login in the generic auth step.

A second independent pass also found that an inherited profile can select a different connection during materialization (provider-admission.ts:37). Connect session ci in state directory B with a profile whose stateDir is B and leaseProvider is limrun. Change that profile's provider to cloud, then connect ci in directory A with --state-dir A, leaving the B record in place. After upgrade, run AGENT_DEVICE_STATE_DIR=A agent-device apps --session ci with no plugin and no token. Defaults come from the A record, but the profile's stateDir replaces the environment default during the merge (src/cli.ts lines 399-415 and 839-849). Admission checks cloud from A and the auth step returns UNAUTHORIZED. With auth available, materialization reads the Limrun record in B and refuses it only afterward (connection-runtime.ts:57-88). The rule: the provider and record that materialization will use are selected once, before authentication, from the effective state directory and session, and that selection is passed into materialization. The stored provider takes precedence over the profile fallback.

Not blocking, and fine to take or leave: admission derives the provider as remoteConfigLeaseProvider ?? connection.leaseProvider, while materialization derives it as existingState.leaseProvider ?? profile.leaseProvider, so one helper both call would remove the opposite precedence (they cannot diverge today because a changed profile fails remoteConfigHash validation first); and storedConnection() in ended-lease-unprimed-store.test.ts rewrites every record to add forgetsEndedLease:false, a field no released build wrote, so the loop can go and the test can be renamed to say that close forgets an ended Limrun lease through the catalog.

The code needs the two fixes above. CI shows one red check, the kernel-errors-4 mutation shard, which died in the Stryker dry run on ensureDaemon reports contention when the daemon keeps changing under it in packages/daemon-client. This PR touches nothing in that package or the kernel errors module, so the failure looks unrelated, and the fix is #4856 against 0.22. Not verified here: the shard failure log, because the attribution rests on the quoted dry-run error. Live device evidence is from 50a0163, and the changes since then touch only CLI admission ordering and connection-state writes, so no new device run is needed. Not verified here: local test runs, because this was a read-only review. After the two fixes, the next step before merge is for kernel-errors-4 to go green once #4856 lands in 0.22 and this branch is rebased.

@thymikee

Copy link
Copy Markdown
Member Author

Scope note for the review at cf9e4d4 (#4846 (comment)):

  • Point 1 (a newly approved login is written before the provider is admitted): in scope, being fixed in this PR at the auth-session owner.
  • Point 2 (select the materialization record and provider once, before authentication, from the effective state directory): not fixed in this PR. It needs two state directories and a profile edited between connects, and it changes how the CLI merges stateDir and orders materialization, which is wider than the Limrun extraction. Tracked as cli: select the remote connection record and provider once, before authentication #4858 for the maintainer to decide. This PR takes the related optional item: one provider-of-command helper for admission and materialization, with the stored provider first.

The author's per-point reply with SHAs follows after the push.

@thymikee

Copy link
Copy Markdown
Member Author

Reply to the review of cf9e4d4 (#4846 (comment)).

Point 1, a new login saved before Limrun is refused — fixed in 2240079. The fix is in the auth-session owner. A login that connect approves stays pending in memory: loginWithDeviceAuth takes deferSessionWrite, and commitPendingCliLogin stores it. resolveCloudConnectProfile commits right after it admits the provider the profile names. connect also commits after its provider profile resolves, which covers the route where --daemon-base-url starts login in the generic auth step. auth login stores at once, as before. Nothing is deleted afterward: a refused route never writes. Tests in src/cli/__tests__/auth-session-connect-admission.test.ts approve a device login, let the profile name limrun with no plugin, and assert plugin-not-installed with the install command and no auth/cli-session.json, for connect cloud, plain connect, and connect --daemon-base-url. A fourth test shows the admitted route writes the session once with the same contents. The three refusal tests fail without the deferral.

One consequence to know: a connect that fails before its provider is admitted for another reason, for example the profile fetch fails, also stores no login. The rule as written keeps the login in memory until admission.

Point 2, an inherited profile selecting a different connection during materialization — not fixed in this PR. 37b7e68 adds one helper, connectionLeaseProvider, that admission and materialization both call, with one precedence: the stored connection's provider, then the profile's. That removes the opposite precedence the review notes. The remaining part, selecting the materialization record and provider once from the effective state directory and session before authentication and passing that selection into materialization, is not done here. It is tracked in the follow-up issue the coordinator opens.

Optional items, taken in 37b7e68: the shared helper above, and ended-lease-unprimed-store.test.ts no longer rewrites records with forgetsEndedLease: false; the test is named close forgets an ended Limrun lease through the plugin catalog.

Checks on the new head: typecheck, lint, format, layering, fallow audit --base origin/0.22, production-exports, eager-closure budgets, 5,879 CLI and remote tests, 20 Limrun provider scenarios. No local check:affected.

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 37b7e68. The verdict and the full list are in the summary comment.

Comment thread src/cli/auth-session.ts Resolved
@thymikee
thymikee force-pushed the refactor/0.22-limrun-provider-plugin branch from 37b7e68 to 6d735ae Compare November 20, 2026 20:21
@thymikee

Copy link
Copy Markdown
Member Author

Update to my reply on the review of cf9e4d4 (#4846 (comment)). The branch is rebased onto 6d9beca29d, so the SHAs changed. Current head: 6d735ae.

Point 1, a new login saved before Limrun is refused — fixed. The final shape is in 6d735ae (it replaces the per-site commits of the earlier push). withCommandLogin in the auth-session owner wraps the login-bearing part of every command. A login approved inside it is stored when the command ends. Only the typed plugin-not-installed refusal discards it. So the earlier consequence is gone: a connect that fails after login for another reason, such as a failed profile fetch, keeps the login (Sentinel thread r4647199321, resolved). Tests cover connect cloud, plain connect, and connect --daemon-base-url on the refused route, plus the fetch-failure, generic-auth-failure and success routes.

One limit on test (c) as asked: no device command can approve a login, because only connect allows interactive login. The route tested is connect --remote-config, where the generic auth step logs in.

Point 2, an inherited profile selecting a different connection during materialization — not fixed in this PR. 9d55d0d adds one helper, connectionLeaseProvider, that admission and materialization both call: the stored connection's provider, then the profile's. That removes the opposite precedence. Selecting the materialization record and provider once from the effective state directory and session before authentication is not done here and is tracked in the follow-up issue the coordinator opens.

Optional items — both taken in the same commit: the shared helper, and the ended-lease-unprimed-store test no longer rewrites records; it is named close forgets an ended Limrun lease through the plugin catalog.

Checks on 6d735ae: typecheck, lint, format, layering, fallow audit --base origin/0.22, production-exports, eager-closure budgets, 5,881 CLI and remote tests, 20 Limrun provider scenarios. No local check:affected.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The earlier findings from cf9e4d4 are fixed at 6d735ae, and a second independent pass found three login-timing defects that remain. Login is no longer discarded on non-refusal failures (auth-session.ts:91-101), withEndedLeasePolicy is gone, and upgraded connections forget ended Limrun leases through the catalog.

A second independent pass found that cloud discovery can save a login that admission then refuses. Set the user config to valid JSON with "plugins": [] and leave Limrun uninstalled. The CLI flag reader ignores that key (cli-config.ts:139), but the plugin store requires an object there and records an unnamed store failure (store.ts:39, store.ts:229). Approve a login during connect cloud --session ci, plain connect --session ci, or connect --daemon-base-url https://bridge.agent-device.dev/api --tenant acme --session ci when discovery returns leaseProvider: "limrun". Admission refuses with plugin-unavailable (cloud-profile.ts:46, provider-policy.ts:93), yet the finalizer still writes auth/cli-session.json (auth-session.ts:100). A selected Limrun package whose entry fails to load reaches the same refusal and write. The rule: when the selected provider's admission fails with either typed plugin refusal, including plugin-unavailable, the pending login must be discarded. Keep the existing repair diagnostic when the store cannot be read.

The same pass found that admitted connect persists state and reports success before the login is saved. Create a writable private state directory with auth/cli-session.json as a directory, then approve login during connect cloud --session ci --json for an admitted profile. The head writes the generated profile and connection record, emits success: true (connection.ts:107, shared.ts:14), then fails the auth rename (atomic-publish.ts:44) and emits success: false on the same stream (cli.ts:684). Plain cloud discovery and the admitted generic-auth paths, including --daemon-base-url, --remote-config and proxy, share this ordering. Base 6d9beca saved during loginWithDeviceAuth (auth-session.ts:268), so a failed auth write stopped connect before it published anything. The rule: the pending login must be flushed at provider admission, before connection state is generated or published. For cloud discovery, flush right after the provider check. For a route whose provider is already admitted, save in the auth step. Keep the fallback write for unrelated discovery failures.

The same ordering problem affects explicit auth login. With auth/cli-session.json a directory inside an otherwise valid state root, approve auth login --json. The command-wide scope captures the login as pending (auth-session.ts:302, cli.ts:211). The handler emits success: true with authenticated: true (auth.ts:25, auth.ts:35), then the deferred write fails and a second error object follows. The rule: explicit auth login must stay outside the deferred scope, because only connect can approve a login before provider discovery.

The two open inline threads on provider-selection and ended-lease handling no longer apply and can be resolved: login is no longer discarded on non-refusal failures (#4846 (comment)), withEndedLeasePolicy no longer exists at head (#4846 (comment)), and upgraded connections forget ended leases through the catalog (#4846 (comment)).

CI shows 26 checks with none failing at 6d735ae. The earlier kernel-errors-4 dry-run failure was fixed upstream by #4856, which arrived with the rebase. There are no conflicts. This was a read-only review, so no local test run was done. Not verified here: that the new tests pass, which rests on green CI and the author's report. Live device evidence is from 50a0163, and the changes since then touch only CLI auth-state timing and the provider-precedence helper, so no new device run is needed. Merge needs the three fixes above, with a test for each failing route.

@thymikee

Copy link
Copy Markdown
Member Author

Reply to the round-three review at 6d735ae (#4846 (comment)). No push yet; this asks for the scope decision.

Classification. None of the three belongs in #4858 (that issue is the cross-state-directory record selection). All three are consequences of the deferred-login change this PR added in round two:

  1. plugin-unavailable also discards the pending login: same invariant as the plugin move (a refused provider writes no auth state). Part of this PR.
  2. Admitted connect publishes state and reports success before the login is saved: a regression against base 6d9beca, introduced by the deferral. Must not merge as is.
  3. auth login reports success before the write: the same regression. Must not merge as is.

Two ways to resolve, maintainer's choice:

  • A. Narrow the deferral (recommended). The pending login exists only between login approval and provider admission. At admission: admitted → write at once, so a failed write stops connect before anything is generated or published, as on base; refused with either typed plugin refusal (plugin-not-installed, plugin-unavailable) → discard, keeping the store repair diagnostic; a discovery failure before admission → fallback write. A route whose provider is already admitted writes in the auth step. auth login is never deferred. This replaces the command-wide finalizer and fixes all three with one mechanism, with a test per failing route.
  • B. Remove the deferral. Return to base behavior: the login is saved when it is approved, also when the provider is then refused. Points 2 and 3 disappear with the mechanism. "No auth state on a refused provider route" (round two, point 1) moves to an issue. This is the smaller PR.

I will implement the one you choose and not push before that.

@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/0.22-limrun-provider-plugin branch from 6dfaa01 to 5911afd Compare November 22, 2026 08:20
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 2 new findings on 5911afd. The verdict and the full list are in the summary comment.

Comment on lines +68 to +72
// Help and version answer from the command line alone and load no plugin.
if (parsed.flags.help || parsed.flags.version) return undefined;
const profilePath = parsed.flags.remoteConfig;
if (typeof profilePath === 'string') return providerOfProfileFile(profilePath, host);
return parsed.positionals[0];

@apex-sentinel-staging apex-sentinel-staging Bot Nov 22, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No longer raised on bdaa850: deferred to #4940 by thymikee in this comment.

🆕 🟡 Minor · Connect preflight admits only an explicitly typed profile path

A remote-config profile with leaseProvider set to "limrun" selected by default (repo .env/AGENT_DEVICE_REMOTE_CONFIG, or config-schema default) skips preflight admission, so connect limrun-style authenticates and registers the daemon token before failing at materialization. parsed.remoteConfigLeaseProvider is truthy exactly when flags.remoteConfig is set (src/cli.ts:382), and providerOfProfileFile is only consulted for that path, leaving the defaulted selection unadmitted. The credential-order guarantee in provider-admission-credential-order.test.ts only covers the argv case the test writes.

Suggested change

Resolve the profile path the same way the ordinary parse does (flag, env, schema default) inside connectProviderNamedInArguments before reading leaseProvider, so a profile selected by default is admitted before any credential is read.

Details

persona: maintainability, senior-developer

Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.

Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Valid, and not in this PR's scope. A profile selected by default (env or schema default) still ends with the typed plugin-not-installed diagnostic. The command only authenticates first. That credential is the user's own cloud login, and the refused route writes no profile or connection record. Admission ordering for logins is tracked in #4940. I added this case there so it is resolved with the same profile-path resolution.

@thymikee

Copy link
Copy Markdown
Member Author

The website card problem from the earlier review (#4846 (comment)) is fixed at 5911afd, and a second independent pass found four problems that remain. CI is green: 28 checks, none failing, and the earlier Coverage failure does not reproduce at this head. No conflicts.

A second independent pass found that the new Run anywhere command in website/src/site/content.ts:478 installs the wrong package for a 0.22 nightly reader. The plugin store resolves a bare package name to latest (store.ts:414), and the registry points latest at the runtime-free 0.0.0 placeholder. The nightly hints deliberately select a different release (plugin-installation.ts:5-37). Readers who copy the command get the placeholder, and the base website did not send them through this step. Can the card use the nightly selector from limrun.md:13, or point readers to the install command the CLI prints?

A second independent pass found that src/cli.ts:458 refuses authenticated remote Limrun sessions too early. A client with a saved named Limrun session, a valid daemon token and no local plugin now fails with plugin-not-installed on a materializing command such as snapshot, before it authenticates or dispatches. An explicit Limrun --remote-config with a valid token reaches the same refusal. At base, auth ran first (provider-policy.ts:47 treated Limrun as available), and the head pins the early refusal in provider-admission.test.ts:94-131. The rule: the local plugin is required for direct connect and local materialization only. For device commands against a configured remote daemon, auth and dispatch must proceed, the daemon provider registration decides runtime admission, and the Limrun connection metadata that remote materialization needs stays available. The provider-admission tests enumerate the sites. Validation: a run with a saved remote Limrun session and no local plugin must reach the daemon and return a snapshot.

A second independent pass found that connection-verification.ts:62 can echo the API key. If the account endpoint returns an unlabeled HTTP 500 body containing the key, the SDK error message contains it, and Android and iOS verification both attach that error as the cause. The iOS attached-instance route wraps the SDK error the same way at line 124. Core redacts by pattern (redaction.ts:20-89) and prints the cause in --json (cli.ts:655-673), and an unlabeled fixture credential survived the head normalizer. The wrappers come from base, but the credential invariant still fails at the plugin error boundary. The rule: no raw SDK cause leaves these wrappers. Return the typed verification error with a safe summary, status and hint, or remove the specific credential values first. Validation: a fixture endpoint that echoes the key must produce --json output without it.

A second independent pass found that download-file.ts:48 can echo the instance token. A direct instance that answers an authenticated download with an HTTP 500 body containing the bare token puts it in details.body on the recorder download (device-session.ts:183-189), iOS file copy (ios-files.ts:88-95) and the iOS Info.plist download (ios-files.ts:194-204). The iOS runner does the same under details.response for failed XCTest start text (ios-runner.ts:166-174). The daemon publishes normalized details (request-router.ts:759-774), and the head normalizer kept the bare token in both fields. These paths predate the move but fail the same invariant. The rule: error details from these routes carry the status and typed reason, and never raw response text unless the instance token is removed first. Validation: a fixture instance that returns a 500 with the token in the body must yield daemon error details without it.

Not verified here: the Coverage failure log from 93de794, the provider-limrun dist build, and the website build. The open inline thread on remote-config login ordering (#4846 (comment)) still applies and stays deferred to #4940. The thread on the public declaration (#4846 (comment)) does not apply, because the only published entry exports just the default limrun() plugin, so it can be resolved. After these fixes, maintainer approval is next.

The Run anywhere card printed the bare package name, which the plugin store
resolves to latest: the runtime-free placeholder. Use the nightly selector the
docs and the CLI hints use, and point readers at the printed command.
A saved or explicit Limrun connection whose daemon is configured elsewhere was
refused with plugin-not-installed before it authenticated or dispatched, which
no base release did. The plugin is needed where the device is driven: keep the
refusal for a direct connect and for a connection with no configured daemon, and
let the daemon's own provider registration decide runtime admission otherwise.
The connection's metadata is still read and saved either way.
The Limrun SDK echoes a request body in its error message, so an endpoint that
answers a verification with an unlabeled body naming the API key put that key in
the cause the CLI prints, which pattern redaction cannot see. Answer with the
typed verification error, its status and hint, and carry no cause.
An instance that answers an authenticated download or an XCTest start with an
unlabeled body naming the bearer token it was given put that token in the error
details the daemon publishes. Remove each value sent to the endpoint from the
response text before publishing it; the status and typed reason answer for the
failure.
@thymikee

Copy link
Copy Markdown
Member Author

Four fixes for the second independent pass, at head bdaa850e69.

1. The Run anywhere card installed the placeholder — fixed in content.ts:478. The card now prints agent-device plugins add @agent-device/limrun@nightly-0.22, the selector limrun.md:13 uses and what pluginPackageSelector yields for this 0.22.0-dev core. The body says the plugin is the one "for your release" and points at the command the CLI prints, since a reader on a stamped nightly needs that release rather than the branch tag.

2. Authenticated remote Limrun sessions are no longer refused early — the rule is in provider-policy.ts:120 as connectionNeedsLocalProviderRuntime: the plugin is needed where the device is driven, so a configured daemon base URL (flag, env, profile, or saved connection) means this host dispatches and the daemon's own provider registration decides runtime admission. The gate at provider-admission.ts:43, the materialization at connection-runtime.ts:95 and connection status at connection.ts:416 read it. On the remote path the plugin store is still primed, without refusing (provider-policy.ts:72), so a connection whose plugin is installed keeps the capabilities it declares, and the Limrun lease metadata is still read and saved. Direct connect limrun, a --remote-config connect, and any connection with no configured daemon keep refusing before auth: that runtime only the plugin can supply. Tests: stored session, no local plugin, reaches the daemon and returns a snapshot, explicit remote config likewise, and the inverted negative still asserts plugin-not-installed with zero daemon calls and no auth. The earlier pinned refusal is gone rather than doubled. Docs and help state where a plugin is needed: plugins.md, cli-help.ts:491.

3. No raw SDK cause leaves the verification wrappers — connection-verification.ts:62 and :122 no longer pass a fourth argument, so the printed cause is empty; the error keeps its typed code, the status when the SDK reported one, and its hint. The new case fails verification against an endpoint whose 500 body names the key and asserts cause === undefined and an exact details object; the attached-instance case asserts it too.

4. No raw instance response text in error details — one owner, error-text.ts, removes every value this process sent to the endpoint from the text before it is published; core still bounds and pattern-redacts it as it does any detail. Applied to the download body at download-file.ts:49, which covers the recorder download, the iOS file copy and the Info.plist read, and to the XCTest launch text at ios-runner.ts:179. statusCode and status survive, so readLimrunAppInfo's 404 branch is unchanged. Tests: a fixture instance answering 500 with the bare token (download-file.test.ts:106) and error-text.test.ts for a body echoed whole, partially, or not at all.

Validation at bdaa850e69: pnpm build, typecheck, lint, format, check:layering pass. Focused vitest: src/cli, src/commands, src/__tests__/cli-leased-session and all of packages/provider-limrun, 1727 tests across 188 files. pnpm check:affected --run is queued behind another worktree's validation lock; I will post its receipt here when it clears.

Out of scope here and unchanged: the remote-config login ordering thread stays with #4940, and the public-declaration thread is resolved as not applicable.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Validation receipt, as promised: check:affected --run --base origin/0.22 --head HEAD at bdaa850e69 passed — 43 checks passed, 29 skipped as GitHub-authoritative, exactCommit: true. fallow, build, unit and vitest-related are among the passes.

One note for anyone rerunning locally: the first run used the runner's default --base origin/main, and this branch targets 0.22, so fallow audited 1136 files and reported inherited findings in files this PR never touches. With the PR's real base it audits 126 files and reports none.

@thymikee

Copy link
Copy Markdown
Member Author

This follow-up to the earlier review covers bdaa850. A remote-daemon Limrun connection can now proceed without the local plugin, which fixes the earlier refusal. The code still has one regression and several credential-leak paths, so it needs changes. CI is green (27 checks, none failing), and the author reports check:affected passing against origin/0.22. Before merge, the remote no-plugin route must keep Limrun's declared lease capabilities.

A remote Limrun connection without the local plugin now gets the generic remote capabilities instead of Limrun's declared ones (provider-policy.ts:191). Base always supplied Limrun's capabilities. Now apps allocates a lease instead of using deferred app selection (connection-lease-policy.ts:51-60). lease_allocate and heartbeat lose the idle TTL that bounds a held cloud device (:22-31). open <app> no longer sends initialApp (connection-lease-transaction.ts:128-134). The earlier review asked that the Limrun connection metadata needed for remote materialization stay available. The new tests only check the order [lease_allocate, snapshot], so they pass with the wrong policy. The rule: a connection's lease policy comes from its provider's declared capabilities on every route, whether or not this host loads the plugin. The plugin catalog already carries one declared field (forgetsEndedConnectionLease). It should carry the declared ConnectionProviderCapabilities, checked against LIMRUN_CONNECTION_CAPABILITIES by the existing provider-plugin check, and declaredConnectionCapabilities should fall back to it before remoteDaemonConnection. Please add a remote no-plugin test that asserts lease_allocate carries the TTL and initialApp for open <app>.

A second independent pass found the same gap from the user side (connection-runtime.ts:98). With a saved Limrun session or explicit profile that targets a loopback HTTP daemon, and an empty client plugin store, authentication and dispatch succeed but the capabilities are generic. A fresh apps allocates an instance instead of listing uploaded assets. A fresh open <uploaded-asset-name> omits the initial asset, so Limrun neither preinstalls it nor resolves the name to an installed app ID. The prior five-minute TTL is gone, which leaves the stock daemon's 60-second default. Remote connection status loses the Limrun preparation instructions that the help promises at cli-help.ts:497-499. The same catalog declaration fixes this. Resolve and verify stay in the plugin.

A second independent pass found that connection status --session <name> refuses a saved direct Limrun record before the plugin is installed (connection.ts:416). Base showed the record because Limrun was built in, and the handler reads the record locally without a daemon request. Connection status should use the non-refusing capability lookup whatever daemon URL the record holds.

A second independent pass found that core still routes on the Limrun provider name for a known missing or broken plugin (provider-policy.ts:109, cloud-profile.ts:78-83). The #3311 boundary removes Limrun-specific branches from provider-policy.ts and allows declarative catalog metadata in core. The admission policy should be declared in the catalog and read through a provider-neutral lookup, keeping the existing admission order for every provider.

A second independent pass found that SDK debug logging can print keys and tokens (connection-verification.ts:41). With LIMRUN_LOG=debug, the locked @limrun/api 0.69.1 logs a plain-text error body before throwing, so omitting the cause cannot prevent a leak of a bare API key. The runtime client has the same gap (runtime.ts:187-192), and even a successful instance create or lookup can log a body containing status.token. The plugin should set logLevel to off on every organization client it builds, or supply a logger that emits only safe fields.

A second independent pass found that short and clipped tokens survive sanitizing (error-text.ts:36). The credential reader accepts any nonempty attached-instance token, but the sanitizer ignores candidates shorter than eight characters. A six-character token in an HTTP 500 body reaches details.body on recording downloads, iOS file copy and Info.plist reads, and details.response on XCTest launch. A token echoed across the 500-byte preview boundary in download-file.ts:49-70 leaves its prefix in the details. Exact-head in-memory checks confirmed both values survive core normalization. These paths should publish typed reasons and HTTP statuses without peer body text, and keep statusCode for the Info.plist 404.

A second independent pass found that a malformed recording download URL exposes the token (download-file.ts:104). An attached instance returns its bare bearer token as the download URL, fetch rejects it, and the plugin publishes the value in both details.url and the fetch message in details.cause. The body sanitizer never runs, and an in-memory check confirmed both strings survive core redaction. Use the typed download failure reason with a safe transport summary, and keep raw URLs and fetch error text out of public details.

A second independent pass found that the iOS runner paths can publish the instance token (ios-runner.ts:50). The runner forwards the Limrun Authorization header to the command route. A forwarding service that answers 401 with the bare token puts it in details.text. A 200 stream that prints the token in a startup failure line is forwarded raw and written to runner.log (ios-runner.ts:227-245). An authenticated /sync reply can echo it in a needFull entry that reaches details.needFull. The forwarded credential should reach the runner's response and log redaction boundary, including credentials split across chunks, error text should be sanitized before publication, and unsanitized sync fields should stay out of the upload error.

A second independent pass found that runtime API errors can expose the account key (runtime.ts:432). The SDK builds its error message from the response body, and lease creation rethrows it to the daemon, which records and returns it. Asset-list errors on apps, list errors on recovery, non-404 get errors on app-log reconnect, and failed deletes carry the same text. The heartbeat lookup also copies a peer-supplied terminationReason into the error message and details even when the lookup succeeds. Errors from the organization client should be normalized in the plugin before runtime callers log or return them, keeping the typed statuses callers use (including the delete and reconnect 404 handling), and the termination reason should be scrubbed before it enters an AppError.

A second independent pass found that instance SDK clients can log or return raw WebSocket replies (ios.ts:65). The runtime and app-log reconnect clients enable SDK warning and error logs, and the locked SDK writes failed frames and parse errors to the console, so a bare token sent as a text frame is visible. iOS listApps and pressKey failures, and Android remote asset install failures, return the peer's message in a raw Error. Raw SDK logging should be disabled on these clients, as attached verification already does, and instance credentials should be scrubbed from SDK errors before plugin operations return them.

Not blocking: connectionNeedsLocalProviderRuntime tests (daemonBaseUrl ?? env.AGENT_DEVICE_DAEMON_BASE_URL) === undefined (provider-policy.ts:124), but the daemon client decides by truthiness, so an empty AGENT_DEVICE_DAEMON_BASE_URL skips the refusal and then drives a local daemon without the plugin. Reusing resolveRemoteDaemonBaseUrl would make both sites agree, and this can be taken or left.

Could the predicate, the WithoutRefusal variant and the three duplicated if/else sites collapse into one provider-policy entry, admitProviderForRoute(provider, daemonBaseUrl, env)? It would prime the store, refuse only when the host drives the connection (using the daemon client's base-URL rule), and answer capabilities from the plugin when loaded, else from the catalog declaration. Admission, materialization and status would call that one entry, and the lease policy would stay the provider's on every route. The catalog entry would need to carry the declared ConnectionProviderCapabilities first, with a check that keeps it equal to the plugin's declaration.

No open inline thread of high priority still applies, and no lower-priority thread still applies. The remote-config login ordering thread does not apply, because that work moved to #4940 and was ruled out of scope here. The tsdown.config.ts thread does not apply, because the only published entry exports the default limrun() plugin and the published types do not expose the internal plugin-API import.

Not verified here: tests and the website and provider-limrun dist builds were not run, and the green CI and the author's check:affected receipt are taken as reported. The effect on a real remote daemon, meaning whether it applies its own idle TTL or uses initialApp for Limrun, was not observed live, so the lease difference is read from the code. It was also not confirmed by execution that effectiveFlags.daemonBaseUrl carries the stored connection's daemon.baseUrl when the profile lacks daemonBaseUrl, and the stored-session test's profile does set it.

A remote Limrun connection whose host has no plugin was answered from generic remote
capabilities, so `apps` allocated a lease, `lease_allocate` sent the daemon's default TTL,
and `open <app>` dropped the initial app. The plugin catalog now carries the provider's whole
declared `ConnectionProviderCapabilities` and its admission policy, and `declaredConnectionCapabilities`
falls back to that copy before the daemon's own routing, so a connection's lease policy is its
provider's whether or not this host loads the plugin.

The predicate, its without-refusal variant and the three duplicated if/else sites collapse into
`admitProviderForRoute(provider, route, env)`, which primes the store, refuses only where this host
must supply the provider, and answers capabilities from the plugin when loaded, else from the
catalog. `providerRouteForConnection` reads the same two settings the daemon client reads.
@apex-sentinel-staging

This comment has been minimized.

@thymikee
thymikee force-pushed the refactor/0.22-limrun-provider-plugin branch from 1794c68 to 4926549 Compare November 22, 2026 14:10
@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging apex-sentinel-staging Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Apex Sentinel: 1 new finding on 4926549. The verdict and the full list are in the summary comment.

The SDK, an attached instance and a forwarding service in front of one all answer with their own
text, and this plugin authenticates each of them with an account key or an instance token. An
unlabelled echo of a bare credential survives core's pattern redaction, so each path that published
peer text is closed at its owner:

- Every client this plugin builds logs nothing: `off` on the organization client and `none` on an
  instance client, which outranks `LIMRUN_LOG`, so the SDK cannot write a failed response body that
  carries an account key or an instance token.
- The scrubber drops a credential however brief — the reader of an attached instance accepts any
  nonempty token — and takes the credential out of both a header value and its bare credential.
- A download publishes its typed reason, its status and a transport code: no URL, no peer body, and
  no fetch message, since an attached instance answers with its token as the download URL.
- An account-API failure is re-raised as an `AppError` carrying status and reason before a create,
  an asset list, a recovery list, a reconnect lookup or a delete records or returns it, keeping the
  404 answer a caller acts on. A termination reason is bounded to one line and scrubbed.
- The runner's forwarded credential reaches its response, its cause and its log redaction boundary,
  including a credential split across stream chunks, and a `/sync` field this upload did not name
  stays out of the upload failure.
- An instance client's own failures are answered through one wrapper, so `listApps`, `pressKey` and
  a remote install cannot return the peer's frame with the session token in it. Only a failure that
  names a sent value is re-raised, so a clean SDK failure keeps the reason and cause the command
  that caught it publishes.
@thymikee
thymikee force-pushed the refactor/0.22-limrun-provider-plugin branch from 4926549 to 99e1e82 Compare November 22, 2026 14:37
@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

The code at 99e1e82 still has open issues, and the Limrun device paths it changed have no live run. CI is green (28 checks, none failing), and the R89 failure at 1794c68 is resolved by the ReasonTable at ios-runner-errors.ts:15. Of the earlier findings (#4846 (comment)), the termination reason slicing is fixed; the items below remain or are new. No conflicts.

The delta puts every Limrun device command behind new code, and the last live run is at 50a016345a. Every instance client method goes through a Proxy (instance-error-scrubbing.ts:25, installed at ios.ts:69, android.ts:82 and app-log-reconnect.ts:102/162). The XCTest output stream goes through a holding scrubber (ios-runner.ts:233-245), sync needFull is filtered (ios-runner-products.ts:208-217), and lease allocation is wrapped (runtime.ts:562). The PR body's "later commits change only CLI admission" no longer holds, so open, snapshot, press, apps, logs and runner startup ship without a live run of the code they now execute. Please post a live run at 99e1e82 or later with the packed @agent-device/limrun plugin and node bin/agent-device.mjs. On one created iOS and one created Android instance, run open <uploaded asset>, snapshot -i --json, one press, apps --json and close. On iOS, show that runner.log was written and the XCTest runner started. Add one attached (token-only) iOS open and snapshot. Post the commands, platform, head SHA and exit codes. This is required before merge.

A second independent pass found that an authenticated organization request can get a 2xx application/json reply whose body echoes the account key as invalid JSON. The locked @limrun/api 0.69.1 parser throws a SyntaxError without a status, and client-options.ts:141 forwards it with a message that quotes the key or its prefix. It reaches lease allocation, app listing and asset lookup, app-log recovery, release recovery and the delete failure record (runtime.ts:562, app-catalog.ts:29/48, app-log-reconnect.ts:41, lease-release.ts:409, client-options.ts:70). An in-memory check with a synthetic key reproduced the echo. The rule: no organization-API failure leaves the plugin with SDK text. Normalize statusless, non-abort failures at the organization SDK request boundary to a static typed AppError with no cause. Keep numeric HTTP statuses and the delete and reconnect 404 behavior, and leave local and instance errors intact.

A second independent pass found that the iOS SDK asks for deviceInfo before createInstanceClient resolves (ios.ts:70). If the instance refuses that command with the bare token in its error text, the constructor rejects before withInstanceCredentialScrubbing is installed. This reaches created and attached allocation (runtime.ts:435, :544, :562) and app-log reconnection (app-log-reconnect.ts:41, :59, :103). The rule: every call on an instance channel, construction included, answers through the scrubber. Use one shared iOS instance-client constructor that scrubs constructor rejections with the supplied token before returning the wrapped client.

A second independent pass found that when an organization GET reports a created instance as terminated, it can echo the instance token in terminationReason (runtime.ts:984). The scrubber receives only limrun.apiKey, so heartbeat copies the token, or its prefix past the limit, into the message and details at runtime.ts:788-791. Both session types already hold the token (ios.ts:38, android.ts:44). Pass the live session token and the account key to safeTerminationReason before the message and details are built.

A second independent pass found that during iOS runner preparation, a 2xx /sync reply echoing the bare instance token as invalid JSON throws a SyntaxError quoting the reply (ios-runner-products.ts:276). It reaches the caller or prewarm logging at ios-application-tools.ts:54-57. The same reply on GET /files/list (clearing app data) or the file-staging PUT (push notification) escapes at ios-files.ts:101 and :147, and ios-runner-errors.ts:57 forwards non-AppError failures unchanged. Handle JSON decoding failures at the sync and file response readers. Return a typed error with a static message and the HTTP status, without keeping the decoder error as a cause.

A second independent pass found that a forwarded iOS runner command can return an unsuccessful envelope whose error.message echoes the instance token (ios-runner.ts:37). runner-contract.ts:663 uses that text as the error message, and capture-kit/src/snapshot-router/router.ts:343 and :775-782 can log it during snapshot fallback before the caller sees a scrubbed error. A successful reply with gestureFallback and the token in gestureFallbackMessage can log it at apple-runner/src/runner-exchange.ts:525-540. Direct bindRunnerOperations at ios-runner.ts:310 also bypasses the outer wrapper. The rule: the forwarded credential is removed where the Limrun runner response enters the process. Scrub peer diagnostic text at that boundary, before shared runner code builds errors or emits diagnostics, and keep the status and structured recovery fields.

A second independent pass found that an authenticated runner reply can fail with a payload holding an object keyed by the bare instance token (instance-error-scrubbing.ts:125). buildRunnerResponseError keeps it as details.runner (runner-contract.ts:663-664). The plugin scrubs property values but keeps names, and kernel/src/redaction.ts:69-70 does the same, so the key reaches the JSON CLI error. An in-memory check at this head confirmed it. Omit peer diagnostic properties whose names contain a known credential, or project the runner failure onto the typed fields recovery needs.

A second independent pass found that with app logging enabled, the iOS endpoint can echo its bare token in streamAppLog, a matching streamSyslog line, or retained appLogTail history (ios-app-logs.ts:44). Lines 44-55, 75-76 and 106-110 append the text as received, and capture-kit/src/provider-app-log-poller.ts:88-89 writes it to the log. The current reader (runtime.ts:849) and the recovered reader (app-log-reconnect.ts:110) share the path. Scrub known instance credentials in the reader's common append path so live, buffered and retained lines all pass through it.

A second independent pass found that when the first /sync response has a nonempty needFull list with only a stale path, the head filters the path out before the retry decision (ios-runner-products.ts:215). On the base (dcbf9d8, src/core/interactors/limrun-ios-runner-products.ts:211-212) any nonempty needFull retried with all files. At the head, ok:false fails at once and ok:true accepts the incremental upload without the retry Limrun asked for. Decide retry and success on the original needFull presence, and filter or scrub names only when building public error details.

A second independent pass found that error-text.ts:38 changes a credential before matching it. The environment reader (credentials.ts:103-119) accepts an instance token with two interior spaces. The scrubber keeps the full Bearer header but collapses those spaces when it extracts the bare token. A peer echoing the original bare value in an iOS runner refusal (ios-runner.ts:180-182) or the startup stream (:235-244) then leaks it. The head helper reproduced the unmatched value in memory. Pass the original bare token as a separate candidate, or split the header only at the scheme separator and keep the exact suffix. Scrub a termination reason before collapsing its whitespace.

Could the plugin side be simpler? The core side is sound. Instead of seven per-call fromLimrunOrgApi wrappers, a post-construction Proxy, an outer runner error wrapper and separate field filters, scrub where credentials enter peer channels. First, build the organization client once with a fetch or response hook, or one wrapped client, that turns every failure into a typed status-only AppError, so no call can skip it and statusless failures are covered. Second, use one instance-channel factory that builds, connects and wraps the instance client, plus one runner HTTP response hook in the endpoint the plugin configures, so shared runner code only sees scrubbed text. Peer text then needs no per-field filtering. Nothing has to change first for the organization client and the instance factory. The runner hook needs the apple runner endpoint to accept a response transformer, or the plugin's own fetch, if it does not already.

For a follow-up issue, not for this PR: the same three rules apply as general invariants. client-options.ts:141 should map any statusless organization failure to a typed error. ios.ts:70 and its twins at android.ts:83 and app-log-reconnect.ts:102/162 should share one owner that builds and wraps the instance client. ios-runner.ts:37 should scrub at the runner response boundary, and at minimum wrap bindRunnerOperations in withTools like the other bound surfaces.

Not blocking, and these can be taken or left: the needFull filter at ios-runner-products.ts:215 can follow the base and decide on the unfiltered value; the response.json() decoding at ios-runner-products.ts:276 and ios-files.ts:101/147 behaves the same on the merge base, so a typed static-message failure with only the status fits a follow-up issue; scrubbing object keys in instance-error-scrubbing.ts:125 and passing streamAppLog/streamSyslog lines through createInstanceStreamScrubber in ios-app-logs.ts:44 also fit follow-ups; and in src/cli/connection/provider-policy.ts:70, primeProviderConnection repeats admitProviderForRoute(provider, 'drives-connection') line for line, so it can call it with env or its callers can be replaced.

Of the open inline threads, none still applies. The default-selected profile admission ordering thread is deferred to #4940, which is out of scope here, and the delta leaves that order unchanged: #4846 (comment). The termination reason thread is fixed at 99e1e82, which scrubs the whole one-line reason before slice(0, 200) and drops a trailing partial marker: #4846 (comment).

Not verified here: @limrun/api 0.69.1 is not installed locally (only 0.49.3), so the SDK's construction-time rejection text, its statusless parse errors, and whether LIMRUN_LOG can override an explicit log level were not read from the locked SDK. Tests, typecheck and builds were not run, and green CI and the author's check:affected receipt are taken as reported. The shared runner sites that read error.message before the plugin wrapper were taken from the earlier 1794c68 pass, not re-traced at this head. The credential-echo findings need the Limrun service, instance or forwarding route to return a credential as text, and that peer behavior was not observed. Whether a real remote daemon honors leaseTtlMs and providerApp for Limrun was not observed live.

@thymikee

Copy link
Copy Markdown
Member Author

Part A · review fixes

The regression batch failed 10 tests before the fixes. The final focused run passed 372 tests, and the two focused Apple runner suites passed 43 tests. At 972b0360b18d384ddceff83ea18532a3231793dd, pnpm check:affected --run --base origin/0.22 --head HEAD passed all 43 runnable checks with exactCommit: true (receipt run-cz5JDo). The full unit suite passed 22,232 tests and skipped 8.

Part B · packed Limrun runs

Head 972b0360b18d384ddceff83ea18532a3231793dd. Both tarballs were installed in a clean consumer. The packed CLI loaded Limrun from the managed store after plugins add <limrun tarball> --json returned 0. The managed plugin resolved @limrun/api@0.69.4. The branch requires Xcode 27 for the Limrun runner, so the simulator runner was built with Xcode 27.1 and the packager accepted the tag v0.0.0-dev.

Package Version SHA-256
agent-device 0.22.0-dev b8f55704b042c33732cb59303c6e49cd14e8d1a2d14c1b7a692aeaec27b43993
@agent-device/limrun 0.22.0-dev fcd6a3689ca70f9defe59aebc372ece60fd97b407d8cde5708bcb37077723337
Simulator runner archive 0.0.0-dev d036f6d67d00f2f84c2e0a6cbc8b5c687ca0b64ee29eda6ffedb72207616be63

Each CLI command below used node node_modules/agent-device/bin/agent-device.mjs with an isolated state directory and session. The attachment used only the simulator URL and token.

Created iOS

Command Exit Result
connect limrun --platform ios --session review4846-created-ios-mws0sdmi --json 0 limrun / ios-instance
open AgentDeviceTester.app.zip --json 0 limrun:ios: com.callstack.agentdevicelab
logs start --json 0 app log capture started
snapshot -i --json 0 29 interactive nodes, simulator-ax-bridge
press @e1 --json 0 Tapped @e1 (201, 437)
apps --json 0 3 installed apps
logs stop --json 0 app log capture stopped
close --json 0 Closed: review4846-created-ios-mws0sdmi
disconnect --json 0 disconnected, lease released by this command: false
daemon stop --json 0 graceful stop

Created Android

Command Exit Result
connect limrun --platform android --session review4846-created-android-mws0sdmi --json 0 limrun / android-instance
open com.callstack.agentdevicelab.apk --json 0 limrun:android: com.callstack.agentdevicelab
snapshot -i --json 0 29 interactive nodes, android-helper 0.22.0-dev
press @e1 --json 0 Tapped @e1 (360, 855)
apps --json 0 1 installed apps
close --json 0 Closed: review4846-created-android-mws0sdmi
disconnect --json 0 disconnected, lease released by this command: false
daemon stop --json 0 graceful stop

Owner of the attachment test simulator

Command Exit Result
connect limrun --platform ios --session review4846-attached-owner-mws0sdmi --json 0 limrun / ios-instance
boot --json 0 limrun:ios:
disconnect --json 0 disconnected, lease released by this command: true
daemon stop --json 0 graceful stop

Token-only iOS attachment

Command Exit Result
connect limrun --platform ios --session review4846-attached-ios-mws0sdmi --json 0 limrun / ios-instance
open com.apple.Preferences --json 0 limrun:ios: com.apple.Preferences
snapshot -i --json 0 18 interactive nodes, simulator-ax-bridge
close --json 0 Closed: review4846-attached-ios-mws0sdmi
disconnect --json 0 disconnected, lease released by this command: false
daemon stop --json 0 graceful stop

Both iOS runner.log files reached 185 bytes after close. They show that XCTest started, ran AgentDeviceRunnerUITests.RunnerTests.testCommand, and finished with one pass and zero failures. Created iOS excerpt:

{"type":"case","testClass":"AgentDeviceRunnerUITests.RunnerTests","method":"testCommand","durationMs":12369,"passed":true}
{"type":"summary","passed":1,"failed":0,"planFinished":true}

The initial runner packaging attempt rejected the tag local. Packaging succeeded with v0.0.0-dev. All live CLI commands returned 0. After cleanup, SDK iosInstances.list({}) and androidInstances.list({}) both succeeded, and an active-state paginated query returned zero instances for each platform.

@apex-sentinel-staging

This comment has been minimized.

@thymikee

Copy link
Copy Markdown
Member Author

Most of the earlier findings from the 99e1e82 review (#4846 (comment)) are fixed at 972b036: the live evidence and x1-x9 are closed, and a second independent pass found six remaining places where a credential returned by the instance can leak or break a normal reply. CI is green, with 28 checks and none failing, and there are no conflicts. Merge should wait until the six items below are fixed.

A second independent pass found that a local app install or reinstall on iOS or Android can leak a token prefix. If the instance returns its bare token as an invalid 2xx sync body, the SDK passes it to JSON.parse, and Node can quote the first ten characters in the SyntaxError. The head redactor in instance-error-scrubbing.ts:79 only matches the full token, so the prefix survives. The call sites are ios.ts:107 and android.ts:135. sync-cache.ts keeps the exception as the cause, and kernel errors.ts:596 publishes it. The rule: SDK sync decoder failures must become the existing static typed app-sync error with no decoder cause, while cancellation and typed transport failures stay as they are.

A second independent pass found that Android app logging can write the instance token to app.log. The current reader (device-session.ts:133, runtime.ts:853) and the recovered reader (app-log-reconnect.ts:166-167) both pass the raw logcat tail to provider-app-log-poller.ts:88-89. The rule: every Android log tail must be scrubbed with the session token at the provider reader boundary, for both current and recovered capture.

A second independent pass found that Android ADB errors can expose the token. For pm list packages -3, a nonzero exit with the token on stderr is returned by android.ts:285, and app-helpers.ts:69-72 and adb-failure.ts:259-274 attach it to the CLI error. Calls that disallow failure can build the error inside adb-host.ts:156-162 before the Limrun result check. The rule: textual ADB failure results and thrown errors must be scrubbed in the Limrun ADB adapter before shared code formats them, while typed status and binary output stay intact.

A second independent pass found that the forwarding scrubber can remove the runner's success field. If an iOS endpoint accepts the instance token ok, which credentials.ts:103-119 permits, a valid {"ok":true,"data":{}} reply loses its ok property at instance-error-scrubbing.ts:144 (ios-runner.ts:386). runner-contract.ts:643-645 then treats a normal reply as a failure, and the base forwards the field unchanged. The rule: fields the runner protocol reads for control flow must be preserved. Diagnostic strings should be scrubbed, and credential-bearing keys removed, only when projecting the payload for errors and logs.

A second independent pass found that iOS install verification can publish a credential returned as an app identifier. A successful sync reply can return the token as installedBundleId, or a URL install reply as bundleId. ios.ts:190 puts it in the verification error, and the same diagnostic copies inventory identifiers verbatim. The rule: peer-supplied identifiers and inventory strings must be scrubbed when building the error details, after the original identifiers are used for verification.

A second independent pass found that an ambiguous asset lookup can return the account key. If two available assets with the requested name exist and one id contains the key, app-catalog.ts:60 (fromLimrunOrgApi, lines 48-50) returns it in details.assetIds. The rule: scrub the asset ids with the account key in the ambiguity error, or report only the match count.

The high-priority inline threads need no further action here. Of the open inline threads, the default-selected profile admission ordering one (#4846 (comment)) does not apply, because that ordering is deferred to #4940 and this change does not touch provider-admission.ts. The error-text.ts one (#4846 (comment)) is fixed at 972b036, since the whole reason is now scrubbed before whitespace collapse and truncation. Both can be resolved.

Not verified here: @limrun/api 0.69.x is not installed locally, so whether an instance client constructor can reject with the org SDK's NotFoundError was not read. The base caught NotFoundError around the whole app-log reconnect, but at head only the org get maps 404 to "missing", so a vanished instance between the get and the connect could surface as an instance failure. Live runs, the regression batch that failed 10 tests before the fixes, and the check:affected receipt are taken from the author's comment, and nothing was run locally. Peer credential-echo behavior was not observed live, and the fixes were checked by reading the code paths.

@thymikee

Copy link
Copy Markdown
Member Author

Follow-up to the review at 972b036

  1. SDK sync JSON decoder failures on iOS and Android now reach the existing typed limrun_app_sync_failed error without a decoder cause. The sync cache still passes through cancellation and typed transport errors. Same-path tests covered a long token that Node quotes only in part and a short token that Node quotes in full. instance-error-scrubbing.ts:57, sync-cache.ts:39
  2. The current Android app-log reader and its recovered counterpart scrub the logcat tail with the session token before returning it to the shared poller. android.ts:319, device-session.ts:138, app-log-reconnect.ts:170
  3. The Android ADB adapter scrubs stdout and stderr on nonzero exits and redacts host-thrown errors before shared formatting. Numeric status and exit code are preserved, including a token that matches a status field name. Binary stdout is returned by reference. android.ts:297, instance-error-scrubbing.ts:133
  4. Forwarded runner replies retain their original envelope and payload for control flow. Redaction now runs when producing error details and log diagnostics, including status recovery. The forwarding regression test uses the token ok and confirms that a successful reply and its snapshot label survive. ios-runner.ts:61, runner-contract.ts:647, runner-exchange.ts:514, runner-command-recovery.ts:349, provider-plugin-host-capabilities-limrun-ios-runner.test.ts:822
  5. iOS install verification uses the original result and inventory identifiers to determine whether the install succeeded. Its failure details scrub those identifiers before publishing them. ios.ts:191
  6. An ambiguous uploaded asset now reports the match count. Peer-supplied asset IDs stay out of the error details. app-catalog.ts:57

Each finding had a focused failing assertion before its fix. The final focused runs passed 379 Limrun and forwarded-runner tests and 50 Apple runner tests. At eb28689b6a8bfb6f1ad371b5f59358c7f5b25e59, pnpm check:affected --run --base origin/0.22 --head HEAD passed all 43 runnable checks with exactCommit: true (receipt run-Fiw1Hz). The full unit suite passed 22,240 tests and skipped 8.

Packed created-iOS rerun

Fresh core and Limrun tarballs at eb28689b6a8bfb6f1ad371b5f59358c7f5b25e59 were installed in an isolated consumer. plugins add <limrun tarball> --json returned 0. The managed store listed a compatible Limrun plugin. Both packages are 0.22.0-dev. The consumer resolved @limrun/api@0.69.4.

Tarball SHA-256
agent-device 90bbe8174828d0e191f8cad78c0abd193ebd6e2a140311be42d5a310771e7600
@agent-device/limrun 5f252163a653075cc14a5d35070b134f08afa4610123b30e7bdfab8cdc0a77d2

The Xcode 27.1 simulator runner archive was reused from the prior smoke. The Swift runner sources and packaging scripts match the earlier head.

Command via packed node bin/agent-device.mjs Exit Result
connect limrun --platform ios --session review4846-created-ios-mws4p1bq --json 0 Limrun iOS lease selected
open AgentDeviceTester.app.zip --json 0 Device ID starts with limrun:ios:, app com.callstack.agentdevicelab
snapshot -i --json 0 29 interactive nodes, simulator-ax-bridge
press @e1 --json 0 Tapped @e1
close --json 0 Session closed
disconnect --json 0 Connection cleared
daemon stop --json 0 Graceful stop

runner.log was 185 bytes after close. XCTest executed AgentDeviceRunnerUITests.RunnerTests.testCommand in 11,842 ms and finished with one pass and zero failures. The final SDK calls to iosInstances.list({}) and androidInstances.list({}) both succeeded, and active-state pagination returned zero instances on both platforms.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of eb28689

Since the review of 972b036: 0 new · 0 still open · 0 no longer raised

No open findings.

Not in the reviewers' prompt (35 files)
  • .fallowrc.json: left out as an asset or for its size; reviewers could still search it
  • LICENSES/xdelta3-wasm.txt: left out as an asset or for its size; reviewers could still search it
  • README.md: left out as an asset or for its size; reviewers could still search it
  • THIRD_PARTY_NOTICES.md: left out as an asset or for its size; reviewers could still search it
  • examples/sdk/tsconfig.json: left out as an asset or for its size; reviewers could still search it
  • package.json: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/README.md: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/package.json: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/src/download-file.test.ts: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/src/error-text.test.ts: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/src/instance-error-scrubbing.test.ts: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/src/internal.ts: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/src/ios-runner-products.test.ts: left out as an asset or for its size; reviewers could still search it
  • packages/provider-limrun/tsconfig.json: left out as an asset or for its size; reviewers could still search it
  • pnpm-lock.yaml: generated or a lockfile, so its lines were left out
  • scripts/__tests__/fixtures/bundled-license-build.mts: left out as an asset or for its size; reviewers could still search it
  • src/__tests__/limrun-runtime.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/__tests__/provider-device-runtimes.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/__tests__/test-utils/builtin-plugin-inventory.ts: left out as an asset or for its size; reviewers could still search it
  • src/builtin-provider-ids.ts: left out as an asset or for its size; reviewers could still search it
  • src/builtin-provider-plugins.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/builtin-provider-plugins.ts: left out as an asset or for its size; reviewers could still search it
  • src/cli/connection/provider-admission-credential-order.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/cli/connection/provider-admission-scoping.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/cli/connection/provider-admission.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/core/interactors/limrun-ios-runner-errors.ts: left out as an asset or for its size; reviewers could still search it
  • src/core/limrun-download-file.ts: left out as an asset or for its size; reviewers could still search it
  • src/provider-plugin-host-capabilities-limrun-ios-files.test.ts: left out as an asset or for its size; reviewers could still search it
  • src/sdk/limrun-runtime-dependencies.ts: left out as an asset or for its size; reviewers could still search it
  • tsconfig.json: left out as an asset or for its size; reviewers could still search it
  • tsdown.config.ts: left out as an asset or for its size; reviewers could still search it
  • website/docs/docs/device-clouds.md: left out as an asset or for its size; reviewers could still search it
  • website/docs/docs/error-reasons.md: left out as an asset or for its size; reviewers could still search it
  • website/docs/docs/limrun.md: left out as an asset or for its size; reviewers could still search it
  • website/docs/docs/plugins.md: left out as an asset or for its size; reviewers could still search it

1 finding below minor hidden (user_settings.min_severity).

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

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant