feat: add Claude Opus 4.7 to built-in models (#2072)

Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
Ibrahim ElkamaliandJulius Marminge authored and GitHub committed 2026-04-16 11:11:59 -07:00
1 parent d22c6f5280
commit 3e07f5a6a4
14 files changed
+520 -173

No files matched your search

+2 -2
View File
@@ -1,7 +1,7 @@
import {
type ApprovalRequestId,
DEFAULT_MODEL_BY_PROVIDER,
type ClaudeCodeEffort,
type ClaudeAgentEffort,
type EnvironmentId,
type MessageId,
type ModelSelection,
@@ -303,7 +303,7 @@ function formatOutgoingPrompt(params: {
}): string {
const caps = getProviderModelCapabilities(params.models, params.model, params.provider);
if (params.effort && caps.promptInjectedEffortLevels.includes(params.effort)) {
return applyClaudePromptEffortPrefix(params.text, params.effort as ClaudeCodeEffort | null);
return applyClaudePromptEffortPrefix(params.text, params.effort as ClaudeAgentEffort | null);
}
return params.text;
}
+12 -24
View File
@@ -1,7 +1,6 @@
import {
CODEX_REASONING_EFFORT_OPTIONS,
type ClaudeCodeEffort,
type CodexReasoningEffort,
ClaudeAgentEffort,
CodexReasoningEffort,
DEFAULT_MODEL_BY_PROVIDER,
type EnvironmentId,
ModelSelection,
@@ -105,7 +104,7 @@ const PersistedComposerThreadDraftState = Schema.Struct({
type PersistedComposerThreadDraftState = typeof PersistedComposerThreadDraftState.Type;
const LegacyCodexFields = Schema.Struct({
effort: Schema.optionalKey(Schema.Literals(CODEX_REASONING_EFFORT_OPTIONS)),
effort: Schema.optionalKey(CodexReasoningEffort),
codexFastMode: Schema.optionalKey(Schema.Boolean),
serviceTier: Schema.optionalKey(Schema.String),
});
@@ -546,19 +545,13 @@ function normalizeProviderModelOptions(
? (candidate.claudeAgent as Record<string, unknown>)
: null;
const codexReasoningEffort: CodexReasoningEffort | undefined =
codexCandidate?.reasoningEffort === "low" ||
codexCandidate?.reasoningEffort === "medium" ||
codexCandidate?.reasoningEffort === "high" ||
codexCandidate?.reasoningEffort === "xhigh"
? codexCandidate.reasoningEffort
: provider === "codex" &&
(legacy?.effort === "low" ||
legacy?.effort === "medium" ||
legacy?.effort === "high" ||
legacy?.effort === "xhigh")
const codexReasoningEffort = Schema.is(CodexReasoningEffort)(codexCandidate?.reasoningEffort)
? codexCandidate.reasoningEffort
: provider === "codex"
? Schema.is(CodexReasoningEffort)(legacy?.effort)
? legacy.effort
: undefined;
: undefined
: undefined;
const codexFastMode =
codexCandidate?.fastMode === true
? true
@@ -582,14 +575,9 @@ function normalizeProviderModelOptions(
: claudeCandidate?.thinking === false
? false
: undefined;
const claudeEffort: ClaudeCodeEffort | undefined =
claudeCandidate?.effort === "low" ||
claudeCandidate?.effort === "medium" ||
claudeCandidate?.effort === "high" ||
claudeCandidate?.effort === "max" ||
claudeCandidate?.effort === "ultrathink"
? claudeCandidate.effort
: undefined;
const claudeEffort = Schema.is(ClaudeAgentEffort)(claudeCandidate?.effort)
? claudeCandidate.effort
: undefined;
const claudeFastMode =
claudeCandidate?.fastMode === true
? true