Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/core/lib/v3/llm/aisdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ export class AISdkClient extends LLMClient {
const isGPT5 = this.model.modelId.includes("gpt-5");
const isCodex = this.model.modelId.includes("codex");
const usesLowReasoningEffort =
(this.model.modelId.includes("gpt-5.1") ||
this.model.modelId.includes("gpt-5.2")) &&
!isCodex;
this.model.modelId.includes("gpt-5.") && !isCodex;
// Kimi models only support temperature=1
Comment on lines 137 to 139
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Unversioned gpt-5 alias falls through to "minimal"

The "gpt-5." substring check (with trailing dot) correctly captures all gpt-5.x versioned models (e.g. gpt-5.1, gpt-5.4). However, if OpenAI publishes an unversioned gpt-5 alias (without a decimal, similar to how gpt-4 exists alongside gpt-4.x), it would match isGPT5 but not usesLowReasoningEffort, causing it to fall through to "minimal" reasoning effort — the exact error this PR is trying to prevent.

Since the PR description states "All GPT-5.x series models don't support minimal", consider widening the guard to also cover a bare gpt-5 model:

Suggested change
const usesLowReasoningEffort =
(this.model.modelId.includes("gpt-5.1") ||
this.model.modelId.includes("gpt-5.2")) &&
!isCodex;
this.model.modelId.includes("gpt-5.") && !isCodex;
// Kimi models only support temperature=1
const usesLowReasoningEffort =
(this.model.modelId.includes("gpt-5.") ||
this.model.modelId === "gpt-5") &&
!isCodex;

const isKimi = this.model.modelId.includes("kimi");
const temperature = isKimi ? 1 : options.temperature;
Expand Down
Loading