The best way to control Claude Code, Codex and more from any computer or phone
fix(server): file metadata lookups skip the server's own state files (#34530)
Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com>
maria committed
Nov 12, 2026 at 00:24 UTC
9c7f6ebf315883fdd7f76fad45ca623c15caaefc
2 files changed
+10
-1
apps/server/src/workspace/WorkspaceFileSystem.test.ts
+8
@@ -290,6 +290,14 @@ it.layer(layerTest, { excludeTestServices: true })("WorkspaceFileSystemLive", (i
290
const error = yield* workspaceFileSystem.readFile(input).pipe(Effect.flip);
291
expect(error).toBeInstanceOf(WorkspacePaths.WorkspacePathOutsideRootError);
292
}
293
+ const metadata = yield* workspaceFileSystem.getMetadata({
294
+ paths: [
295
+ path.join(config.secretsDir, "example.bin"),
296
+ path.join(config.stateDir, "statev2.sqlite"),
297
+ config.stateDir,
298
+ ],
299
+ });
300
+ expect(metadata.entries).toEqual([null, null, { kind: "directory" }]);
301
}),
302
);
303
apps/server/src/workspace/WorkspaceFileSystem.ts
+2
-1
@@ -148,7 +148,8 @@ export const make = Effect.gen(function* () {
148
// path makes Windows sign in to its host with the user's NTLM credentials.
149
if (!path.isAbsolute(expandedPath) || isNetworkPath(expandedPath)) return null;
150
const stat = yield* fileSystem.stat(expandedPath).pipe(Effect.option);
151
- if (stat._tag === "None") return null;
151
+ // Server state files answer like missing paths, as readFile refuses them.
152
+ if (stat._tag === "None" || (yield* isServerInternalPath(expandedPath))) return null;
153
if (stat.value.type === "Directory") return { kind: "directory" } as const;
154
if (stat.value.type !== "File") return { kind: "other" } as const;
155
let mimeType: string | undefined;