Skip to content

Commit a032f5e

Browse files
su-fenclaude
andcommitted
fix(compaction): use medium reasoning for codex summarizer instead of minimal
GPT-5.6 generation models dropped the "minimal" reasoning effort (valid levels: low/medium/high/xhigh/max), and the pi-ai catalog does not declare minimal as null in thinkingLevelMap, so clampThinkingLevel passes it through and the OpenAI API rejects the compaction request with a 400, surfacing as "context compaction failed". Hardcode medium instead: supported by both old and new OpenAI models, still keeps long thinking from eating the summary budget. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 542dd26 commit a032f5e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

crates/agent-gui/src/lib/chat/compaction/summarizer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ function isTransientError(error: unknown) {
7171
}
7272

7373
function buildSummarizerRuntime(providerId: ProviderId, runtime: ProviderRuntimeConfig) {
74-
// Codex 用最低推理档做摘要,避免长思考挤占摘要预算。
75-
return providerId === "codex" ? { ...runtime, reasoning: "minimal" as const } : runtime;
74+
// Codex 用 medium 档做摘要,避免长思考挤占摘要预算;不能用 minimal——
75+
// GPT-5.6 世代已砍掉该档且 pi-ai 目录未标 null,clamp 不会兜底,API 会直接 400。
76+
return providerId === "codex" ? { ...runtime, reasoning: "medium" as const } : runtime;
7677
}
7778

7879
type SummarizerRequest = {

0 commit comments

Comments
 (0)