diff --git a/src/server.ts b/src/server.ts index bf4211a1..ba9d7430 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1733,7 +1733,7 @@ export function startWebSocketSimulator(opts: { const entries: Array = []; const shouldSkipRelativePath = (relativePath: string) => { const segments = relativePath.split(/\\|\//g).filter(Boolean); - return segments.includes(".gambit"); + return segments.includes(".gambit") || segments.includes(".codex"); }; const walk = async (dir: string, relativePrefix: string) => { for await (const entry of Deno.readDir(dir)) { diff --git a/src/server_routes_state.test.ts b/src/server_routes_state.test.ts index 373e6462..7027f6d4 100644 --- a/src/server_routes_state.test.ts +++ b/src/server_routes_state.test.ts @@ -151,7 +151,7 @@ Deno.test("build API errors are persisted to session errors sidecar", async () = await server.finished; }); -Deno.test("build files API excludes .gambit directory entries", async () => { +Deno.test("build files API excludes .gambit and .codex directory entries", async () => { const dir = await Deno.makeTempDir(); const modHref = modImportPath(); @@ -213,6 +213,12 @@ Deno.test("build files API excludes .gambit directory entries", async () => { path.join(root, ".gambit", "nested", "also-hidden.txt"), "secret", ); + await Deno.mkdir(path.join(root, ".codex", "nested"), { recursive: true }); + await Deno.writeTextFile(path.join(root, ".codex", "hidden.txt"), "secret"); + await Deno.writeTextFile( + path.join(root, ".codex", "nested", "also-hidden.txt"), + "secret", + ); await Deno.writeTextFile(path.join(root, "visible.txt"), "visible"); await Deno.mkdir(path.join(root, "scenarios", "scenario_a"), { recursive: true, @@ -245,6 +251,10 @@ Body paths.some((value) => value === ".gambit" || value.startsWith(".gambit/")), false, ); + assertEquals( + paths.some((value) => value === ".codex" || value.startsWith(".codex/")), + false, + ); const scenarioPrompt = (refreshedBody.entries ?? []).find((entry) => entry.path === "scenarios/scenario_a/PROMPT.md" );