feat(cli): Partial threading of AgentLoopContext. (#22978)

This commit is contained in:
joshualitt
2026-03-19 09:02:13 -07:00
committed by GitHub
parent 5acaacad96
commit 39d3b0e28c
68 changed files with 608 additions and 421 deletions
+8 -6
View File
@@ -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',