DeepSeek-Reasonix
DeepSeek-Reasonix copied to clipboard
fix(frontend): narrow tool items in todo metadata tests / 收窄待办元数据测试中的工具项类型
Summary
- Fix the frontend test-config TypeScript failure caused by accessing
argsthrough the broadItemunion. - Add explicit tool-item predicates for the live
todo_writelookups. - 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:allnode scripts/release-notes.mjs validatenode --test scripts/release-notes.test.mjsgit diff --check
Release impact
Test-only TypeScript narrowing; no runtime or provider/cache behavior changes.