@@ -7972,24 +7972,29 @@ describe("ClaudeAdapterV2 background wake turns", () => {
79727972 );
79737973
79747974 it.effect.skipIf(process.getuid === undefined)(
7975- "tails foreground Bash output under the cwd the query launched in, not the session's ",
7975+ "tails foreground Bash output under the physical cwd the query launched in",
79767976 () =>
79777977 Effect.scoped(
79787978 Effect.gen(function* () {
79797979 const fileSystem = yield* FileSystem.FileSystem;
79807980 const path = yield* Path.Path;
7981- const launchCwd = yield* fileSystem.makeTempDirectoryScoped({
7981+ const root = yield* fileSystem.makeTempDirectoryScoped({
79827982 prefix: "t3-claude-task-output-cwd-",
79837983 });
7984+ const physicalCwd = path.join(root, "real", "project");
7985+ const launchCwd = path.join(root, "link");
7986+ yield* fileSystem.makeDirectory(physicalCwd, { recursive: true });
7987+ yield* fileSystem.symlink(physicalCwd, launchCwd);
79847988 // The session opens in /workspace; a relative TMPDIR puts Claude's
79857989 // task files under whichever cwd the CLI was launched in. Linux,
79867990 // because Claude Code's macOS build ignores TMPDIR.
7987- const harness = yield* makeWakeHarnessWithOptions({ environment: { TMPDIR: "tmp" } });
7991+ const harness = yield* makeWakeHarnessWithOptions({ environment: { TMPDIR: "../ tmp" } });
79887992 const now = yield* DateTime.now;
79897993 const toolUseId = "toolu_foreground_bash";
79907994 const taskId = "foreground-bash-task";
79917995 const tasks = path.join(
7992- launchCwd,
7996+ root,
7997+ "real",
79937998 "tmp",
79947999 `claude-${process.getuid?.()}`,
79958000 "project",
0 commit comments