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
@@ -102,10 +102,12 @@ describe('memoryCommand', () => {
mockContext = createMockCommandContext({
services: {
config: {
getUserMemory: mockGetUserMemory,
getGeminiMdFileCount: mockGetGeminiMdFileCount,
getExtensionLoader: () => new SimpleExtensionLoader([]),
agentContext: {
config: {
getUserMemory: mockGetUserMemory,
getGeminiMdFileCount: mockGetGeminiMdFileCount,
getExtensionLoader: () => new SimpleExtensionLoader([]),
},
},
},
});
@@ -250,7 +252,7 @@ describe('memoryCommand', () => {
mockContext = createMockCommandContext({
services: {
config: mockConfig,
agentContext: { config: mockConfig },
settings: {
merged: {
memoryDiscoveryMaxDirs: 1000,
@@ -268,7 +270,7 @@ describe('memoryCommand', () => {
if (!reloadCommand.action) throw new Error('Command has no action');
// Enable JIT in mock config
const config = mockContext.services.config;
const config = mockContext.services.agentContext?.config;
if (!config) throw new Error('Config is undefined');
vi.mocked(config.isJitContextEnabled).mockReturnValue(true);
@@ -370,7 +372,7 @@ describe('memoryCommand', () => {
if (!reloadCommand.action) throw new Error('Command has no action');
const nullConfigContext = createMockCommandContext({
services: { config: null },
services: { agentContext: null },
});
await expect(
@@ -413,8 +415,10 @@ describe('memoryCommand', () => {
});
mockContext = createMockCommandContext({
services: {
config: {
getGeminiMdFilePaths: mockGetGeminiMdfilePaths,
agentContext: {
config: {
getGeminiMdFilePaths: mockGetGeminiMdfilePaths,
},
},
},
});