Skip to content

Commit b9eaca3

Browse files
committed
fix HOTFIX remove cumulative args case
1 parent 4b51607 commit b9eaca3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

gui/src/util/toolCallState.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff 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 || "{}");

0 commit comments

Comments
 (0)