Skip to content

OpenAI's Codex Security CLI and TypeScript SDK for finding, validating, and fixing security vulnerabilities. npm: https://www.npmjs.com/package/@openai/codex-security

fix(config): disable reasoning summaries by default for Bedrock (#869)

mldangelo-oai338029ede792
diff --git a/AGENTS.md b/AGENTS.md
index a8a5b1fe6..2b9f727ba 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -25,6 +25,14 @@ node .github/scripts/check_plugin_source_compatibility.mjs
node --test .github/scripts/test_check_plugin_source_compatibility.mjs
```
+## Deep Scan worker settings
+
+When changing runtime settings, authentication, environment forwarding,
+permissions, or executable selection, trace the change through Deep Scan
+discovery and reducer workers, including resumed workers. Extend the worker
+launch tests to verify inherited values and intentional overrides at the
+child-process boundary. Keep per-scan settings isolated from concurrent scans.
+
## Avoid speculative defenses
- Do not add sanitization, redaction, validation, or fallback logic for
diff --git a/plugins/codex-security/.mcp.json b/plugins/codex-security/.mcp.json
index 189380736..16617b081 100644
--- a/plugins/codex-security/.mcp.json
+++ b/plugins/codex-security/.mcp.json
@@ -36,6 +36,7 @@
"PYTHON",
"PYTHONUTF8",
"CODEX_SECURITY_KNOWLEDGE_BASE",
+ "CODEX_SECURITY_CONFIG_PATH",
"CODEX_SECURITY_DEEP_SCAN_CONFIG_PATH",
"CODEX_SECURITY_SCAN_ROOT",
"CODEX_SECURITY_STATE_DIR",
diff --git a/plugins/codex-security/mcp-app/package.json b/plugins/codex-security/mcp-app/package.json
index a08f6242d..d896a2898 100644
--- a/plugins/codex-security/mcp-app/package.json
+++ b/plugins/codex-security/mcp-app/package.json
@@ -12,6 +12,7 @@
"dependencies": {
"@modelcontextprotocol/sdk": "^1.29.0",
"@openai/codex-sdk": "0.149.1",
+ "smol-toml": "1.6.1",
"zod": "^4.3.6"
},
"devDependencies": {
diff --git a/plugins/codex-security/mcp-app/pnpm-lock.yaml b/plugins/codex-security/mcp-app/pnpm-lock.yaml
index 98246750f..40d0dc676 100644
--- a/plugins/codex-security/mcp-app/pnpm-lock.yaml
+++ b/plugins/codex-security/mcp-app/pnpm-lock.yaml
@@ -14,6 +14,9 @@ importers:
'@openai/codex-sdk':
specifier: 0.149.1
version: 0.149.1
+ smol-toml:
+ specifier: 1.6.1
+ version: 1.6.1
zod:
specifier: ^4.3.6
version: 4.4.3
@@ -573,6 +576,10 @@ packages:
resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==}
engines: {node: '>= 0.4'}
+ resolution: {integrity: sha512-dWUG8F5sIIARXih1DTaQAX4SsiTXhInKf1buxdY9DIg4ZYPZK5nGM1VRIYmEbDbsHt7USo99xSLFu5Q1IqTmsg==}
+ engines: {node: '>= 18'}
+
resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==}
engines: {node: '>= 0.8'}
@@ -1128,6 +1135,8 @@ snapshots:
side-channel-map: 1.0.1
side-channel-weakmap: 1.0.2
+
diff --git a/plugins/codex-security/mcp-app/src/deep-scan/executor.ts b/plugins/codex-security/mcp-app/src/deep-scan/executor.ts
index a6579f74a..788745ae4 100644
--- a/plugins/codex-security/mcp-app/src/deep-scan/executor.ts
+++ b/plugins/codex-security/mcp-app/src/deep-scan/executor.ts
@@ -2,6 +2,7 @@ import { accessSync, constants as fsConstants, existsSync, promises as fs, readd
import { createRequire } from "node:module";
import { delimiter, dirname, isAbsolute, join, resolve, win32 } from "node:path";
import { Codex } from "@openai/codex-sdk";
+import { parse as parseToml } from "smol-toml";
import { executablePathForSpawn } from "./executable-path.js";
import {
classifyCodexWorkerError,
@@ -38,6 +39,8 @@ export interface CodexSdkWorkerArtifactContext {
}
export class CodexSdkWorkerExecutor implements CodexWorkerExecutor {
+ private runtimeReasoningSummary?: Promise<string | undefined>;
+
constructor(private readonly modelSettings: CodexSdkWorkerModelSettings = {}) {}
async run(request: CodexWorkerRequest): Promise<CodexWorkerResult> {
@@ -52,6 +55,8 @@ export class CodexSdkWorkerExecutor implements CodexWorkerExecutor {
const configOverrides = workerPermissionProfileConfigOverrides(workerProfile);
const originalCwd = process.cwd();
const childEnv = await snapshotWorkerEnvironment();
+ // Snapshot the SDK's per-scan config once for this coordinator, including resumes.
+ const reasoningSummary = await (this.runtimeReasoningSummary ??= workerReasoningSummary(childEnv));
const openAiApiKey = environmentVariable(childEnv, "OPENAI_API_KEY", process.platform)?.trim();
const codexApiKey = environmentVariable(childEnv, "CODEX_API_KEY", process.platform)?.trim();
const codexPath = resolveCodexPath(
@@ -78,6 +83,9 @@ export class CodexSdkWorkerExecutor implements CodexWorkerExecutor {
// Keep native credentials unless the worker has no configured account.
...(useOpenAiApiKey ? { apiKey: openAiApiKey } : {}),
config: {
+ ...(reasoningSummary === undefined
+ ? {}
+ : { model_reasoning_summary: reasoningSummary }),
// The CLI can add effort levels before the pinned SDK widens ThreadOptions.
...(this.modelSettings.reasoningEffort
? { model_reasoning_effort: this.modelSettings.reasoningEffort }
@@ -375,6 +383,20 @@ function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null;
}
+async function workerReasoningSummary(environment: Record<string, string>): Promise<string | undefined> {
+ const configPath = environmentVariable(environment, "CODEX_SECURITY_CONFIG_PATH", process.platform);
+ if (!configPath) return undefined;
+ const config = parseToml(await fs.readFile(configPath, "utf8"));
+ const profiles = config.profiles;
+ const profile = typeof config.profile === "string" && isRecord(profiles)
+ ? profiles[config.profile]
+ : undefined;
+ const summary = isRecord(profile) && profile.model_reasoning_summary !== undefined
+ ? profile.model_reasoning_summary
+ : config.model_reasoning_summary;
+ return typeof summary === "string" ? summary : undefined;
+}
+
async function snapshotWorkerEnvironment(): Promise<Record<string, string>> {
const environment = Object.fromEntries(
Object.entries(process.env)
diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.mjs b/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.mjs
index f24348d6f..2a18a3ab8 100644
--- a/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_executor.mjs
@@ -73,6 +73,7 @@ const deniedWorkerPermissionProfile = {
try {
await testOpenAiCredentialsReachWorker();
+ await testWorkerReasoningSummaries();
if (process.platform !== "win32") {
await testMissingParentSandboxFailsBeforeWorkerLaunch();
await testDisallowedWorkerProfileFailsBeforeWorkerLaunch();
@@ -729,6 +730,69 @@ async function testOpenAiCredentialsReachWorker() {
}
}
+async function testWorkerReasoningSummaries() {
+ const cases = [
+ ["", undefined],
+ ['model_reasoning_summary = "none"\n', "none"],
+ ['model_reasoning_summary = "auto"\n', "auto"],
+ ['model_reasoning_summary = "none"\nprofile = "selected"\n[profiles.selected]\nmodel_reasoning_summary = "concise"\n', "concise"],
+ ['model_reasoning_summary = "none"\nprofile = "selected"\n[profiles.selected]\nmodel = "fixture-model"\n[profiles.other]\nmodel_reasoning_summary = "detailed"\n', "none"]
+ ];
+ const saved = Object.fromEntries(
+ ["CODEX_CLI_PATH", "CODEX_SECURITY_CONFIG_PATH", "OPENAI_API_KEY", "CODEX_API_KEY"].map((name) => [name, process.env[name]])
+ );
+ const originalSpawn = childProcess.spawn;
+ try {
+ delete process.env.OPENAI_API_KEY;
+ delete process.env.CODEX_API_KEY;
+ for (const [configuration, expected] of cases) {
+ const fixture = await fakeCodexFixture(deniedWorkerPermissionProfile);
+ const configPath = path.join(fixture.root, "active scan config.toml");
+ const promptPath = path.join(fixture.root, "prompt.md");
+ await writeFile(configPath, configuration);
+ await writeFile(promptPath, "synthetic worker configuration fixture");
+ process.env.CODEX_CLI_PATH = process.execPath;
+ process.env.CODEX_SECURITY_CONFIG_PATH = configPath;
+ childProcess.spawn = (command, args, options) => originalSpawn(
+ command,
+ command === process.execPath || command === path.toNamespacedPath(process.execPath)
+ ? [fixture.executablePath, ...args]
+ : args,
+ options
+ );
+ syncBuiltinESMExports();
+ const executor = new CodexSdkWorkerExecutor({
+ model: "fixture-model",
+ reasoningEffort: "xhigh",
+ parentSandbox: trustedParentSandboxWithDenials
+ });
+ // A running coordinator retains its settings if the source file changes.
+ for (const kind of ["discovery", "dedup"]) {
+ for (const resumeThreadId of [undefined, "fixture-resumed-thread"]) {
+ await executor.run({
+ kind, promptPath, workingDirectory: fixture.root, subagents: 0,
+ resumeThreadId, signal: new AbortController().signal
+ });
+ const invocation = JSON.parse(await readFile(fixture.markerPath, "utf8"));
+ if (expected === undefined) {
+ assert.equal(invocation.argv.some((arg) => arg.startsWith("model_reasoning_summary=")), false);
+ } else {
+ assert.equal(invocation.argv.includes(`model_reasoning_summary=${JSON.stringify(expected)}`), true);
+ }
+ assert.equal(invocation.argv.includes('model_reasoning_effort="xhigh"'), true);
+ assertReadOnlyWorkerPolicy(invocation.argv);
+ assertWorkerSubagentPolicy(invocation.argv, 0);
+ await writeFile(configPath, 'model_reasoning_summary = "detailed"\n');
+ }
+ }
+ }
+ } finally {
+ childProcess.spawn = originalSpawn;
+ syncBuiltinESMExports();
+ for (const [name, value] of Object.entries(saved)) restoreEnv(name, value);
+ }
+}
+
async function testBedrockCredentialsReachWorker() {
const fixture = await fakeCodexFixture();
const mcpConfig = JSON.parse(
diff --git a/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs b/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs
index 63ddf58b5..e2a0fd3cd 100644
--- a/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_deep_scan_stdio_lifecycle.mjs
@@ -40,6 +40,7 @@ async function testDeepScanStdioLifecycle() {
const stateDir = path.join(fixtureRoot, "state");
const scanRoot = path.join(fixtureRoot, "scans");
const codexHome = path.join(fixtureRoot, "codex-home");
+ const runtimeConfigPath = path.join(fixtureRoot, "active-config.toml");
const startLogPath = path.join(fixtureRoot, "fake-codex-started.jsonl");
const exitLogPath = path.join(fixtureRoot, "fake-codex-exited.jsonl");
const restartControlPath = path.join(fixtureRoot, "fake-codex-restart-control.txt");
@@ -77,6 +78,13 @@ async function testDeepScanStdioLifecycle() {
].join("\n")
);
await writeFakeCodex(fakeCodexPath);
+ await writeFile(runtimeConfigPath, [
+ 'model_reasoning_summary = "detailed"',
+ 'profile = "selected"',
+ '[profiles.selected]',
+ 'model_reasoning_summary = "none"',
+ ''
+ ].join('\n'));
await writePythonWrapper(pythonWrapperPath);
await bundleServer(serverBundlePath);
@@ -86,6 +94,7 @@ async function testDeepScanStdioLifecycle() {
CODEX_API_KEY: "",
CODEX_CLI_PATH: fakeCodexPath,
CODEX_HOME: codexHome,
+ CODEX_SECURITY_CONFIG_PATH: runtimeConfigPath,
CODEX_SECURITY_SCAN_ROOT: scanRoot,
CODEX_SECURITY_STATE_DIR: stateDir,
PYTHON: pythonWrapperPath,
@@ -180,6 +189,7 @@ async function testDeepScanStdioLifecycle() {
)), { code: "ENOENT" });
assertFlagPair(startedWorker.argv, "--model", "gpt-5.5");
assert.equal(startedWorker.argv.includes('model_reasoning_effort="xhigh"'), true);
+ assert.equal(startedWorker.argv.includes('model_reasoning_summary="none"'), true);
assertReadOnlyWorkerInvocation(startedWorker.argv);
// Discovery progress is admitted once the first complete Standard worker is active.
@@ -545,6 +555,9 @@ async function testDeepScanStdioLifecycle() {
[]
);
const executions = (await readJsonLines(startLogPath)).slice(restartStartIndex);
+ for (const execution of executions) {
+ assert.equal(execution.argv.includes('model_reasoning_summary="none"'), true);
+ }
assert.equal(executions.filter((execution) => (
discoveryPromptContext(execution.stdin).workerLabel === "discovery-0001"
)).length, 1);
diff --git a/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs b/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
index 09583cb6d..5cdaef7cd 100644
--- a/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
+++ b/plugins/codex-security/mcp-app/tests/test_mcp_app_smoke.mjs
@@ -88,6 +88,7 @@ assert.deepEqual(
"PYTHON",
"PYTHONUTF8",
"CODEX_SECURITY_KNOWLEDGE_BASE",
+ "CODEX_SECURITY_CONFIG_PATH",
"CODEX_SECURITY_DEEP_SCAN_CONFIG_PATH",
"CODEX_SECURITY_SCAN_ROOT",
"CODEX_SECURITY_STATE_DIR",
diff --git a/sdk/typescript/README.md b/sdk/typescript/README.md
index 13e07921f..7b3d1fef9 100644
--- a/sdk/typescript/README.md
+++ b/sdk/typescript/README.md
@@ -219,6 +219,15 @@ credentials, and the default AWS credential chain. Set `AWS_REGION` and choose
a Bedrock model with `--model`; OpenAI models such as `openai.gpt-5.6-luna`
support `--max-cost`.
+Bedrock scans, including Deep Scan workers, default to
+`model_reasoning_summary = "none"` because some Bedrock models reject
+`reasoning.summary`. This leaves reasoning effort unchanged. Explicit summary
+settings in `--codex` overrides or the selected Codex profile take precedence.
+For standard scans on older CLI versions, append
+`--codex 'model_reasoning_summary="none"'` to your scan command if Bedrock
+reports that `reasoning.summary` is unsupported. Deep scans require a CLI
+version that forwards this setting to workers.
+
On Windows, set the API key in PowerShell:
```powershell
@@ -657,7 +666,7 @@ approvals_reviewer = "auto_review"
cli_auth_credentials_store = "auto"
model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
-model_reasoning_summary = "detailed"
+model_reasoning_summary = "detailed" # "none" for amazon-bedrock
show_raw_agent_reasoning = true
[features]
diff --git a/sdk/typescript/src/api.ts b/sdk/typescript/src/api.ts
index 075b2f014..eca39b40e 100644
--- a/sdk/typescript/src/api.ts
+++ b/sdk/typescript/src/api.ts
@@ -4678,6 +4678,7 @@ export function scanPreflightCodexConfig(config: JsonObject): JsonObject {
for (const key of [
"model",
"model_reasoning_effort",
+ "model_reasoning_summary",
"model_provider",
"service_tier",
]) {
@@ -4704,6 +4705,12 @@ export function scanPreflightCodexConfig(config: JsonObject): JsonObject {
return result;
};
const result = executionConfig(config);
+ // Keep the effective summary even when preflight filters the profile name.
+ const reasoningSummary =
+ resolveCodexProfile(config)["model_reasoning_summary"];
+ if (safeString(reasoningSummary)) {
+ result["model_reasoning_summary"] = reasoningSummary;
+ }
const selectedProfile = safeProfileName(config["profile"])
? config["profile"]
: undefined;
diff --git a/sdk/typescript/src/config.ts b/sdk/typescript/src/config.ts
index 5fc86494e..3db36c0c7 100644
--- a/sdk/typescript/src/config.ts
+++ b/sdk/typescript/src/config.ts
@@ -216,7 +216,12 @@ export async function mergedCodexConfig(
}
}
}
- return deepMerge(cloneJson(DEFAULT_CODEX_CONFIG), overrides);
+ const defaults: JsonObject = cloneJson(DEFAULT_CODEX_CONFIG);
+ if (scanModelProvider(overrides) === "amazon-bedrock") {
+ // Bedrock models can reject reasoning.summary before the scan starts.
+ defaults["model_reasoning_summary"] = "none";
+ }
+ return deepMerge(defaults, overrides);
}
function normalizeLegacyWindowsSandboxOverride(overrides: JsonObject): void {
diff --git a/sdk/typescript/tests-ts/api.test.ts b/sdk/typescript/tests-ts/api.test.ts
index 8db6efedf..e04523354 100644
--- a/sdk/typescript/tests-ts/api.test.ts
+++ b/sdk/typescript/tests-ts/api.test.ts
@@ -47,6 +47,7 @@ import {
import {
FIREWORKS_CODEX_PROVIDER,
OPENROUTER_CODEX_PROVIDER,
+ resolveCodexProfile,
type JsonObject,
} from "../src/config.js";
import { estimateScanCost, type ScanCost } from "../src/cost.js";
@@ -1478,6 +1479,10 @@ describe("CodexSecurity orchestration", () => {
expect((codexOptions as CodexOptions | null)?.env).toMatchObject(
credentials,
);
+ expect((codexOptions as CodexOptions | null)?.config).toMatchObject({
+ model_reasoning_summary: "none",
+ model_reasoning_effort: "xhigh",
+ });
const configuration = JSON.parse(
await readFile(join(PLUGIN_ROOT, ".mcp.json"), "utf8"),
) as { mcpServers: Record<string, { env_vars: string[] }> };
@@ -1604,6 +1609,10 @@ describe("CodexSecurity orchestration", () => {
AWS_BEARER_TOKEN_BEDROCK: "synthetic-bedrock-bearer",
AWS_REGION: "us-east-2",
});
+ expect((codexOptions as CodexOptions | null)?.config).toMatchObject({
+ model_reasoning_summary: "none",
+ model_reasoning_effort: "xhigh",
+ });
expect((codexOptions as CodexOptions | null)?.env).not.toHaveProperty(
"OPENAI_API_KEY",
);
@@ -1628,6 +1637,128 @@ describe("CodexSecurity orchestration", () => {
await client.close();
});
+ test("isolates resolved Deep worker summaries across concurrent Bedrock scans", async () => {
+ const root = await temporaryDirectory();
+ const repository = join(root, "repository");
+ const stateDirectory = join(root, "state");
+ await mkdir(repository);
+ const scenarios: [JsonObject, string][] = [
+ [{}, "none"],
+ [{ model_reasoning_summary: "auto" }, "auto"],
+ [
+ {
+ profile: "cloud",
+ profiles: { cloud: { model_reasoning_summary: "concise" } },
+ },
+ "concise",
+ ],
+ [
+ {
+ profile: "cloud.production",
+ profiles: {
+ "cloud.production": { model_reasoning_summary: "concise" },
+ },
+ },
+ "concise",
+ ],
+ ];
+ let started = 0;
+ let release!: () => void;
+ const allStarted = new Promise<void>((resolve) => {
+ release = resolve;
+ });
+ const configPaths = new Set<string>();
+ const manifest = JSON.parse(
+ await readFile(join(PLUGIN_ROOT, ".mcp.json"), "utf8"),
+ ) as {
+ mcpServers: Record<string, { env_vars: string[] }>;
+ };
+ const clients = await Promise.all(
+ scenarios.map(async ([overrides, expected], index) => {
+ const scanDir = join(root, `scan-${index}`);
+ await mkdir(scanDir, { mode: 0o700 });
+ return new TestClient(
+ {
+ pluginPath: PLUGIN_ROOT,
+ codexOverrides: {
+ model: "openai.gpt-5.6-luna",
+ model_provider: "amazon-bedrock",
+ ...overrides,
+ },
+ },
+ {
+ environment: {
+ CODEX_SECURITY_STATE_DIR: stateDirectory,
+ AWS_BEARER_TOKEN_BEDROCK: "synthetic-bedrock-key",
+ AWS_REGION: "us-east-2",
+ },
+ resolvePluginPython: async () => "/managed/python",
+ prepareOutputDir: async () => scanDir,
+ repositoryRevision: async () => "deadbeef",
+ createCodex: (options: CodexOptions) => ({
+ startThread: () => ({
+ id: null,
+ async runStreamed() {
+ if (++started === scenarios.length) release();
+ await allStarted;
+ const mcpEnvironment = Object.fromEntries(
+ Object.entries(options.env ?? {}).filter(([name]) =>
+ manifest.mcpServers["codex-security"]!.env_vars.includes(
+ name,
+ ),
+ ),
+ );
+ const configPath =
+ mcpEnvironment["CODEX_SECURITY_CONFIG_PATH"];
+ expect(typeof configPath).toBe("string");
+ configPaths.add(configPath!);
+ const config = parseToml(
+ await readFile(configPath!, "utf8"),
+ ) as JsonObject;
+ expect(resolveCodexProfile(config)).toMatchObject({
+ model_reasoning_summary: expected,
+ model_reasoning_effort: "xhigh",
+ model_provider: "amazon-bedrock",
+ });
+ expect(mcpEnvironment["AWS_BEARER_TOKEN_BEDROCK"]).toBe(
+ "synthetic-bedrock-key",
+ );
+ const shared = parseToml(
+ await readFile(
+ join(options.env!["CODEX_HOME"]!, "config.toml"),
+ "utf8",
+ ),
+ );
+ expect(shared["model_reasoning_summary"]).toBeUndefined();
+ throw new Error("worker context captured");
+ },
+ }),
+ }),
+ },
+ );
+ }),
+ );
+ try {
+ const results = await Promise.allSettled(
+ clients.map((client) =>
+ client.run(repository, { mode: "deep" }).finally(release),
+ ),
+ );
+ for (const result of results)
+ expect(result).toMatchObject({
+ status: "rejected",
+ reason: expect.objectContaining({
+ message: "worker context captured",
+ }),
+ });
+ expect(started).toBe(scenarios.length);
+ expect(configPaths.size).toBe(scenarios.length);
+ } finally {
+ release();
+ await Promise.all(clients.map((client) => client.close()));
+ }
+ });
+
test("does not accept Bedrock credentials for an OpenAI scan", async () => {
const root = await temporaryDirectory();
const repository = join(root, "repository");
diff --git a/sdk/typescript/tests-ts/config.test.ts b/sdk/typescript/tests-ts/config.test.ts
index b5d374bd2..b8194c636 100644
--- a/sdk/typescript/tests-ts/config.test.ts
+++ b/sdk/typescript/tests-ts/config.test.ts
@@ -12,6 +12,7 @@ import { afterEach, describe, expect, test } from "bun:test";
import { parse } from "smol-toml";
import { scanRuntimeCodexConfig } from "../src/api.js";
import {
+ type JsonObject,
resolveCodexProfile,
scanModelConfiguration,
scanModelProvider,
@@ -257,6 +258,80 @@ describe("Codex configuration", () => {
}
});
+ test("disables reasoning summaries by default for the selected Bedrock provider", async () => {
+ const scenarios: JsonObject[] = [
+ { model_provider: "amazon-bedrock" },
+ {
+ model_provider: "openai",
+ profile: "cloud",
+ profiles: { cloud: { model_provider: "amazon-bedrock" } },
+ },
+ {
+ model_provider: "amazon-bedrock",
+ profile: "cloud",
+ profiles: { cloud: { model: "openai.gpt-5.6-luna" } },
+ },
+ ];
+ for (const overrides of scenarios) {
+ const config = await mergedCodexConfig({ codexOverrides: overrides });
+ expect(resolveCodexProfile(config)).toMatchObject({
+ model_reasoning_summary: "none",
+ model_reasoning_effort: "xhigh",
+ });
+ }
+ });
+
+ test("keeps reasoning summaries when the selected provider is not Bedrock", async () => {
+ const scenarios: JsonObject[] = [
+ {
+ model_provider: "amazon-bedrock",
+ profile: "direct",
+ profiles: { direct: { model_provider: "openai" } },
+ },
+ {
+ model_provider: "openai",
+ profiles: { cloud: { model_provider: "amazon-bedrock" } },
+ },
+ ];
+ for (const overrides of scenarios) {
+ const config = await mergedCodexConfig({ codexOverrides: overrides });
+ expect(resolveCodexProfile(config)["model_reasoning_summary"]).toBe(
+ "detailed",
+ );
+ }
+ });
+
+ test("preserves explicit Bedrock reasoning summary settings", async () => {
+ for (const [overrides, expected] of [
+ [
+ { model_provider: "amazon-bedrock", model_reasoning_summary: "auto" },
+ "auto",
+ ],
+ [
+ {
+ model_reasoning_summary: "concise",
+ profile: "cloud",
+ profiles: { cloud: { model_provider: "amazon-bedrock" } },
+ },
+ "concise",
+ ],
+ [
+ {
+ model_provider: "amazon-bedrock",
+ model_reasoning_summary: "none",
+ profile: "cloud",
+ profiles: { cloud: { model_reasoning_summary: "detailed" } },
+ },
+ "detailed",
+ ],
+ ] as const) {
+ const config = await mergedCodexConfig({ codexOverrides: overrides });
+ expect(resolveCodexProfile(config)["model_reasoning_summary"]).toBe(
+ expected,
+ );
+ }
+ });
+
test("deep-merges native multi-agent v2 defaults", async () => {
const merged = await mergedCodexConfig({
codexOverrides: {
diff --git a/sdk/typescript/tests-ts/deep-scan-worker-shutdown.test.ts b/sdk/typescript/tests-ts/deep-scan-worker-shutdown.test.ts
index a94bbb8c4..c23adfb4d 100644
--- a/sdk/typescript/tests-ts/deep-scan-worker-shutdown.test.ts
+++ b/sdk/typescript/tests-ts/deep-scan-worker-shutdown.test.ts
@@ -54,6 +54,7 @@ async function bundledWorkerExecutor(
"workerPermissionProfile",
"workerPermissionProfileConfigOverrides",
"snapshotWorkerEnvironment",
+ "workerReasoningSummary",
"environmentVariable",
"preflightDeepScanWorkerPermissionProfile",
"DEEP_SCAN_WORKER_PERMISSION_PROFILE_ID",
@@ -70,6 +71,7 @@ async function bundledWorkerExecutor(
() => ({}),
() => [],
async () => ({}),
+ async () => undefined,
() => undefined,
preflight,
"codex_security_deep_scan_worker",