perf: request low reasoning effort for OpenAI agents

This commit is contained in:
2026-10-20 10:17:40 +09:00
parent d0f2779471
commit ea6ff6997f
3 changed files with 30 additions and 1 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ describe('managed A-Copilot backend', () => {
await provider.complete({ provider: 'A_COPILOT', model: 'ignored', apiKey: 'ignored', endpointUrl: 'https://untrusted.test', system: 'agent instructions', json: true, messages: [{ role: 'user', content: 'test' }] });
expect(fetchMock.mock.calls[0][0]).toBe('https://api.openai.com/v1/chat/completions');
expect(fetchMock.mock.calls[0][1].headers.Authorization).toBe('Bearer shared-openai-key');
expect(JSON.parse(fetchMock.mock.calls[0][1].body)).toMatchObject({ model: 'gpt-6-astra', response_format: { type: 'json_object' }, messages: [{ role: 'system', content: 'agent instructions' }, { role: 'user', content: 'test' }] });
expect(JSON.parse(fetchMock.mock.calls[0][1].body)).toMatchObject({ model: 'gpt-6-astra', reasoning_effort: 'low', response_format: { type: 'json_object' }, messages: [{ role: 'system', content: 'agent instructions' }, { role: 'user', content: 'test' }] });
});
it('never falls back to a different server provider when its configured key is missing', async () => {