Skip to content

Commit 6edaf22

Browse files
committed
Test disabled MCP config filtering
1 parent 8eb4998 commit 6edaf22

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

src/__tests__/CodexACPAgent/CodexAcpClient.test.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,58 @@ describe('ACP server test', { timeout: 40_000 }, () => {
328328
});
329329
});
330330

331+
it('passes conflicting ACP MCP servers through when config filtering is disabled', async () => {
332+
vi.stubEnv("DISABLE_MCP_CONFIG_FILTERING", "true");
333+
try {
334+
const mockFixture = createCodexMockTestFixture();
335+
const codexAcpClient = mockFixture.getCodexAcpClient();
336+
const codexAppServerClient = mockFixture.getCodexAppServerClient();
337+
338+
vi.spyOn(codexAppServerClient, "listSkills").mockResolvedValue({data: []});
339+
const configReadSpy = vi.spyOn(codexAppServerClient, "configRead").mockResolvedValue({
340+
config: {
341+
mcp_servers: {
342+
shared_mcp: {
343+
url: "https://example.com/mcp",
344+
},
345+
},
346+
},
347+
} as any);
348+
const threadStartSpy = vi.spyOn(codexAppServerClient, "threadStart").mockResolvedValue({
349+
thread: {id: "thread-id"} as any,
350+
model: "gpt-5",
351+
reasoningEffort: "medium",
352+
serviceTier: null,
353+
} as any);
354+
vi.spyOn(codexAppServerClient, "listModels").mockResolvedValue({
355+
data: [createTestModel({id: "gpt-5"})],
356+
nextCursor: null,
357+
});
358+
359+
await codexAcpClient.newSession({
360+
cwd: "/workspace",
361+
mcpServers: [{
362+
name: "shared mcp",
363+
command: "npx",
364+
args: ["shared"],
365+
env: [],
366+
}],
367+
});
368+
369+
const threadStartRequest = threadStartSpy.mock.calls[0]![0];
370+
expect(configReadSpy).not.toHaveBeenCalled();
371+
expect(threadStartRequest.config?.["mcp_servers"]).toEqual({
372+
shared_mcp: {
373+
command: "npx",
374+
args: ["shared"],
375+
env: {},
376+
},
377+
});
378+
} finally {
379+
vi.unstubAllEnvs();
380+
}
381+
});
382+
331383
it('waits for typed mcp startup status updates and returns terminal states', async () => {
332384
const mockFixture = createCodexMockTestFixture();
333385
const codexAcpClient = mockFixture.getCodexAcpClient();

0 commit comments

Comments
 (0)