Skip to content

fix(web): 按正在使用的 session 持续显示请求中 - #1174

Open
dofastted wants to merge 1 commit into
mainfrom
fix/web-vm-requesting
Open

dofastted wants to merge 1 commit into
mainfrom
fix/web-vm-requesting

Conversation

@dofastted

@dofastted dofastted commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

摘要

  • VM 列表和详情卡的「在飞」改为「请求中」,按这台 VM 实际占用的 session 计数,不再只在请求打到的瞬间闪一下。
  • 有逐席 session 时,只加总正在请求的席位(active 或 inflight > 0);交接中的 held 不算。Codex 没有逐席明细时仍用 VM 级 inflight,不用 session_active。
  • 席位流还连着时,列表、总览、详情的 refetch 如果带着更早的响应回来,会用最近一帧席位盖回去。

验证

  • pnpm -C web exec vitest run src/lib/vm-status.test.ts src/features/vm/use-pool-seat-stream.test.ts src/features/vm/vm-list-table.test.tsx(73 通过)
  • pnpm -C web exec tsc -b --pretty false 无错误

Note

Medium Risk
Changes React Query cache merge behavior for live seat data alongside display metrics; bugs could show stale or incorrect requesting counts but are scoped to the VM panel UI.

Overview
VM list and detail UI now show 请求中 (requesting) instead of 在飞 (in-flight), using a new vmRequestingCount helper that totals per-seat inflight and active sessions when seat_sessions exists, ignores held handoffs and empty seat books, and only falls back to VM-level inflight for rows without per-seat data (e.g. Codex).

The pool seat SSE hook now keeps the latest seat snapshot and re-applies it after successful refetches on list, dashboard, and VM detail query keys (isLiveSeatQueryKey), so slower polling responses cannot overwrite fresher live stream updates while the connection is open.

Reviewed by Cursor Bugbot for commit 8131dec. Configure here.

列表和详情不再用会被轮询盖掉的 vm.inflight。请求中只统计席位上仍在请求的 session;席位流连接期间,更早发出的列表轮询不会清掉最新一帧。
@cursor

cursor Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: af913beb-5be6-4beb-b901-371c5f2a7dd3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant