feat(core): Migrate generateJson to resolved model configs. (#12626)

This commit is contained in:
joshualitt
2025-11-07 14:18:45 -08:00
committed by GitHub
parent f3a8b73717
commit fdb6088603
16 changed files with 175 additions and 118 deletions
@@ -735,6 +735,12 @@ describe('LoopDetectionService LLM Checks', () => {
getBaseLlmClient: () => mockBaseLlmClient,
getDebugMode: () => false,
getTelemetryEnabled: () => true,
modelConfigService: {
getResolvedConfig: vi.fn().mockReturnValue({
model: 'cognitive-loop-v1',
generateContentConfig: {},
}),
},
} as unknown as Config;
service = new LoopDetectionService(mockConfig);
@@ -765,9 +771,9 @@ describe('LoopDetectionService LLM Checks', () => {
expect(mockBaseLlmClient.generateJson).toHaveBeenCalledTimes(1);
expect(mockBaseLlmClient.generateJson).toHaveBeenCalledWith(
expect.objectContaining({
modelConfigKey: expect.any(Object),
systemInstruction: expect.any(String),
contents: expect.any(Array),
model: expect.any(String),
schema: expect.any(Object),
promptId: expect.any(String),
}),