fix(adapter): support dangerouslyBypassSandbox alias in codex-local

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>
This commit is contained in:
Forgotten
2026-02-23 19:44:10 -06:00
parent d2f9ade30c
commit 544beaaae7
2 changed files with 8 additions and 2 deletions

View File

@@ -103,7 +103,10 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
asString(config.reasoningEffort, ""),
);
const search = asBoolean(config.search, false);
const bypass = asBoolean(config.dangerouslyBypassApprovalsAndSandbox, false);
const bypass = asBoolean(
config.dangerouslyBypassApprovalsAndSandbox,
asBoolean(config.dangerouslyBypassSandbox, false),
);
const cwd = asString(config.cwd, process.cwd());
await ensureAbsoluteDirectory(cwd);

View File

@@ -12,6 +12,9 @@ export function CodexLocalConfigFields({
eff,
mark,
}: AdapterConfigFieldsProps) {
const bypassEnabled =
config.dangerouslyBypassApprovalsAndSandbox === true || config.dangerouslyBypassSandbox === true;
return (
<>
<ToggleField
@@ -23,7 +26,7 @@ export function CodexLocalConfigFields({
: eff(
"adapterConfig",
"dangerouslyBypassApprovalsAndSandbox",
config.dangerouslyBypassApprovalsAndSandbox !== false,
bypassEnabled,
)
}
onChange={(v) =>