Skip to content

Commit 461d005

Browse files
committed
fix: keep codex resume runs non-interactive (#67666) (thanks @plgonzalezrx8)
1 parent 4c66978 commit 461d005

6 files changed

Lines changed: 23 additions & 17 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ Docs: https://docs.openclaw.ai
4343
- Extensions/lmstudio: add exponential backoff to the inference-preload wrapper so an LM Studio model-load failure (for example the built-in memory guardrail rejecting a load because the swap is saturated) no longer produces a WARN line every ~2s for every chat request. The wrapper now records consecutive preload failures per `(baseUrl, modelKey, contextLength)` tuple with a 5s → 10s → 20s → … → 5min cooldown and skips the preload step entirely while a cooldown is active, letting chat requests proceed directly to the stream (the model is often already loaded via the LM Studio UI). The combined `preload failed` log line now reports consecutive-failure count and remaining cooldown so operators can act on the real issue instead of drowning in repeated warnings. (#67401) Thanks @xantorres.
4444
- Agents/replay: re-run tool/result pairing after strict replay tool-call ID sanitization on outbound requests so Anthropic-compatible providers like MiniMax no longer receive malformed orphan tool-result IDs such as `...toolresult1` during compaction and retry flows. (#67620) Thanks @stainlu.
4545
- Gateway/startup: fix spurious SIGUSR1 restart loop on Linux/systemd when plugin auto-enable is the only startup config write; the config hash guard was not captured for that write path, causing chokidar to treat each boot write as an external change and trigger a reload → restart cycle that corrupts manifest.db after repeated cycles. Fixes #67436. (#67557) thanks @openperf
46+
- OpenAI Codex/CLI: keep resumed `codex exec resume` runs on the safe non-interactive path without reintroducing the removed dangerous bypass flag by passing the supported `--skip-git-repo-check` resume arg that real Codex CLI requires outside trusted git directories. (#67666) Thanks @plgonzalezrx8.
4647

4748
## 2026.4.15-beta.1
4849

docs/gateway/cli-backends.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ The bundled OpenAI plugin also registers a default for `codex-cli`:
221221

222222
- `command: "codex"`
223223
- `args: ["exec","--json","--color","never","--sandbox","workspace-write","--skip-git-repo-check"]`
224-
- `resumeArgs: ["exec","resume","{sessionId}","--color","never","--sandbox","workspace-write","--skip-git-repo-check"]`
224+
- `resumeArgs: ["exec","resume","{sessionId}","--skip-git-repo-check"]`
225225
- `output: "jsonl"`
226226
- `resumeOutput: "text"`
227227
- `modelArg: "--model"`

extensions/openai/cli-backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export function buildOpenAICodexCliBackend(): CliBackendPlugin {
3131
"workspace-write",
3232
"--skip-git-repo-check",
3333
],
34-
resumeArgs: ["exec", "resume", "{sessionId}"],
34+
resumeArgs: ["exec", "resume", "{sessionId}", "--skip-git-repo-check"],
3535
output: "jsonl",
3636
resumeOutput: "text",
3737
input: "arg",

src/agents/cli-backends.test.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ beforeEach(() => {
244244
"workspace-write",
245245
"--skip-git-repo-check",
246246
],
247-
resumeArgs: ["exec", "resume", "{sessionId}"],
247+
resumeArgs: ["exec", "resume", "{sessionId}", "--skip-git-repo-check"],
248248
systemPromptFileConfigArg: "-c",
249249
systemPromptFileConfigKey: "model_instructions_file",
250250
systemPromptWhen: "first",
@@ -309,7 +309,7 @@ beforeEach(() => {
309309
});
310310

311311
describe("resolveCliBackendConfig reliability merge", () => {
312-
it("defaults codex-cli to workspace-write for fresh and resume runs", () => {
312+
it("defaults codex-cli fresh sandboxing and resume trust bypass for non-git runs", () => {
313313
const resolved = resolveCliBackendConfig("codex-cli");
314314

315315
expect(resolved).not.toBeNull();
@@ -322,7 +322,12 @@ describe("resolveCliBackendConfig reliability merge", () => {
322322
"workspace-write",
323323
"--skip-git-repo-check",
324324
]);
325-
expect(resolved?.config.resumeArgs).toEqual(["exec", "resume", "{sessionId}"]);
325+
expect(resolved?.config.resumeArgs).toEqual([
326+
"exec",
327+
"resume",
328+
"{sessionId}",
329+
"--skip-git-repo-check",
330+
]);
326331
});
327332

328333
it("deep-merges reliability watchdog overrides for codex", () => {

src/agents/cli-runner.spawn.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function buildPreparedCliRunContext(params: {
5353
: {
5454
command: "codex",
5555
args: ["exec", "--json"],
56-
resumeArgs: ["exec", "resume", "{sessionId}", "--json"],
56+
resumeArgs: ["exec", "resume", "{sessionId}", "--skip-git-repo-check"],
5757
output: "text" as const,
5858
input: "arg" as const,
5959
modelArg: "--model",
@@ -435,7 +435,16 @@ describe("runCliAgent spawn path", () => {
435435
scopeKey?: string;
436436
};
437437
expect(input.mode).toBe("child");
438-
expect(input.argv?.[0]).toBe("codex");
438+
expect(input.argv).toEqual([
439+
"codex",
440+
"exec",
441+
"resume",
442+
"thread-123",
443+
"--skip-git-repo-check",
444+
"--model",
445+
"gpt-5.4",
446+
"hi",
447+
]);
439448
expect(input.timeoutMs).toBe(1_000);
440449
expect(input.noOutputTimeoutMs).toBeGreaterThanOrEqual(1_000);
441450
expect(input.replaceExistingScope).toBe(true);

src/agents/cli-runner.test-support.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,7 @@ function buildOpenAICodexCliBackendFixture(): CliBackendPlugin {
120120
"workspace-write",
121121
"--skip-git-repo-check",
122122
],
123-
resumeArgs: [
124-
"exec",
125-
"resume",
126-
"{sessionId}",
127-
"--color",
128-
"never",
129-
"--sandbox",
130-
"workspace-write",
131-
"--skip-git-repo-check",
132-
],
123+
resumeArgs: ["exec", "resume", "{sessionId}", "--skip-git-repo-check"],
133124
output: "jsonl",
134125
resumeOutput: "text",
135126
input: "arg",

0 commit comments

Comments
 (0)