Skip to content

fix(desktop): 刷新设备注册后的真实执行目标缓存 - #2328

Merged
DeliciousBuding merged 2 commits into
masterfrom
fix/desktop-target-invalidation
Sep 5, 2026
Merged

fix(desktop): 刷新设备注册后的真实执行目标缓存#2328
DeliciousBuding merged 2 commits into
masterfrom
fix/desktop-target-invalidation

Conversation

@DeliciousBuding

@DeliciousBuding DeliciousBuding commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #2327

  • DesktopHubTaskBridge 注册就绪后的失效改用 hubQueryKeys.executionTargets.root,命中生产 useHubExecutionTargets 的 Hub 缓存,而不是无生产者的 ['execution-targets']
  • 不改变缓存形状、轮询、注册/同步条件或 rendered UI;不重构无关本地缓存。
  • 新增行为测试:由生产查询 hook 建立新鲜缓存,再挂载实际 bridge;断言数据真的重取,同时保护未注册和无关 Hub 数据。
  • CI 揭示 App.v4 的装配测试仍把错误 literal 钉死为正确行为。移除该正向 spy 断言,保留桥接装配及未注册负向保护;缓存行为由新的真实 QueryClient 测试覆盖。

Files

  • app/desktop/src/components/DesktopHubTaskBridge.tsx
  • app/desktop/src/components/DesktopHubTaskBridge.test.tsx
  • app/desktop/src/__tests__/App.v4.test.tsx

Reproduction / verification

  • PRE(旧生产代码):2 tests 中 1 failed / 1 passed。注册后的缓存仍为旧空列表,未得到接口新返回的目标;不是只断言调用发生。
  • POST(定向):bridge、execution-target queries、device-registration 的 3 files / 12 tests 全通过;App.v4 + bridge 的 2 files / 16 tests 全通过。
  • POST(完整 Desktop)pnpm --filter agenthub-desktop test54 files / 461 tests PASS
  • pnpm --filter agenthub-desktop typecheck — PASS
  • pnpm --filter agenthub-desktop typecheck:tests — PASS
  • 对上述 3 文件运行 ESLint --max-warnings 0 — PASS
  • git diff --check — PASS
  • 基于 chore(frontend): 收口已修决策与 i18n 回归预算 #2326 合并后的 origin/master;本轮修改限于上述 Desktop 三文件。

Evidence boundary

这是 L0 的生产 hook + QueryClient 行为证据,网络与设备注册由测试夹具提供。不是 packaged Desktop、真实设备注册或真实模型验收;正常的 10 秒轮询可能掩盖原问题,因此不将其描述为无界陈旧。已有 App.v4 的 React act warnings 未纳入本次无关修复。

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 5c7d4a30-4b7d-4d9c-9eec-5c09f36a08f0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DeliciousBuding
DeliciousBuding merged commit 675ccc1 into master Sep 5, 2026
43 checks passed
@DeliciousBuding
DeliciousBuding deleted the fix/desktop-target-invalidation branch September 5, 2026 18:58
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.

fix(desktop): 设备注册后执行目标缓存失效命中错误键

1 participant