diff --git a/packages/core/src/core/geminiChat.ts b/packages/core/src/core/geminiChat.ts index bdfa5d2b3a..2c0561b7b9 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)) } /** @@ -777,7 +771,7 @@ export class GeminiChat { } throw new AgentExecutionBlockedError( - beforeModelResult.reason || 'Model call blocked by hook', + beforeModelResult.reason || 'Agent execution blocked by hook', syntheticResponse, ); } 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, }, };