Repository navigation
fix(gateway): drop agent-device instance pins when relaying - #1045
Merged
Merged
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>
Contributor
Author
Review ledgerRound 1: 00ec5d4 {"findings":[]}Written by an agent. |
Contributor
Author
Review notesNot blocking, not verified. Each is one reviewer's claim.
Written by an agent. |
Contributor
Author
Delivery runMerged: #1045 (no issue) Written by an agent. |
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 naming a lease, then pins that daemon's instance id on every request (x-agent-device-instance,x-agent-device-upstream-instance). Through a gateway,RelayHostLinksends the bare/healthto the first capable worker. The lease often lands on another worker, whose daemon answers409withx-agent-device-instance-mismatch: true, soopenfails with "Remote daemon instance changed".Reproduced in #1009 (one iOS and four Android workers): every iOS
openfailed.Fix
RelayHostLink.forwardnow deletes both pin headers before it relays, asdropInstancePinsinfront/host-link.tsalready does on a worker for its phone daemon. The module manual's gateway flow says so.This is the gateway commit from #1009 by Julius Marminge, authorship kept; that PR's warm-pool commits are in #1043.
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 them. 17 passed.Review
Spec review: skipped. Code review: 0 blocking, 0 fixed, 2 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 2.3M.
Runs: 1. Cost USD: 0.1428. Agent seconds: 76.
Assessment: complete
Status
Implement: done Review: round 1, 0 findings Hardware: n/a (verified on a gateway fleet by the author) Gate: running
Next: gate
Written by an agent.