Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Codex titles and branch names no longer start the user's MCP servers #17058

Mergedbrycedbjork(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/17058/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 185 additions and 13 deletions.

x
0 of 2 viewed, 2 left
72 additions and 0 deletionsapps/server/src/textGeneration/CodexTextGeneration.test.tsModified
View file
@@ -40,6 +40,8 @@
forbidArg?: string;
stdinMustContain?: string;
stdinMustNotContain?: string;
+ /** What `codex mcp list --json` answers; a number exits with that code instead. */
+ mcpServers?: ReadonlyArray<{ name: string; enabled: boolean }> | number;
​
// The stub walks argv the way the shell script it replaced did: `--image`,
@@ -56,6 +58,7 @@
forbidArg: input.forbidArg ?? null,
stdinMustContain: input.stdinMustContain ?? null,
stdinMustNotContain: input.stdinMustNotContain ?? null,
+ mcpServers: input.mcpServers ?? [],
stderr: input.stderr ?? null,
output: input.output,
exitCode: input.exitCode ?? 0,
@@ -69,6 +72,11 @@
'import * as NodeFS from "node:fs";',
`const check = ${check};`,
"const args = process.argv.slice(2);",
+ 'if (args.includes("mcp") && args.includes("list")) {',
+ ' if (typeof check.mcpServers === "number") process.exit(check.mcpServers);',
+ " process.stdout.write(JSON.stringify(check.mcpServers));",
+ " process.exit(0);",
+ "}",
'const originalArgs = ` ${args.join(" ")} `;',
"let outputPath = null;",