fix(codex): default workers to fast service tier
This commit is contained in:
parent
e74500fcab
commit
90f3864656
@ -22,6 +22,7 @@ const fixTimeoutReserveMs = Number(process.env.CLOWNFISH_FIX_TIMEOUT_RESERVE_MS
|
||||
const codexTimeoutMs = Math.min(requestedCodexTimeoutMs, Math.max(60 * 1000, fixStepTimeoutMs - fixTimeoutReserveMs));
|
||||
const codexPreflightTimeoutMs = Number(process.env.CLOWNFISH_FIX_PREFLIGHT_TIMEOUT_MS ?? 2 * 60 * 1000);
|
||||
const codexReasoningEffort = String(process.env.CLOWNFISH_CODEX_REASONING_EFFORT ?? "medium");
|
||||
const codexServiceTier = String(process.env.CLOWNFISH_CODEX_SERVICE_TIER ?? "fast").trim();
|
||||
const maxEditAttempts = Math.max(1, Number(process.env.CLOWNFISH_FIX_EDIT_ATTEMPTS ?? 3));
|
||||
const maxReviewAttempts = Math.max(1, Number(process.env.CLOWNFISH_CODEX_REVIEW_ATTEMPTS ?? 2));
|
||||
const maxRebaseAttempts = Math.max(4, Number(process.env.CLOWNFISH_REBASE_REPAIR_ATTEMPTS ?? 4));
|
||||
@ -553,10 +554,7 @@ function editValidatePrepareMerge({
|
||||
"--sandbox",
|
||||
codexWriteSandbox,
|
||||
...codexWriteSandboxConfigArgs(),
|
||||
"-c",
|
||||
'approval_policy="never"',
|
||||
"-c",
|
||||
`model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`,
|
||||
...codexConfigArgs(),
|
||||
"--output-last-message",
|
||||
summaryPath,
|
||||
"--ephemeral",
|
||||
@ -858,10 +856,7 @@ function runCodexWritePreflight() {
|
||||
"--sandbox",
|
||||
codexWriteSandbox,
|
||||
...codexWriteSandboxConfigArgs(),
|
||||
"-c",
|
||||
'approval_policy="never"',
|
||||
"-c",
|
||||
`model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`,
|
||||
...codexConfigArgs(),
|
||||
"--output-last-message",
|
||||
summaryPath,
|
||||
"--ephemeral",
|
||||
@ -936,6 +931,12 @@ function codexReviewSandboxConfigArgs() {
|
||||
return codexWorkspaceSandboxConfigArgs(codexReviewSandbox, codexReviewNetworkAccess);
|
||||
}
|
||||
|
||||
function codexConfigArgs() {
|
||||
const configs = ['approval_policy="never"', `model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`];
|
||||
if (codexServiceTier) configs.push(`service_tier=${JSON.stringify(codexServiceTier)}`);
|
||||
return configs.flatMap((config) => ["-c", config]);
|
||||
}
|
||||
|
||||
function codexWorkspaceSandboxConfigArgs(sandbox, networkAccess) {
|
||||
if (sandbox !== "workspace-write") return [];
|
||||
return ["-c", `sandbox_workspace_write.network_access=${networkAccess ? "true" : "false"}`];
|
||||
@ -1014,10 +1015,7 @@ function runCodexReview({ fixArtifact, targetDir, mode, attempt, baseBranch = DE
|
||||
"--sandbox",
|
||||
codexReviewSandbox,
|
||||
...codexReviewSandboxConfigArgs(),
|
||||
"-c",
|
||||
'approval_policy="never"',
|
||||
"-c",
|
||||
`model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`,
|
||||
...codexConfigArgs(),
|
||||
"--output-schema",
|
||||
schemaPath,
|
||||
"--output-last-message",
|
||||
@ -1124,10 +1122,7 @@ function runCodexReviewFix({ fixArtifact, targetDir, mode, review, attempt }) {
|
||||
"--sandbox",
|
||||
codexWriteSandbox,
|
||||
...codexWriteSandboxConfigArgs(),
|
||||
"-c",
|
||||
'approval_policy="never"',
|
||||
"-c",
|
||||
`model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`,
|
||||
...codexConfigArgs(),
|
||||
"--output-last-message",
|
||||
path.join(workRoot, `${mode}-codex-review-fix-${attempt}.md`),
|
||||
"--ephemeral",
|
||||
@ -1845,10 +1840,7 @@ function resolveRecoverableRebaseConflicts({ targetDir, branch, baseRef, fixArti
|
||||
"--sandbox",
|
||||
codexWriteSandbox,
|
||||
...codexWriteSandboxConfigArgs(),
|
||||
"-c",
|
||||
'approval_policy="never"',
|
||||
"-c",
|
||||
`model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`,
|
||||
...codexConfigArgs(),
|
||||
"--output-last-message",
|
||||
summaryPath,
|
||||
"--ephemeral",
|
||||
|
||||
@ -21,6 +21,7 @@ const codexTimeoutMs = Number(process.env.CLOWNFISH_CODEX_TIMEOUT_MS ?? 30 * 60
|
||||
const resultRepairAttempts = Math.max(0, Number(process.env.CLOWNFISH_RESULT_REPAIR_ATTEMPTS ?? 1));
|
||||
const resultRepairTimeoutMs = Number(process.env.CLOWNFISH_RESULT_REPAIR_TIMEOUT_MS ?? 10 * 60 * 1000);
|
||||
const codexReasoningEffort = String(process.env.CLOWNFISH_CODEX_REASONING_EFFORT ?? "medium");
|
||||
const codexServiceTier = String(process.env.CLOWNFISH_CODEX_SERVICE_TIER ?? "fast").trim();
|
||||
|
||||
if (!jobPath) {
|
||||
console.error("usage: node scripts/run-worker.mjs <job.md> --mode plan|execute|autonomous [--dry-run]");
|
||||
@ -136,10 +137,7 @@ function runCodex({ input, outputPath, transcriptPath: codexTranscriptPath, stde
|
||||
model,
|
||||
"--sandbox",
|
||||
"read-only",
|
||||
"-c",
|
||||
'approval_policy="never"',
|
||||
"-c",
|
||||
`model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`,
|
||||
...codexConfigArgs(),
|
||||
"--output-schema",
|
||||
path.join(repoRoot(), "schemas", "codex-result.schema.json"),
|
||||
"--output-last-message",
|
||||
@ -162,6 +160,12 @@ function runCodex({ input, outputPath, transcriptPath: codexTranscriptPath, stde
|
||||
return child;
|
||||
}
|
||||
|
||||
function codexConfigArgs() {
|
||||
const configs = ['approval_policy="never"', `model_reasoning_effort=${JSON.stringify(codexReasoningEffort)}`];
|
||||
if (codexServiceTier) configs.push(`service_tier=${JSON.stringify(codexServiceTier)}`);
|
||||
return configs.flatMap((config) => ["-c", config]);
|
||||
}
|
||||
|
||||
function repairResultIfNeeded() {
|
||||
for (let attempt = 1; attempt <= resultRepairAttempts; attempt += 1) {
|
||||
const review = reviewResult();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user