Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
39d7f39 to
134960a
Compare
134960a to
90c183b
Compare
|
Closing as superseded by #2041. That feature reuses this stack's design: a light backend definition in the driver registry, a heavy backend module in the daemon, and a Written by an agent. |
This replaces the ADC portion of #1471 on top of the backend ownership and capability work in #1500. The Android backend lives in
src/drivers/android/adc/and registers its light definition and heavy module through the two registries.The worker provisions an ADC session, connects it through an authenticated WebSocket to its private ADB server, and exposes a normal Simlock lease. It needs platform-tools and an ADC account API key. It uses ADC's
/v2/leasesAPI, which keeps devices allocated until explicit release. Simlock remains the only lease clock; this adds no provider-deadline or renewal hooks.Provisioning journals a local allocation before requesting a remote device. Each activation has a durable idempotency key, so a lost creation response can be replayed. Shutdown releases the remote session, and a later boot creates a fresh device. Recovery reconnects to the same active session and saved ADB relay port. ADC has its own ADB server record and default port
5039, preserving local-backend servers when the selected backend changes.Connecting to ADC
From a checkout of this PR, with Node.js, pnpm and
adbinstalled:Stop an existing Simlock worker under the same OS user first. Create
$SIMLOCK_HOME/config.json:{ "drivers": { "android": { "backend": "adc", "apiUrl": "https://api.agentdevicecloud.xyz", "apiKeyEnv": "ADC_API_KEY" } }, "capacity": { "strategy": "fixed", "config": { "maxRunning": 1, "android": { "maxRunning": 1, "maxDevices": 1 } } }, "warmPool": { "enabled": false }, "memoryPressure": { "enabled": false } }Start the worker and request an Android 14 device:
Copy
lease.idanddevice.addressfrom the returned grant:Use your APK path and component. The detached Simlock lease expires after 15 minutes unless renewed; release or Simlock expiry releases ADC. If the worker stops, ADC keeps its sessions running and accruing usage until explicitly released. The ADC key stays on the worker; gateway agents use their normal Simlock credentials. A worker uses one Android backend, so USB phones are unavailable while ADC is selected.
The ADC tests cover lifecycle, replay after a lost response, ownership, origin validation, and preservation of another backend's ADB server. The restacked branch passes 341 targeted tests and the website/OpenAPI check. I also ran the compiled Simlock API client against a local running ADC service over real HTTP: after advancing its clock by 120 days, the same session remained active; replay and release were idempotent. This test used no real Android device. A live-device check through this Simlock backend against the v2 service remains pending; the earlier prototype also hit an unhandled TLS
ECONNRESETduring a disconnect, which still needs investigation before unattended use.Written by an agent.