Skip to content

Commit 00fc2e3

Browse files
committed
fix: manually track Chromium log state instead of relying on the model
1 parent 866ad75 commit 00fc2e3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/chat/commands/upgradesFindCL.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ async function analyzeBuildError(
214214
request.model,
215215
));
216216

217+
// A hackish way to track state for the Chromium log tool without
218+
// relying on the model to do it since it constantly gets it wrong
219+
const chromiumLogToolState = {
220+
startVersion: previousChromiumVersion,
221+
endVersion: newChromiumVersion,
222+
page: 1,
223+
};
224+
217225
const accumulatedToolResults: Record<string, vscode.LanguageModelToolResult> =
218226
{};
219227
const toolCallRounds: ToolCallRound[] = [];
@@ -241,6 +249,13 @@ async function analyzeBuildError(
241249
responseStr += part.value;
242250
} else if (part instanceof vscode.LanguageModelToolCallPart) {
243251
toolCalls.push(part);
252+
if (part.name === lmToolNames.chromiumLog) {
253+
// Inject the Chromium log tool state into the input
254+
Object.assign(part.input, chromiumLogToolState);
255+
256+
// Increment the page number for the next call
257+
chromiumLogToolState.page += 1;
258+
}
244259
}
245260
}
246261

0 commit comments

Comments
 (0)