feat(cli): Move key restore logic to core (#13013)

This commit is contained in:
Coco Sheng
2025-12-04 10:56:16 -05:00
committed by GitHub
parent 0a2971f9d3
commit b27cf0b0a8
14 changed files with 404 additions and 103 deletions

View File

@@ -16,6 +16,7 @@ import type {
ThoughtSummary,
ToolCallRequestInfo,
GeminiErrorEventValue,
ToolCallData,
} from '@google/gemini-cli-core';
import {
GeminiEventType as ServerGeminiEventType,
@@ -1313,22 +1314,23 @@ export const useGeminiStream = (
toolCallWithSnapshotFileName,
);
const checkpointData: ToolCallData<
HistoryItem[],
Record<string, unknown>
> & { filePath: string } = {
history,
clientHistory,
toolCall: {
name: toolCall.request.name,
args: toolCall.request.args,
},
commitHash,
filePath,
};
await fs.writeFile(
toolCallWithSnapshotFilePath,
JSON.stringify(
{
history,
clientHistory,
toolCall: {
name: toolCall.request.name,
args: toolCall.request.args,
},
commitHash,
filePath,
},
null,
2,
),
JSON.stringify(checkpointData, null, 2),
);
} catch (error) {
onDebugMessage(