Fall back to dangerouslyBypassSandbox when the full dangerouslyBypassApprovalsAndSandbox flag is not set, keeping the UI toggle in sync with either config key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
55 lines
1.3 KiB
TypeScript
55 lines
1.3 KiB
TypeScript
import type { AdapterConfigFieldsProps } from "../types";
|
|
import {
|
|
ToggleField,
|
|
help,
|
|
} from "../../components/agent-config-primitives";
|
|
|
|
export function CodexLocalConfigFields({
|
|
isCreate,
|
|
values,
|
|
set,
|
|
config,
|
|
eff,
|
|
mark,
|
|
}: AdapterConfigFieldsProps) {
|
|
const bypassEnabled =
|
|
config.dangerouslyBypassApprovalsAndSandbox === true || config.dangerouslyBypassSandbox === true;
|
|
|
|
return (
|
|
<>
|
|
<ToggleField
|
|
label="Bypass sandbox"
|
|
hint={help.dangerouslyBypassSandbox}
|
|
checked={
|
|
isCreate
|
|
? values!.dangerouslyBypassSandbox
|
|
: eff(
|
|
"adapterConfig",
|
|
"dangerouslyBypassApprovalsAndSandbox",
|
|
bypassEnabled,
|
|
)
|
|
}
|
|
onChange={(v) =>
|
|
isCreate
|
|
? set!({ dangerouslyBypassSandbox: v })
|
|
: mark("adapterConfig", "dangerouslyBypassApprovalsAndSandbox", v)
|
|
}
|
|
/>
|
|
<ToggleField
|
|
label="Enable search"
|
|
hint={help.search}
|
|
checked={
|
|
isCreate
|
|
? values!.search
|
|
: eff("adapterConfig", "search", !!config.search)
|
|
}
|
|
onChange={(v) =>
|
|
isCreate
|
|
? set!({ search: v })
|
|
: mark("adapterConfig", "search", v)
|
|
}
|
|
/>
|
|
</>
|
|
);
|
|
}
|