DeepSeek-Reasonix icon indicating copy to clipboard operation
DeepSeek-Reasonix copied to clipboard

fix(frontend): narrow tool items in todo metadata tests / 收窄待办元数据测试中的工具项类型

Open SivanCola opened this issue 3 months ago • 0 comments

Summary

  • Fix the frontend test-config TypeScript failure caused by accessing args through the broad Item union.
  • Add explicit tool-item predicates for the live todo_write lookups.
  • Record the reviewed v1.21.0 upgrade note that no manual migration is required.

Problem

pnpm --dir desktop/frontend test:all failed during test:typecheck because the new todo metadata tests did not express the discriminated-union narrowing before reading tool args.

Root cause

Array.prototype.find returned the broad Item union even though the callback checked kind === "tool".

Fix

Use Extract<Item, { kind: "tool" }> type predicates for both todo_write lookups.

Verification

  • pnpm --dir desktop/frontend test:all
  • node scripts/release-notes.mjs validate
  • node --test scripts/release-notes.test.mjs
  • git diff --check

Release impact

Test-only TypeScript narrowing; no runtime or provider/cache behavior changes.

SivanCola avatar Aug 06 '26 14:08 SivanCola