From 865130cd54d8f4ca17765f8ea0fe0ac2c9b23005 Mon Sep 17 00:00:00 2001 From: Aishanee Shah Date: Tue, 19 May 2026 16:34:00 +0000 Subject: [PATCH] fix: resolve conflict markers in geminiChat.ts for Stage 1 --- packages/core/src/core/geminiChat.ts | 22 ++++++++-------------- packages/core/src/services/gitService.ts | 21 ++++----------------- 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts index bdfa5d2b3a..f013eaface 100644 --- a/packages/core/src/core/geminiChat.ts +++ b/packages/core/src/core/geminiChat.ts @@ -287,7 +287,6 @@ export class GeminiChat { messages?: MessageRecord[], ) { validateHistory(history); -<<<<<<< HEAD let initialHistory: HistoryTurn[]; // If history is passed, it is the most up-to-date in-memory state and takes precedence. @@ -316,11 +315,8 @@ export class GeminiChat { initialHistory = []; } - this.agentHistory = new AgentChatHistory(initialHistory); -======= this.initialMessages = messages; - this.agentHistory = new AgentChatHistory(history); ->>>>>>> a9648de39 (feat: foundation for subagent trajectories (Stage 1)) + this.agentHistory = new AgentChatHistory(initialHistory); this.chatRecordingService = new ChatRecordingService(context); this.lastPromptTokenCount = estimateTokenCountSync( this.agentHistory.flatMap((c) => c.content.parts || []), @@ -338,27 +334,26 @@ export class GeminiChat { ) { const messagesToUse = messages ?? this.initialMessages; await this.chatRecordingService.initialize(resumedSessionData, kind); -<<<<<<< HEAD + + if (messagesToUse) { + this.chatRecordingService.resetMessages(messagesToUse); + } + // Sync initial history with the recorder to ensure all turns (even bootstrapped ones) // are durable and coordinated. this.chatRecordingService.updateMessagesFromHistory( this.agentHistory.get(), ); -======= - if (messagesToUse) { - this.chatRecordingService.resetMessages(messagesToUse); - } ->>>>>>> a9648de39 (feat: foundation for subagent trajectories (Stage 1)) } setSystemInstruction(sysInstr: string) { this.systemInstruction = sysInstr; } -<<<<<<< HEAD getSystemInstruction(): string { return this.systemInstruction; -======= + } + getConversation(): ConversationRecord | null { return this.chatRecordingService.getConversation(); } @@ -369,7 +364,6 @@ export class GeminiChat { async getSubagentTrajectories(): Promise> { return this.chatRecordingService.getSubagentTrajectories(); ->>>>>>> a9648de39 (feat: foundation for subagent trajectories (Stage 1)) } /** diff --git a/packages/core/src/services/gitService.ts b/packages/core/src/services/gitService.ts index 8c075c6071..4a48a577b9 100644 --- a/packages/core/src/services/gitService.ts +++ b/packages/core/src/services/gitService.ts @@ -33,26 +33,13 @@ export const SHADOW_REPO_AUTHOR_EMAIL = 'gemini-cli@google.com'; */ const SHADOW_REPO_GIT_OPTIONS: Partial = { unsafe: { - allowUnsafeAlias: true, - allowUnsafeAskPass: true, - allowUnsafeConfigEnvCount: true, - allowUnsafeConfigPaths: true, - allowUnsafeCredentialHelper: true, allowUnsafeCustomBinary: true, - allowUnsafeDiffExternal: true, - allowUnsafeDiffTextConv: true, - allowUnsafeEditor: true, - allowUnsafeFilter: true, - allowUnsafeFsMonitor: true, - allowUnsafeGitProxy: true, - allowUnsafeGpgProgram: true, - allowUnsafeHooksPath: true, - allowUnsafeMergeDriver: true, - allowUnsafePack: true, - allowUnsafePager: true, allowUnsafeProtocolOverride: true, + allowUnsafePack: true, allowUnsafeSshCommand: true, - allowUnsafeTemplateDir: true, + allowUnsafeGitProxy: true, + allowUnsafeHooksPath: true, + allowUnsafeDiffExternal: true, }, };