feat(core): wire up the new ContextManager and AgentChatHistory (#25409)

This commit is contained in:
joshualitt
2026-04-27 11:50:00 -07:00
committed by GitHub
parent 98aca28985
commit 71f313b51a
35 changed files with 707 additions and 377 deletions
@@ -145,8 +145,8 @@ export function createMockEnvironment(
});
const eventBus = new ContextEventBus();
const env = new ContextEnvironmentImpl(
llmClient,
let env = new ContextEnvironmentImpl(
() => llmClient as BaseLlmClient,
'mock-session',
'mock-prompt-id',
'/tmp/.gemini/trace',
@@ -157,7 +157,20 @@ export function createMockEnvironment(
);
if (overrides) {
Object.assign(env, overrides);
if (overrides.llmClient) {
env = new ContextEnvironmentImpl(
() => overrides.llmClient!,
env.sessionId,
env.promptId,
env.traceDir,
env.projectTempDir,
env.tracer,
env.charsPerToken,
env.eventBus,
);
}
const { llmClient: _llmClient, ...restOverrides } = overrides;
Object.assign(env, restOverrides);
}
return env;
}
@@ -247,7 +260,7 @@ export function setupContextComponentTest(
});
const eventBus = new ContextEventBus();
const env = new ContextEnvironmentImpl(
config.getBaseLlmClient(),
() => config.getBaseLlmClient(),
'test prompt-id',
'test-session',
'/tmp',