mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-13 21:32:56 -07:00
feat(cli): Partial threading of AgentLoopContext. (#22978)
This commit is contained in:
@@ -35,7 +35,7 @@ const getSavedChatTags = async (
|
||||
context: CommandContext,
|
||||
mtSortDesc: boolean,
|
||||
): Promise<ChatDetail[]> => {
|
||||
const cfg = context.services.config;
|
||||
const cfg = context.services.agentContext?.config;
|
||||
const geminiDir = cfg?.storage?.getProjectTempDir();
|
||||
if (!geminiDir) {
|
||||
return [];
|
||||
@@ -103,7 +103,8 @@ const saveCommand: SlashCommand = {
|
||||
};
|
||||
}
|
||||
|
||||
const { logger, config } = context.services;
|
||||
const { logger } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
await logger.initialize();
|
||||
|
||||
if (!context.overwriteConfirmed) {
|
||||
@@ -125,7 +126,7 @@ const saveCommand: SlashCommand = {
|
||||
}
|
||||
}
|
||||
|
||||
const chat = config?.getGeminiClient()?.getChat();
|
||||
const chat = context.services.agentContext?.geminiClient?.getChat();
|
||||
if (!chat) {
|
||||
return {
|
||||
type: 'message',
|
||||
@@ -172,7 +173,8 @@ const resumeCheckpointCommand: SlashCommand = {
|
||||
};
|
||||
}
|
||||
|
||||
const { logger, config } = context.services;
|
||||
const { logger } = context.services;
|
||||
const config = context.services.agentContext?.config;
|
||||
await logger.initialize();
|
||||
const checkpoint = await logger.loadCheckpoint(tag);
|
||||
const conversation = checkpoint.history;
|
||||
@@ -298,7 +300,7 @@ const shareCommand: SlashCommand = {
|
||||
};
|
||||
}
|
||||
|
||||
const chat = context.services.config?.getGeminiClient()?.getChat();
|
||||
const chat = context.services.agentContext?.geminiClient?.getChat();
|
||||
if (!chat) {
|
||||
return {
|
||||
type: 'message',
|
||||
@@ -344,7 +346,7 @@ export const debugCommand: SlashCommand = {
|
||||
kind: CommandKind.BUILT_IN,
|
||||
autoExecute: true,
|
||||
action: async (context): Promise<MessageActionReturn> => {
|
||||
const req = context.services.config?.getLatestApiRequest();
|
||||
const req = context.services.agentContext?.config.getLatestApiRequest();
|
||||
if (!req) {
|
||||
return {
|
||||
type: 'message',
|
||||
|
||||
Reference in New Issue
Block a user