mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-16 00:51:25 -07:00
Disallow unnecessary awaits. (#15172)
This commit is contained in:
committed by
GitHub
parent
3e9a0a7628
commit
7f2d33458a
@@ -149,7 +149,7 @@ describe('checkpoint utils', () => {
|
||||
] as ToolCallRequestInfo[];
|
||||
|
||||
(mockGitService.createFileSnapshot as Mock).mockResolvedValue('hash123');
|
||||
(mockGeminiClient.getHistory as Mock).mockResolvedValue([
|
||||
(mockGeminiClient.getHistory as Mock).mockReturnValue([
|
||||
{ role: 'user', parts: [] },
|
||||
]);
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ export async function processRestorableToolCalls<HistoryType>(
|
||||
continue;
|
||||
}
|
||||
|
||||
const clientHistory = await geminiClient.getHistory();
|
||||
const clientHistory = geminiClient.getHistory();
|
||||
const checkpointData: ToolCallData<HistoryType> = {
|
||||
history,
|
||||
clientHistory,
|
||||
|
||||
@@ -237,7 +237,7 @@ describe('editCorrector', () => {
|
||||
mockGeminiClientInstance = new GeminiClient(
|
||||
mockConfigInstance,
|
||||
) as Mocked<GeminiClient>;
|
||||
mockGeminiClientInstance.getHistory = vi.fn().mockResolvedValue([]);
|
||||
mockGeminiClientInstance.getHistory = vi.fn().mockReturnValue([]);
|
||||
mockBaseLlmClientInstance = {
|
||||
generateJson: mockGenerateJson,
|
||||
config: {
|
||||
@@ -606,9 +606,7 @@ describe('editCorrector', () => {
|
||||
],
|
||||
},
|
||||
];
|
||||
(mockGeminiClientInstance.getHistory as Mock).mockResolvedValue(
|
||||
history,
|
||||
);
|
||||
(mockGeminiClientInstance.getHistory as Mock).mockReturnValue(history);
|
||||
|
||||
const result = await ensureCorrectEdit(
|
||||
filePath,
|
||||
|
||||
@@ -90,7 +90,7 @@ async function findLastEditTimestamp(
|
||||
filePath: string,
|
||||
client: GeminiClient,
|
||||
): Promise<number> {
|
||||
const history = (await client.getHistory()) ?? [];
|
||||
const history = client.getHistory() ?? [];
|
||||
|
||||
// Tools that may reference the file path in their FunctionResponse `output`.
|
||||
const toolsInResp = new Set([
|
||||
|
||||
Reference in New Issue
Block a user