mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-22 15:51:18 -07:00
Disallow and suppress unsafe assignment (#19736)
This commit is contained in:
committed by
GitHub
parent
3e786a161e
commit
981e9a978e
@@ -26,6 +26,7 @@ async function generateAndSaveSummary(
|
||||
): Promise<void> {
|
||||
// Read session file
|
||||
const content = await fs.readFile(sessionPath, 'utf-8');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const conversation: ConversationRecord = JSON.parse(content);
|
||||
|
||||
// Skip if summary already exists
|
||||
@@ -69,6 +70,7 @@ async function generateAndSaveSummary(
|
||||
|
||||
// Re-read the file before writing to handle race conditions
|
||||
const freshContent = await fs.readFile(sessionPath, 'utf-8');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const freshConversation: ConversationRecord = JSON.parse(freshContent);
|
||||
|
||||
// Check if summary was added by another process
|
||||
@@ -127,6 +129,7 @@ export async function getPreviousSession(
|
||||
|
||||
try {
|
||||
const content = await fs.readFile(filePath, 'utf-8');
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
const conversation: ConversationRecord = JSON.parse(content);
|
||||
|
||||
if (conversation.summary) {
|
||||
|
||||
Reference in New Issue
Block a user