Skip to content

Commit d8fa0e9

Browse files
authored
test(agent): update codex local-tools-mcp desktop test for always-on speak
The speak tool is now alwaysLoad/always-enabled, so buildLocalToolsServer no longer returns null on a desktop run — it returns a server exposing just the speak tool. Reframe the desktop-run assertion to match the claude adapter's equivalent test: the always-on speak tool is present while the cloud-only signed-git tools are not. Generated-By: PostHog Code Task-Id: e012ce8b-197a-41c1-b96a-36bad4a1aa86
1 parent f16adce commit d8fa0e9

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

packages/agent/src/adapters/codex-app-server/local-tools-mcp.test.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,22 @@ describe("buildLocalToolsServer", () => {
9090
).toBeNull();
9191
});
9292

93-
it("returns null when no tool's gate passes (desktop run)", () => {
93+
it("exposes only the always-on tools on a desktop run (no cloud-only tools)", () => {
9494
process.env.GH_TOKEN = "ghs_test";
9595

96-
expect(
97-
buildLocalToolsServer({ cwd: "/repo" }, { environment: "local" }),
98-
).toBeNull();
96+
const server = buildLocalToolsServer(
97+
{ cwd: "/repo" },
98+
{ environment: "local" },
99+
);
100+
101+
expect(server).not.toBeNull();
102+
const enabled =
103+
server?.env.find((e) => e.name === "POSTHOG_LOCAL_TOOLS_ENABLED")
104+
?.value ?? "";
105+
const names = enabled.split(",");
106+
// `speak` is always on (narration works on desktop and cloud alike).
107+
expect(names).toContain("speak");
108+
// Signed-git tools are cloud-only and must not leak into a desktop run.
109+
expect(names).not.toContain("git_signed_commit");
99110
});
100111
});

0 commit comments

Comments
 (0)