Files
openclaw/scripts/prepare-codex-ci-config.ts
Onur 361750775d CI: stabilize live release lanes (#67838)
* CI: stabilize live release lanes

* CI: widen codex live exclusions

* Gateway: stop live config/auth lazy re-imports

* CI: mount writable live Docker homes

* Live: tighten retry and provider filter overrides

* CI: use API-key auth for codex live lanes

* CI: fix remaining live lanes

* CI: stop forwarding live OpenAI base URLs

* Gateway: fix live startup loader regression

* CI: stop expanding OpenAI keys in live Docker lanes

* CI: stop expanding installer secrets in Docker

* CI: tighten live secret boundaries

* Gateway: pin Codex harness base URL

* CI: fix reusable workflow runner label

* CI: avoid template expansion in live ref guard

* CI: tighten live trust gate

* Gateway: ignore empty Codex harness base URL

* CI: stabilize remaining live lanes

* CI: harden live retries and canvas auth test

* CI: extend cron live probe budget

* CI: keep codex harness lane on api-key auth

* CI: stage live Docker OpenAI auth via env files

* CI: bootstrap codex login for Docker API-key lanes

* CI: accept hosted-runner codex fallback responses

* CI: accept additional codex sandbox fallback text

* CI: accept hosted-runner live fallback variants

* CI: accept codex current-model fallback

* CI: broaden codex sandbox model fallbacks

* CI: cover extra codex sandbox wording

* CI: extend cli backend cron retry budget

* CI: match codex models fallbacks by predicate

* CI: accept configured-models live fallback

* CI: relax OpenAI websocket warmup timeout

* CI: accept extra codex model fallback wording

* CI: generalize codex model fallback matching

* CI: retry cron verify cancellation wording

* CI: accept interactive codex model entrypoint fallback

* Agents: stabilize Claude bundle skill command test

* CI: prestage live Docker auth homes

* Tests: accept current Codex models wording

* CI: stabilize remaining live lanes

* Tests: widen CLI backend live timeout

* Tests: accept current Codex model summary wording

* CI: disable codex-cli image probe in Docker lane

* Tests: respect CLI override for Codex Docker login

* Tests: accept current Codex session models header

* CI: stabilize remaining live validation lanes

* CI: preserve Gemini ACP coverage in auth fallback

* CI: fix final live validation blockers

* CI: restore Codex auth for CLI backend lane

* CI: drop local Codex config in live Docker lane

* Tests: tolerate Codex cron and model reply drift

* Tests: accept current Codex live replies

* Tests: retry more Codex cron retry wording

* Tests: accept environment-cancelled Codex cron retries

* Tests: retry blank Codex cron probe replies

* Tests: broaden Codex cron retry wording

* Tests: require explicit Codex cron retry replies

* Tests: accept current Codex models environment wording

* CI: restore trusted Codex config in live lane

* CI: bypass nested Codex sandbox in docker

* CI: instrument live codex cron lane

* CI: forward live CLI resume args

* Tests: accept interactive Codex model selection

* Tests: bound websocket warm-up live lane

* CI: close live lane review gaps

* Tests: lazy-load gateway live server

* Tests: avoid gateway live loader regression

* CI: scope reusable workflow secrets

* Tests: tighten codex models live assertion

* Tests: normalize OpenAI speech live text
2026-04-18 03:18:12 +02:00

52 lines
1.7 KiB
TypeScript

import fs from "node:fs/promises";
import path from "node:path";
function tomlString(value: string): string {
return JSON.stringify(value);
}
export function buildCiSafeCodexConfig(params: {
projectPath: string;
approvalPolicy?: string;
sandboxMode?: string;
}): string {
if (!params.projectPath || typeof params.projectPath !== "string") {
throw new Error("projectPath is required.");
}
const resolvedProjectPath = path.resolve(params.projectPath);
const approvalPolicy = params.approvalPolicy ?? "never";
const sandboxMode = params.sandboxMode ?? "workspace-write";
return [
"# Generated for Codex CI runs.",
"# Keep the checked-out repo trusted while avoiding maintainer-local",
"# provider/profile overrides that do not exist on CI runners.",
`approval_policy = ${tomlString(approvalPolicy)}`,
`sandbox_mode = ${tomlString(sandboxMode)}`,
"",
`[projects.${tomlString(resolvedProjectPath)}]`,
'trust_level = "trusted"',
"",
].join("\n");
}
export async function writeCiSafeCodexConfig(params: {
outputPath: string;
projectPath: string;
approvalPolicy?: string;
sandboxMode?: string;
}): Promise<string> {
if (!params.outputPath || typeof params.outputPath !== "string") {
throw new Error("outputPath is required.");
}
const rendered = buildCiSafeCodexConfig(params);
await fs.mkdir(path.dirname(params.outputPath), { recursive: true });
await fs.writeFile(params.outputPath, rendered, "utf-8");
return rendered;
}
if (path.basename(process.argv[1] ?? "") === "prepare-codex-ci-config.ts") {
const outputPath = process.argv[2];
const projectPath = process.argv[3] ?? process.cwd();
await writeCiSafeCodexConfig({ outputPath, projectPath });
}