File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,11 @@ export function addToolCallDeltaToState(
4444 // If args is JSON parseable, it is complete, don't add to it
4545 JSON . parse ( currentArgs ) ;
4646 } catch ( e ) {
47- if ( argsDelta . startsWith ( currentArgs ) ) {
48- // Case where model progresssively streams args but full args each time e.g. "{"file": "file1"}" -> "{"file": "file1", "line": 1}"
49- mergedArgs = argsDelta ;
50- } else if ( ! currentArgs . startsWith ( argsDelta ) ) {
51- // Case where model streams in args in parts e.g. "{"file": "file1"" -> ", "line": 1}"
52- mergedArgs = currentArgs + argsDelta ;
53- }
47+ // Model streams in args in parts e.g. "{"file": "file1"" -> ", "line": 1}"
48+ mergedArgs = currentArgs + argsDelta ;
49+
50+ // Note, removed case where model progresssively streams args but full args each time e.g. "{"file": "file1"}" -> "{"file": "file1", "line": 1}"
51+ // Because no apis do this and difficult to detect reliably
5452 }
5553
5654 const [ _ , parsedArgs ] = incrementalParseJson ( mergedArgs || "{}" ) ;
You can’t perform that action at this time.
0 commit comments