Spaces:
Paused
Paused
icebear0828 Claude Opus 4.6 commited on
Commit ·
be3ca8e
1
Parent(s): 6c4df8c
fix: support thinking.type "adaptive" for latest Claude Code
Browse filesClaude Code now sends thinking.type: "adaptive" (with optional
budget_tokens) instead of always "enabled"/"disabled". Added the
new variant to the Zod schema and translation logic.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Files changed (2)
18 unmodified lines19202122232418 unmodified linesthinking: AnthropicMessagesRequest["thinking"],): string | undefined {if (!thinking || thinking.type === "disabled") return undefined;return budgetToEffort(thinking.budget_tokens);}18 unmodified lines1920212223242526272818 unmodified linesthinking: AnthropicMessagesRequest["thinking"],): string | undefined {if (!thinking || thinking.type === "disabled") return undefined;if (thinking.type === "adaptive") {// adaptive: use budget_tokens if provided, otherwise let Codex decidereturn thinking.budget_tokens ? budgetToEffort(thinking.budget_tokens) : undefined;}return budgetToEffort(thinking.budget_tokens);}
58 unmodified lines59606162636412 unmodified lines7778798081828358 unmodified linestype: z.literal("disabled"),});export const AnthropicMessagesRequestSchema = z.object({model: z.string(),max_tokens: z.number().int().positive(),12 unmodified lines}).optional(),thinking: z.union([AnthropicThinkingEnabledSchema, AnthropicThinkingDisabledSchema]).optional(),// Tool-related fields (accepted for compatibility, not forwarded to Codex)tools: z.array(z.object({58 unmodified lines596061626364656667686912 unmodified lines828384858687888990919258 unmodified linestype: z.literal("disabled"),});const AnthropicThinkingAdaptiveSchema = z.object({type: z.literal("adaptive"),budget_tokens: z.number().int().positive().optional(),});export const AnthropicMessagesRequestSchema = z.object({model: z.string(),max_tokens: z.number().int().positive(),12 unmodified lines}).optional(),thinking: z.union([AnthropicThinkingEnabledSchema,AnthropicThinkingDisabledSchema,AnthropicThinkingAdaptiveSchema,]).optional(),// Tool-related fields (accepted for compatibility, not forwarded to Codex)tools: z.array(z.object({
src/translation/anthropic-to-codex.ts+4
src/types/anthropic.ts+10-1