feat(codex-local): add fast mode support

This commit is contained in:
Dotta
2026-04-11 07:36:42 -05:00
parent 03a2cf5c8a
commit 2d8f97feb0
12 changed files with 246 additions and 56 deletions
@@ -0,0 +1,54 @@
import { describe, expect, it } from "vitest";
import { buildCodexLocalConfig } from "./build-config.js";
import type { CreateConfigValues } from "@paperclipai/adapter-utils";
function makeValues(overrides: Partial<CreateConfigValues> = {}): CreateConfigValues {
return {
adapterType: "codex_local",
cwd: "",
instructionsFilePath: "",
promptTemplate: "",
model: "gpt-5.4",
thinkingEffort: "",
chrome: false,
dangerouslySkipPermissions: true,
search: false,
fastMode: false,
dangerouslyBypassSandbox: true,
command: "",
args: "",
extraArgs: "",
envVars: "",
envBindings: {},
url: "",
bootstrapPrompt: "",
payloadTemplateJson: "",
workspaceStrategyType: "project_primary",
workspaceBaseRef: "",
workspaceBranchTemplate: "",
worktreeParentDir: "",
runtimeServicesJson: "",
maxTurnsPerRun: 1000,
heartbeatEnabled: false,
intervalSec: 300,
...overrides,
};
}
describe("buildCodexLocalConfig", () => {
it("persists the fastMode toggle into adapter config", () => {
const config = buildCodexLocalConfig(
makeValues({
search: true,
fastMode: true,
}),
);
expect(config).toMatchObject({
model: "gpt-5.4",
search: true,
fastMode: true,
dangerouslyBypassApprovalsAndSandbox: true,
});
});
});
@@ -85,6 +85,7 @@ export function buildCodexLocalConfig(v: CreateConfigValues): Record<string, unk
}
if (Object.keys(env).length > 0) ac.env = env;
ac.search = v.search;
ac.fastMode = v.fastMode;
ac.dangerouslyBypassApprovalsAndSandbox =
typeof v.dangerouslyBypassSandbox === "boolean"
? v.dangerouslyBypassSandbox