Repository navigation
fix(gateway): drop agent-device instance pins when relaying - #1009
Open
juliusmarminge wants to merge 2 commits into
Open
juliusmarminge wants to merge 2 commits into
juliusmarminge wants to merge 2 commits into
Conversation
A client reads /health before it names a lease and pins that daemon's
instance id on every later request. The gateway forwards bare requests such
as /health to whichever capable worker it finds first, so with more than one
worker the pin often names a different daemon than the lease's. That daemon
then refuses every call with 409 x-agent-device-instance-mismatch ("Remote
daemon instance changed"), and allocation fails.
Drop x-agent-device-instance and x-agent-device-upstream-instance in
RelayHostLink.forward, as a worker already does for its phone daemon.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK ships no Samsung profiles, and a devices.xml profile carries no hinge, so there was no way to lease a Samsung fold. The profile is the SDK's pixel_fold with the Z Fold 8's screens: inner 2448x1848 (4:3), cover 1248x1972 (16:10). It keeps pixel_fold's hw.device.name, without which the emulator boots one flat screen with no fold states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
An agent-device client reads
GET /healthbefore it names a lease, then pins that daemon's instance id on every later request inx-agent-device-instanceandx-agent-device-upstream-instance. Through a gateway,RelayHostLinksends that bare/healthto the first undrained capable worker. With more than one worker, the lease's worker is often a different daemon. That daemon refuses the pinned call with409andx-agent-device-instance-mismatch: true, the client reports "Remote daemon instance changed", andopen(agent_device.lease.allocate) fails.Reproduced with one gateway, one macOS worker serving iOS and four Linux workers serving Android: every iOS
openfailed. Draining the Android workers made it pass.Fix
RelayHostLink.forwardnow deletes both pin headers before it relays, the same waydropInstancePinsinfront/host-link.tsalready does for a worker's phone daemon. The module manual's gateway flow now says this.Verification
src/agent-device/front/relay-host-link.test.ts: a bare/healthprobe and a call on a lease, each sent with both pin headers, reachfleet.relaywithout either one. Both cases fail onmainand pass with the fix:pnpm exec vitest run --project unit src/agent-device/front/relay-host-link.test.tsgives 17 passed.🤖 Generated with Claude Code