Skip to content

Commit 98c6c08

Browse files
committed
fix(server): discover codex MCP servers with the selected profile
1 parent 52c2279 commit 98c6c08

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎apps/server/src/provider/codexLaunchArgs.test.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ describe("codex exec and mcp list launch args", () => {
5050
]);
5151
});
5252

53-
it("drops exec-only flags for codex mcp list", () => {
54-
NodeAssert.deepStrictEqual(codexMcpListLaunchArgs(launchArgs), ["--enable", "foo"]);
53+
it("keeps the selected profile and drops exec-only flags for codex mcp list", () => {
54+
NodeAssert.deepStrictEqual(codexMcpListLaunchArgs(launchArgs), [
55+
"--profile",
56+
"local",
57+
"-p=work",
58+
"--enable",
59+
"foo",
60+
]);
5561
});
5662
});

‎apps/server/src/provider/codexLaunchArgs.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ const SHARED_INLINE_PREFIXES = ["--config=", "-c=", "--enable=", "--disable="];
2525

2626
const MCP_LIST_FILTER: LaunchArgFilter = {
2727
switches: new Set(),
28-
valueFlags: new Set(SHARED_VALUE_FLAGS),
29-
inlinePrefixes: SHARED_INLINE_PREFIXES,
28+
valueFlags: new Set([...SHARED_VALUE_FLAGS, "--profile", "-p"]),
29+
inlinePrefixes: [...SHARED_INLINE_PREFIXES, "--profile=", "-p="],
3030
};
3131

32-
// `codex exec` also takes the local model provider flags; `codex mcp list` rejects them.
3332
const EXEC_FILTER: LaunchArgFilter = {
3433
switches: new Set(["--strict-config", "--oss"]),
3534
valueFlags: new Set([...SHARED_VALUE_FLAGS, "--local-provider", "--profile", "-p"]),

0 commit comments

Comments
 (0)