Skip to content

Commit c8e6e81

Browse files
ralyodioclaude
andcommitted
fix(news): drop unsupported temperature from summarize (gpt-5.x 400)
The /news article summarize call sent temperature: 0.3, which gpt-5.x reasoning models reject ('Only the default (1) value is supported') -> 400. Remove it, same as the finance report fix. Update the test to assert no temperature is sent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 6f9f18c commit c8e6e81

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/app/api/news/summarize/route.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,12 +473,13 @@ describe('News Summarize API Route', () => {
473473
response_format: { type: 'json_object' },
474474
max_completion_tokens: 1500,
475475
reasoning_effort: 'high',
476-
temperature: 0.3,
477476
}),
478477
expect.objectContaining({
479478
timeout: 60000,
480479
})
481480
);
481+
// gpt-5.x reasoning models reject a custom temperature; we must not send one.
482+
expect(mockOpenAICreate.mock.calls[0][0]).not.toHaveProperty('temperature');
482483
});
483484

484485
it('should include article content in the prompt', async () => {

src/app/api/news/summarize/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ ${truncatedContent}`;
195195
response_format: { type: 'json_object' },
196196
max_completion_tokens: 1500,
197197
reasoning_effort: 'high',
198-
temperature: 0.3,
198+
// gpt-5.x reasoning models only support the default temperature (1);
199+
// passing a custom value returns a 400.
199200
},
200201
{
201202
timeout: 60000, // 60 second timeout

0 commit comments

Comments
 (0)