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
@@ -37,10 +37,11 @@ async function restoreAction(
args: string,
): Promise<void | SlashCommandActionReturn> {
const { services, ui } = context;
const { config, git: gitService } = services;
const { agentContext, git: gitService } = services;
const { addItem, loadHistory } = ui;
const checkpointDir = config?.storage.getProjectTempCheckpointsDir();
const checkpointDir =
agentContext?.config.storage.getProjectTempCheckpointsDir();
if (!checkpointDir) {
return {
@@ -116,7 +117,7 @@ async function restoreAction(
} else if (action.type === 'load_history' && loadHistory) {
loadHistory(action.history);
if (action.clientHistory) {
config?.getGeminiClient()?.setHistory(action.clientHistory);
agentContext!.geminiClient?.setHistory(action.clientHistory);
}
}
}
@@ -140,8 +141,9 @@ async function completion(
_partialArg: string,
): Promise<string[]> {
const { services } = context;
const { config } = services;
const checkpointDir = config?.storage.getProjectTempCheckpointsDir();
const { agentContext } = services;
const checkpointDir =
agentContext?.config.storage.getProjectTempCheckpointsDir();
if (!checkpointDir) {
return [];
}