Merge pull request #3383 from paperclipai/pap-1347-codex-fast-mode

feat(codex-local): add fast mode support
This commit is contained in:
Dotta
2026-04-11 08:45:50 -05:00
committed by GitHub
12 changed files with 250 additions and 56 deletions

View File

@@ -7,6 +7,10 @@ import {
} from "../../components/agent-config-primitives";
import { ChoosePathButton } from "../../components/PathInstructionsModal";
import { LocalWorkspaceRuntimeFields } from "../local-workspace-runtime-fields";
import {
CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS,
isCodexLocalFastModeSupported,
} from "@paperclipai/adapter-codex-local";
const inputClass =
"w-full rounded-md border border-border px-2.5 py-1.5 bg-transparent outline-none text-sm font-mono placeholder:text-muted-foreground/40";
@@ -27,6 +31,14 @@ export function CodexLocalConfigFields({
}: AdapterConfigFieldsProps) {
const bypassEnabled =
config.dangerouslyBypassApprovalsAndSandbox === true || config.dangerouslyBypassSandbox === true;
const fastModeEnabled = isCreate
? Boolean(values!.fastMode)
: eff("adapterConfig", "fastMode", Boolean(config.fastMode));
const currentModel = isCreate
? String(values!.model ?? "")
: eff("adapterConfig", "model", String(config.model ?? ""));
const fastModeSupported = isCodexLocalFastModeSupported(currentModel);
const supportedModelsLabel = CODEX_LOCAL_FAST_MODE_SUPPORTED_MODELS.join(", ");
return (
<>
@@ -88,6 +100,23 @@ export function CodexLocalConfigFields({
: mark("adapterConfig", "search", v)
}
/>
<ToggleField
label="Fast mode"
hint={help.fastMode}
checked={fastModeEnabled}
onChange={(v) =>
isCreate
? set!({ fastMode: v })
: mark("adapterConfig", "fastMode", v)
}
/>
{fastModeEnabled && (
<div className="rounded-md border border-amber-300/70 bg-amber-50/80 px-3 py-2 text-sm text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-100">
{fastModeSupported
? "Fast mode consumes credits/tokens much faster than standard Codex runs."
: `Fast mode currently only works on ${supportedModelsLabel}. Paperclip will ignore this toggle until the model is switched.`}
</div>
)}
<LocalWorkspaceRuntimeFields
isCreate={isCreate}
values={values}

View File

@@ -10,6 +10,7 @@ export const defaultCreateValues: CreateConfigValues = {
chrome: false,
dangerouslySkipPermissions: true,
search: false,
fastMode: false,
dangerouslyBypassSandbox: false,
command: "",
args: "",

View File

@@ -34,6 +34,7 @@ export const help: Record<string, string> = {
dangerouslySkipPermissions: "Run unattended by auto-approving adapter permission prompts when supported.",
dangerouslyBypassSandbox: "Run Codex without sandbox restrictions. Required for filesystem/network access.",
search: "Enable Codex web search capability during runs.",
fastMode: "Enable Codex Fast mode. This burns credits/tokens much faster and is currently supported on GPT-5.4 only.",
workspaceStrategy: "How Paperclip should realize an execution workspace for this agent. Keep project_primary for normal cwd execution, or use git_worktree for issue-scoped isolated checkouts.",
workspaceBaseRef: "Base git ref used when creating a worktree branch. Leave blank to use the resolved workspace ref or HEAD.",
workspaceBranchTemplate: "Template for naming derived branches. Supports {{issue.identifier}}, {{issue.title}}, {{agent.name}}, {{project.id}}, {{workspace.repoRef}}, and {{slug}}.",