agent-device devices fails with "Request ID is already in flight" when a token holds several leases on one worker

Aperta Adatta ai principianti
#1,293 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@V3RON ci sta già lavorando.

Dal 6/11/2026.

  • #1352 di @V3RON — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, backend

Direzione di ricerca

Inizia da src/agent-device/front/devices-filter.ts, intorno alle righe 119–131, dove devicesThroughGateway invia richieste ai lease in parallelo, e verifica come vengono creati e inoltrati gli ID delle richieste. Controlla se le richieste inviate allo stesso worker devono avere ID distinti, quindi aggiungi o aggiorna un test per un token con più lease su un worker. Il lavoro è completato quando devices restituisce dispositivi per ogni lease senza un errore dovuto a un ID di richiesta duplicato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug:new platform:ios
What happened

With one agent token holding several leases through a gateway, the agent-device devices command fails with INVALID_ARGS "Request ID is already in flight" (agent-device reason duplicate_request_id).

Probable cause: devicesThroughGateway (src/agent-device/front/devices-filter.ts:119-131) sends the same request body, including the same request id, and the same headers to every lease in parallel with Promise.all. When two of those leases are on the same worker, that worker's agent-device daemon gets one request id twice at once and refuses the second.

What you expected

devices lists the devices of every lease the token holds.

How to reproduce
  1. A gateway with one worker that can host at least two iOS simulators.
  2. With one agent token, allocate two iOS leases through /v1/agent-device (agent-device leases.allocate, two sessions).
  3. Send devices through the proxy with that token.
  4. It fails with "Request ID is already in flight". Reported by budgie; not reproduced in simlock yet.
Environment

budgie's farm: a gateway plus a Mac Studio worker (simlock version not stated in the PR). Client: agent-device 0.21.35 on Linux. iOS 26 simulators.

Logs and evidence

Found by budgie's e2e suite (budgie-at/budgie#1867). Its relay (e2e/support/simlock/relay.ts) answers boot locally partly to avoid this: "simlock's devices for a token holding several leases collides with itself ("Request ID is already in flight")".

Written by an agent.

Lingua principale
TypeScript
Stelle
535
Fork
21
Merge medio
9h 31m
PR unite (30g)
434

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di callstackincubator/simlock

Tutte le issue di callstackincubator/simlock

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.