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

クローズ 初心者向け
#1,293 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@V3RON がすでに取り組んでいます。

2026年11月6日 から。

  • #1352 @V3RON による — マージ済み

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api, backend

調査の方向性

devicesThroughGateway がリースに並列でリクエストを送信する src/agent-device/front/devices-filter.ts の119~131行付近から始め、リクエストIDがどのように作成され、転送されるかを調べてください。同じworkerに送信されるリクエストに個別のIDが必要か確認し、1つのworker上に複数のリースを持つトークンのテストを追加または更新してください。devices が重複したリクエストIDのエラーを起こさず、すべてのリースのデバイスを返せば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
TypeScript
スター
535
フォーク
21
平均マージ
9時間 10分
マージ済み PR(30日)
454

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstackincubator/simlock のほかの issue

callstackincubator/simlock の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。