mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 02:41:07 +00:00
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
import type { CliBackendPlugin } from "openclaw/plugin-sdk/cli-backend";
|
|
import {
|
|
CLI_FRESH_WATCHDOG_DEFAULTS,
|
|
CLI_RESUME_WATCHDOG_DEFAULTS,
|
|
} from "openclaw/plugin-sdk/cli-backend";
|
|
|
|
export function buildOpenAICodexCliBackend(): CliBackendPlugin {
|
|
return {
|
|
id: "codex-cli",
|
|
config: {
|
|
command: "codex",
|
|
args: [
|
|
"exec",
|
|
"--json",
|
|
"--color",
|
|
"never",
|
|
"--sandbox",
|
|
"workspace-write",
|
|
"--skip-git-repo-check",
|
|
],
|
|
resumeArgs: [
|
|
"exec",
|
|
"resume",
|
|
"{sessionId}",
|
|
"--color",
|
|
"never",
|
|
"--sandbox",
|
|
"workspace-write",
|
|
"--skip-git-repo-check",
|
|
],
|
|
output: "jsonl",
|
|
resumeOutput: "text",
|
|
input: "arg",
|
|
modelArg: "--model",
|
|
sessionIdFields: ["thread_id"],
|
|
sessionMode: "existing",
|
|
imageArg: "--image",
|
|
imageMode: "repeat",
|
|
reliability: {
|
|
watchdog: {
|
|
fresh: { ...CLI_FRESH_WATCHDOG_DEFAULTS },
|
|
resume: { ...CLI_RESUME_WATCHDOG_DEFAULTS },
|
|
},
|
|
},
|
|
serialize: true,
|
|
},
|
|
};
|
|
}
|