Skip to content

fix(mobile): name the agent-device session for device-cloud leases - #1513

Merged
okwasniewski merged 1 commit into
e2e-inc:mainfrom
thymikee:fix/name-lease-sessions
Nov 3, 2026
Merged

okwasniewski merged 1 commit into
e2e-inc:mainfrom
thymikee:fix/name-lease-sessions

Conversation

@thymikee

@thymikee thymikee commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What and why

  • agent-device is about to refuse provider-lease requests from a Node client that names no session (REMOTE_SESSION_REQUIRED, fix(daemon): refuse leased requests that name no session at admission callstack/agent-device#4177): on a shared daemon, an unnamed client lands on the default session and can act through another agent's lease.
  • Four e2e clients hit that today: the BrowserStack/TestMu AI lease allocate and heartbeat in packages/mobile/src/lease/, and Limrun's allocate and apps.install in packages/limrun/src/driver.ts. Limrun's heartbeat reuses the binding's client.
  • Each now names a session, e2e-lease-<8 hex of the lease's stateDir>. One daemon holds one lease, so the name only has to be stable per stateDir. The worker engine still sets its own session over the lease client's (packages/mobile/src/engine.ts).
  • Limrun inlines the same one-line hash instead of importing it, so @e2e-dev/mobile gains no public export.
  • Works with the pinned agent-device 0.21.35 as is, so e2e can bump past #4177 without a break.

Issue

No e2e issue: this prepares for callstack/agent-device#4177, planned for agent-device 0.22.

Verified

Ran it locally: yes

  • pnpm check passes; @e2e-dev/mobile unit tests 484 passed, @e2e-dev/limrun 17 passed.
  • On a real daemon, mirroring the lease driver (private stateDir, socket transport, leaseProvider: 'proxy', allocate then heartbeat):
--- agent-device #4177 head (3707e6277c)
unnamed: refused INVALID_ARGS reason=REMOTE_SESSION_REQUIRED
named: allocate+heartbeat ok (session e2e-lease-fbf28664, lease 2861f02a4e07980798a6afef58c2f492)
--- agent-device 0.21.35 (e2e pin)
unnamed: allocate+heartbeat ok (session none, lease 671c6f9fa6e0b968260b1d2587f727e7)
named: allocate+heartbeat ok (session e2e-lease-3ca37d1f, lease 13eac357ffe4280dbb7fa005a7503172)
  • Not run against live BrowserStack, TestMu AI, or Limrun devices.

Checklist

  • Changeset added (pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.
  • Breaking change: not applicable.
  • Docs updated in the same PR: no change needed, the docs do not describe the lease client's session.
  • Contract change: not applicable.
  • Engine contract change: not applicable.

🤖 Generated with Claude Code

View guided diff

agent-device refuses a provider lease to a Node client that names no
session (callstack/agent-device#4177). The lease allocate and heartbeat
clients, and Limrun's allocate and install, now use a session derived
from the lease daemon's stateDir.

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

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR. It does not meet the contributing guidelines yet:

  • A fix PR needs an existing issue. Open one if there is none, then add Fixes #123 under ## Issue.

Edit the PR within 72 hours or it will be closed automatically. If this was flagged by mistake, say so here.

@github-actions github-actions Bot added size:S Up to 29 changed lines, not counting tests, fixtures, or the lockfile needs:compliance Community PR fails CONTRIBUTING.md#pull-requests, closed after 72h if not fixed labels Nov 3, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 8 files

View guided diff | Re-trigger cubic

@okwasniewski okwasniewski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@okwasniewski
okwasniewski merged commit 383c0bc into e2e-inc:main Nov 3, 2026
25 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 3, 2026
kblok added a commit to hardkoded/e2e-dotnet that referenced this pull request Nov 3, 2026
* Name the agent-device session of a device-cloud lease (upstream e2e-inc/e2e#1513)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK

* Check the Limrun driver created at least one client

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK

* Fix whitespace

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Akarshkushwaha pushed a commit to Akarshkushwaha/e2e that referenced this pull request Nov 10, 2026
The driver put the agent-device session on the lease's client (e2e-inc#1513), a
key the mobile engine reserves, so the engine rejected every Limrun lease
with ENGINE_FAILURE. The session now stays on the driver's and the
heartbeat's own clients and off the client the engine receives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:compliance Community PR fails CONTRIBUTING.md#pull-requests, closed after 72h if not fixed size:S Up to 29 changed lines, not counting tests, fixtures, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants