fix(claude): map TodoWrite updates to plan events #1387
Closedsamjandris(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/1387/headopened View on GitHub- apps/server/src/provider/Layers/ClaudeAdapter.ts line 1763OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1757,3 +1760,4 @@17571760 result: toolResult.block,17581761 };175917621763+ if (tool.toolName === "TodoWrite" && !toolResult.isError && context.turnState) {apps/server/src/provider/Layers/ClaudeAdapter.ts line 1763OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -1757,3 +1760,4 @@17571760 result: toolResult.block,17581761 };175917621763+ if (tool.toolName === "TodoWrite" && !toolResult.isError && context.turnState) {
- apps/server/src/provider/Layers/ClaudeAdapter.ts line 403OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -398,3 +398,6 @@398398399399 function classifyToolItemType(toolName: string): CanonicalItemType {400400 const normalized = toolName.toLowerCase();401+ if (normalized.includes("todowrite")) {402+ return "plan";403+ }
- apps/server/src/provider/Layers/ClaudeAdapter.ts line 1764OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1768,19 +1763,2 @@1768- itemId: asRuntimeItemId(tool.itemId),1769- payload: {1770- itemType: tool.itemType,1771- status: toolResult.isError ? "failed" : "inProgress",1772- title: tool.title,1773- ...(tool.detail ? { detail: tool.detail } : {}),1774- data: toolData,1775- },1776- providerRefs: nativeProviderRefs(context, { providerItemId: tool.itemId }),1777- raw: {1778- source: "claude.sdk.message",1779- method: "claude/user",1780- payload: message,1781- },1782- });1783-1784- const streamKind = toolResultStreamKind(tool.itemType);1785- if (streamKind && toolResult.text.length > 0 && context.turnState) {1786- const deltaStamp = yield* makeEventStamp();1763+ if (1764+ tool.toolName.toLowerCase() === "todowrite" &&
- apps/server/src/provider/Layers/ClaudeAdapter.ts line 403OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -398,3 +398,6 @@398398399399 function classifyToolItemType(toolName: string): CanonicalItemType {400400 const normalized = toolName.toLowerCase();401+ if (normalized.includes("todowrite")) {402+ return "plan";403+ }
- @@ -1793,0 +1776,21 @@1776+ .filter(1777+ (entry): entry is Record<string, unknown> =>1778+ typeof entry === "object" && entry !== null,1779+ )1780+ .map((entry) => ({1781+ step: typeof entry.content === "string" ? entry.content : "step",1782+ status:1783+ entry.status === "completed"1784+ ? "completed"1785+ : entry.status === "in_progress"1786+ ? "inProgress"1787+ : "pending",1788+ })),1789+ },1790+ providerRefs: nativeProviderRefs(context, { providerItemId: tool.itemId }),1791+ raw: {1792+ source: "claude.sdk.message",1793+ method: "claude/user",1794+ payload: message,1795+ },1796+ });
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
samjandris(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
f9db7547-a4eb-4c6e-ac39-0b59ff51b900You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
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