mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 18:44:30 -07:00
feat(cli): Partial threading of AgentLoopContext. (#22978)
This commit is contained in:
@@ -37,8 +37,11 @@ describe('modelCommand', () => {
|
||||
}
|
||||
|
||||
const mockRefreshUserQuota = vi.fn();
|
||||
mockContext.services.config = {
|
||||
mockContext.services.agentContext = {
|
||||
refreshUserQuota: mockRefreshUserQuota,
|
||||
get config() {
|
||||
return this;
|
||||
},
|
||||
} as unknown as Config;
|
||||
|
||||
await modelCommand.action(mockContext, '');
|
||||
@@ -66,8 +69,11 @@ describe('modelCommand', () => {
|
||||
(c) => c.name === 'manage',
|
||||
);
|
||||
const mockRefreshUserQuota = vi.fn();
|
||||
mockContext.services.config = {
|
||||
mockContext.services.agentContext = {
|
||||
refreshUserQuota: mockRefreshUserQuota,
|
||||
get config() {
|
||||
return this;
|
||||
},
|
||||
} as unknown as Config;
|
||||
|
||||
await manageCommand!.action!(mockContext, '');
|
||||
@@ -84,7 +90,7 @@ describe('modelCommand', () => {
|
||||
expect(setCommand).toBeDefined();
|
||||
|
||||
const mockSetModel = vi.fn();
|
||||
mockContext.services.config = {
|
||||
mockContext.services.agentContext = {
|
||||
setModel: mockSetModel,
|
||||
getHasAccessToPreviewModel: vi.fn().mockReturnValue(true),
|
||||
getUserId: vi.fn().mockReturnValue('test-user'),
|
||||
@@ -98,6 +104,9 @@ describe('modelCommand', () => {
|
||||
getPolicyEngine: vi.fn().mockReturnValue({
|
||||
getApprovalMode: vi.fn().mockReturnValue('auto'),
|
||||
}),
|
||||
get config() {
|
||||
return this;
|
||||
},
|
||||
} as unknown as Config;
|
||||
|
||||
await setCommand!.action!(mockContext, 'gemini-pro');
|
||||
@@ -116,7 +125,7 @@ describe('modelCommand', () => {
|
||||
(c) => c.name === 'set',
|
||||
);
|
||||
const mockSetModel = vi.fn();
|
||||
mockContext.services.config = {
|
||||
mockContext.services.agentContext = {
|
||||
setModel: mockSetModel,
|
||||
getHasAccessToPreviewModel: vi.fn().mockReturnValue(true),
|
||||
getUserId: vi.fn().mockReturnValue('test-user'),
|
||||
@@ -130,6 +139,9 @@ describe('modelCommand', () => {
|
||||
getPolicyEngine: vi.fn().mockReturnValue({
|
||||
getApprovalMode: vi.fn().mockReturnValue('auto'),
|
||||
}),
|
||||
get config() {
|
||||
return this;
|
||||
},
|
||||
} as unknown as Config;
|
||||
|
||||
await setCommand!.action!(mockContext, 'gemini-pro --persist');
|
||||
|
||||
Reference in New Issue
Block a user