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

未关闭 适合新手
#1,293 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@V3RON 已经在做这个了。

开始于 2026年11月6日。

  • #1352 来自 @V3RON —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
api, backend

调研方向

从 src/agent-device/front/devices-filter.ts 第119–131行附近开始,这里 devicesThroughGateway 会并行向各个 lease 发送请求;检查请求 ID 是如何创建和转发的。检查发送到同一 worker 的请求是否需要不同的 ID,然后为一个 worker 上有多个 lease 的 token 添加或更新测试。当 devices 返回每个 lease 的设备,且没有重复请求 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 小时 31 分钟
30 天内合并 PR
434

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstackincubator/simlock 的其他 Issue

查看 callstackincubator/simlock 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。