forked from farhoodlabs/paperclip
feat(codex-local): add fast mode support
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user