Skip to content

Commit 9d154de

Browse files
committed
docs(openai): clarify non-streaming path comment and rationale for system role; align with review suggestions
1 parent 7bfafe3 commit 9d154de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/api/providers/openai.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,14 @@ export class OpenAiHandler extends BaseProvider implements SingleCompletionHandl
218218
yield this.processUsageMetrics(lastUsage, modelInfo)
219219
}
220220
} else {
221-
// o1 for instance doesnt support streaming, non-1 temp, or system prompt
221+
// Note: o1/o3/o4 models do not support streaming, non-1 temperature, or system prompts.
222+
// This non-streaming branch is for general OpenAI-compatible providers that DO support system prompts.
223+
// The o1/o3/o4 family is handled above in handleO3FamilyMessage(), so we still use a proper "system" role
224+
// here for consistency with streaming behavior and provider expectations.
222225
const systemMessage: OpenAI.Chat.ChatCompletionSystemMessageParam = {
223226
role: "system",
227+
// Use "system" to match streaming behavior; many OpenAI-compatible providers treat system prompts specially
228+
// (e.g., safety, formatting, or caching), and tests assert consistency across modes.
224229
content: systemPrompt,
225230
}
226231

0 commit comments

Comments
 (0)