The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
fix(server): keep escaped spaces in Codex launch overrides (#39458)
Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
Simone committed
Nov 20, 2026 at 02:54 UTC
09b79941a521e5a76112a6beb268dc8065a7405d
2 files changed
+19
-2
apps/server/src/provider/codexLaunchArgs.test.ts
+15
-1
@@ -6,6 +6,7 @@ import {
6
codexAppServerArgs,
7
codexExecLaunchArgs,
8
codexMcpListLaunchArgs,
9
+ resolveCodexLaunchArgs,
10
} from "./codexLaunchArgs.ts";
11
12
describe("codexAppServerArgs", () => {
@@ -20,8 +21,21 @@ describe("codexAppServerArgs", () => {
21
launchArgs: "-c thread_unload_delay_secs=1800",
22
expected: ["-c", "thread_unload_delay_secs=1800"],
23
},
24
+ {
25
+ name: "preserves an escaped trailing space in the environment override",
26
+ launchArgs: "--strict-config",
27
+ environment: { T3CODE_CODEX_LAUNCH_ARGS: "--cloud-skills-snapshot skills.json\\ " },
28
+ expected: ["--cloud-skills-snapshot", "skills.json "],
29
+ },
30
+ {
31
+ name: "uses configured arguments when the environment override is blank",
32
+ launchArgs: "--strict-config",
33
+ environment: { T3CODE_CODEX_LAUNCH_ARGS: " \t " },
34
+ expected: ["--strict-config"],
35
+ },
36
])("asks Codex to unload unsubscribed threads immediately and $name", (row) => {
24
- NodeAssert.deepStrictEqual(codexAppServerArgs(row.launchArgs), [
37
+ const launchArgs = resolveCodexLaunchArgs(row.launchArgs, row.environment ?? {});
38
+ NodeAssert.deepStrictEqual(codexAppServerArgs(launchArgs), [
39
"app-server",
40
"-c",
41
"thread_unload_delay_secs=0",
apps/server/src/provider/codexLaunchArgs.ts
+4
-1
@@ -5,7 +5,10 @@ const T3CODE_CODEX_LAUNCH_ARGS_ENV = "T3CODE_CODEX_LAUNCH_ARGS";
5
export const resolveCodexLaunchArgs = (
6
launchArgs?: string,
7
environment: NodeJS.ProcessEnv = process.env,
8
-) => environment[T3CODE_CODEX_LAUNCH_ARGS_ENV]?.trim() || launchArgs?.trim() || "";
8
+) => {
9
+ const override = environment[T3CODE_CODEX_LAUNCH_ARGS_ENV];
10
+ return override?.trim() ? override : launchArgs?.trim() || "";
11
+};
12
13
const codexLaunchArgv = (launchArgs?: string): ReadonlyArray<string> => tokenizeCliArgs(launchArgs);
14