upgrade Claude to Opus 4.6 with effort levels (#256)
* upgrade Claude to Opus 4.6 with --effort max for --max mode - mini: haiku → sonnet - auto: opusplan → opus (Opus 4.6) - max: opus → opus + --effort max (Opus 4.6 max effort) - bump @anthropic-ai/claude-agent-sdk 0.2.7 → 0.2.39 Co-authored-by: Cursor <cursoragent@cursor.com> * update action lockfile for claude-agent-sdk 0.2.39 Co-authored-by: Cursor <cursoragent@cursor.com> * add tool_use_summary handler for SDK 0.2.39 Co-authored-by: Cursor <cursoragent@cursor.com> * integrate gpt-5.3-codex with runtime model availability detection checks GET /v1/models at agent start to determine if gpt-5.3-codex is available for the API key, falling back to gpt-5.2-codex when it isn't. model resolution runs concurrently with CLI install for zero added latency. also bumps @openai/codex-sdk from 0.80.0 to 0.98.0. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
pullfrog[bot]
parent
19df8372cd
commit
f37d02b292
@@ -144125,13 +144125,13 @@ var package_default = {
|
||||
},
|
||||
dependencies: {
|
||||
"@actions/core": "^1.11.1",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.2.7",
|
||||
"@anthropic-ai/claude-agent-sdk": "0.2.39",
|
||||
"@ark/fs": "0.53.0",
|
||||
"@ark/util": "0.53.0",
|
||||
"@octokit/plugin-throttling": "^11.0.3",
|
||||
"@octokit/rest": "^22.0.0",
|
||||
"@octokit/webhooks-types": "^7.6.1",
|
||||
"@openai/codex-sdk": "0.80.0",
|
||||
"@openai/codex-sdk": "0.98.0",
|
||||
"@opencode-ai/sdk": "^1.0.143",
|
||||
"@standard-schema/spec": "1.0.0",
|
||||
"@toon-format/toon": "^1.0.0",
|
||||
@@ -144442,10 +144442,15 @@ ${ctx.instructions.user}` : null,
|
||||
|
||||
// agents/claude.ts
|
||||
var claudeEffortModels = {
|
||||
mini: "haiku",
|
||||
auto: "opusplan",
|
||||
mini: "sonnet",
|
||||
auto: "opus",
|
||||
max: "opus"
|
||||
};
|
||||
var claudeEffortLevels = {
|
||||
mini: null,
|
||||
auto: null,
|
||||
max: "max"
|
||||
};
|
||||
function buildDisallowedTools(ctx) {
|
||||
const disallowed = [];
|
||||
if (ctx.payload.web === "disabled") disallowed.push("WebFetch");
|
||||
@@ -144483,7 +144488,8 @@ var claude = agent({
|
||||
run: async (ctx) => {
|
||||
const cliPath = await installClaude();
|
||||
const model = claudeEffortModels[ctx.payload.effort];
|
||||
log.info(`\xBB using model: ${model} (effort: ${ctx.payload.effort})`);
|
||||
const effortLevel = claudeEffortLevels[ctx.payload.effort];
|
||||
log.info(`\xBB using model: ${model}${effortLevel ? ` (effort: ${effortLevel})` : ""}`);
|
||||
const disallowedTools = buildDisallowedTools(ctx);
|
||||
if (disallowedTools.length > 0) {
|
||||
log.info(`\xBB disallowed tools: ${disallowedTools.join(", ")}`);
|
||||
@@ -144502,6 +144508,9 @@ var claude = agent({
|
||||
"stream-json",
|
||||
"--verbose"
|
||||
];
|
||||
if (effortLevel) {
|
||||
args3.push("--effort", effortLevel);
|
||||
}
|
||||
if (disallowedTools.length > 0) {
|
||||
args3.push("--disallowedTools");
|
||||
args3.push(...disallowedTools);
|
||||
@@ -144646,6 +144655,8 @@ var messageHandlers = {
|
||||
},
|
||||
tool_progress: () => {
|
||||
},
|
||||
tool_use_summary: () => {
|
||||
},
|
||||
auth_status: () => {
|
||||
}
|
||||
};
|
||||
@@ -144653,11 +144664,43 @@ var messageHandlers = {
|
||||
// agents/codex.ts
|
||||
import { mkdirSync as mkdirSync4, writeFileSync as writeFileSync8 } from "node:fs";
|
||||
import { join as join10 } from "node:path";
|
||||
var codexEffortConfig = {
|
||||
mini: { model: "gpt-5.1-codex-mini", reasoningEffort: "low" },
|
||||
auto: { model: "gpt-5.2-codex" },
|
||||
max: { model: "gpt-5.2-codex", reasoningEffort: "high" }
|
||||
};
|
||||
var PREFERRED_MODEL = "gpt-5.3-codex";
|
||||
var FALLBACK_MODEL = "gpt-5.2-codex";
|
||||
function getCodexEffortConfig(model) {
|
||||
return {
|
||||
mini: { model: "gpt-5.1-codex-mini", reasoningEffort: "low" },
|
||||
auto: { model },
|
||||
max: { model, reasoningEffort: "high" }
|
||||
};
|
||||
}
|
||||
async function isModelAvailable(ctx) {
|
||||
try {
|
||||
const response = await fetch("https://api.openai.com/v1/models", {
|
||||
headers: { Authorization: `Bearer ${ctx.apiKey}` },
|
||||
signal: AbortSignal.timeout(1e4)
|
||||
});
|
||||
if (!response.ok) {
|
||||
log.warning(
|
||||
`failed to list models (HTTP ${response.status}), falling back to ${FALLBACK_MODEL}`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
const body = await response.json();
|
||||
return body.data.some((m) => m.id === ctx.model);
|
||||
} catch (err) {
|
||||
log.warning(`failed to list models: ${err}, falling back to ${FALLBACK_MODEL}`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async function resolveModel(apiKey) {
|
||||
const available = await isModelAvailable({ apiKey, model: PREFERRED_MODEL });
|
||||
if (available) {
|
||||
log.info(`\xBB ${PREFERRED_MODEL} is available for this API key`);
|
||||
return PREFERRED_MODEL;
|
||||
}
|
||||
log.info(`\xBB ${PREFERRED_MODEL} not available, using ${FALLBACK_MODEL}`);
|
||||
return FALLBACK_MODEL;
|
||||
}
|
||||
function writeCodexConfig(ctx) {
|
||||
const codexDir = join10(ctx.tmpdir, ".codex");
|
||||
mkdirSync4(codexDir, { recursive: true });
|
||||
@@ -144709,9 +144752,9 @@ var codex = agent({
|
||||
if (!apiKey) {
|
||||
throw new Error("OPENAI_API_KEY is required for codex agent");
|
||||
}
|
||||
const cliPath = await installCodex();
|
||||
const [cliPath, model] = await Promise.all([installCodex(), resolveModel(apiKey)]);
|
||||
const codexDir = writeCodexConfig(ctx);
|
||||
const effortConfig = codexEffortConfig[ctx.payload.effort];
|
||||
const effortConfig = getCodexEffortConfig(model)[ctx.payload.effort];
|
||||
log.info(`\xBB using model: ${effortConfig.model} (effort: ${ctx.payload.effort})`);
|
||||
if (effortConfig.reasoningEffort) {
|
||||
log.info(`\xBB using modelReasoningEffort: ${effortConfig.reasoningEffort}`);
|
||||
|
||||
Reference in New Issue
Block a user