@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
22
33import {
44 extractCloudFileContent ,
5+ extractCloudToolChangedFiles ,
56 type ParsedToolCall ,
67} from "./cloudToolChanges" ;
78
@@ -34,6 +35,35 @@ function makeToolCalls(
3435 return new Map ( calls . map ( ( tc , i ) => [ tc . toolCallId || `tc-${ i } ` , tc ] ) ) ;
3536}
3637
38+ describe ( "extractCloudToolChangedFiles" , ( ) => {
39+ it ( "excludes plan files from changed files" , ( ) => {
40+ const calls = makeToolCalls (
41+ toolCall ( {
42+ toolCallId : "tc-plan" ,
43+ kind : "write" ,
44+ locations : [
45+ {
46+ path : "/home/user/.claude/plans/breezy-squishing-twilight.md" ,
47+ } ,
48+ ] ,
49+ content : diffContent (
50+ "/home/user/.claude/plans/breezy-squishing-twilight.md" ,
51+ "# Plan\n\nDo stuff" ,
52+ ) ,
53+ } ) ,
54+ toolCall ( {
55+ toolCallId : "tc-real" ,
56+ kind : "edit" ,
57+ locations : [ { path : "src/app.ts" } ] ,
58+ content : diffContent ( "src/app.ts" , "new code" , "old code" ) ,
59+ } ) ,
60+ ) ;
61+ const result = extractCloudToolChangedFiles ( calls ) ;
62+ expect ( result ) . toHaveLength ( 1 ) ;
63+ expect ( result [ 0 ] . path ) . toBe ( "src/app.ts" ) ;
64+ } ) ;
65+ } ) ;
66+
3767describe ( "extractCloudFileContent" , ( ) => {
3868 it ( "returns untouched for an empty tool calls map" , ( ) => {
3969 const result = extractCloudFileContent ( new Map ( ) , "src/app.ts" ) ;
0 commit comments