Fix: Respect reasoning.exclude for OpenRouter

This commit is contained in:
2025-09-13 00:04:58 -07:00
parent 3378815f8c
commit 9a081efe97

View File

@@ -303,7 +303,7 @@ export class MyDurableObject {
for await (const chunk of stream) {
if (this.phase !== 'running') break;
const delta = chunk?.choices?.[0]?.delta;
if (delta?.reasoning) this.queueDelta(delta.reasoning);
if (delta?.reasoning && body.reasoning?.exclude !== true) this.queueDelta(delta.reasoning);
if (delta?.content) this.queueDelta(delta.content);
}
}