From 6b8c463e0059cc808549575fac3e26ae2088b5cc Mon Sep 17 00:00:00 2001 From: Abir Abbas Date: Sat, 31 Oct 2026 07:21:04 -0400 Subject: [PATCH 1/2] test: remote-task session fixtures pass on macOS temporary folders Two #2085 fixtures failed on macOS only. The r8b home was made under /tmp, which macOS links into /private/tmp, and owned conversation storage refuses a recorded binding whose spelling crosses a link, so newAgent stopped with "workspace binding traverses a symbolic link"; the fixture now names its home by its resolved path. The private-task Review and Apply test wrote its returned file inside a copy under the temporary home, where macOS hands a new file its folder's group (wheel under /private/tmp), and Apply refused that group; the fixture now gives that file the process's own group, as #2086's Apply fixtures do. Both failures reproduce on Linux with a home reached through a link and a setgid TMPDIR owned by a secondary group. Co-Authored-By: Claude Opus 5.5 --- internal/session/task_remote_recovery_test.go | 9 ++++++++- internal/session/task_start_r8b_test.go | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/internal/session/task_remote_recovery_test.go b/internal/session/task_remote_recovery_test.go index 45446926ce..57b3cf5168 100644 --- a/internal/session/task_remote_recovery_test.go +++ b/internal/session/task_remote_recovery_test.go @@ -654,12 +654,14 @@ func TestAPrivateTaskRunsElsewhereAndWaitsForLocalReviewAndApply(t *testing.T) { t.Setenv("CODEAF_HOME", t.TempDir()) t.Setenv("CODEAF_PROTOTYPE_WORKSPACE_OWNERSHIP", "1") reached := make(chan struct{}, 1) + var written string remote := &scriptedTaskEngine{start: func(ctx context.Context, spec RunSpec) RunSummary { + written = filepath.Join(spec.Workspace, "private-output.txt") reached <- struct{}{} r := remoteRecordFor(spec) r.Finished, r.Restored = true, true _ = spec.SaveRemote(r, true) - if err := os.WriteFile(filepath.Join(spec.Workspace, "private-output.txt"), []byte("the returned private change\n"), 0600); err != nil { + if err := os.WriteFile(written, []byte("the returned private change\n"), 0600); err != nil { t.Error(err) } _ = spec.Store.CompleteRoot("private change made") @@ -681,6 +683,11 @@ func TestAPrivateTaskRunsElsewhereAndWaitsForLocalReviewAndApply(t *testing.T) { if _, err := os.Stat(filepath.Join(a.config.Workspace, "private-output.txt")); !os.IsNotExist(err) { t.Fatal("private result applied before review") } + // macOS gives a new file its folder's group, and the private copy sits under + // this test's temporary home, so with TMPDIR in /private/tmp the returned + // file is wheel's and Apply cannot carry that group. The fixture takes the + // process's own, as the other Apply fixtures do. + normalizeWorkspaceApplyFixtureMetadata(t, written) review, err := a.ReviewTaskWorkspaceRoot(context.Background(), id, "work") if err != nil { t.Fatal(err) diff --git a/internal/session/task_start_r8b_test.go b/internal/session/task_start_r8b_test.go index 3d33c90777..9daf8acfc2 100644 --- a/internal/session/task_start_r8b_test.go +++ b/internal/session/task_start_r8b_test.go @@ -123,6 +123,12 @@ func remoteStartHome(t *testing.T) { t.Fatal(err) } t.Cleanup(func() { _ = os.RemoveAll(home) }) + // On macOS /tmp is a link into /private/tmp, and owned conversation + // storage refuses a recorded binding whose spelling crosses a link. A real + // home is already canonical, so the fixture names its home the same way. + if home, err = filepath.EvalSymlinks(home); err != nil { + t.Fatal(err) + } t.Setenv("HOME", home) t.Setenv("CODEAF_HOME", home) } From 054adaecf29328d83a6e578c261ce4b341d8c290 Mon Sep 17 00:00:00 2001 From: Abir Abbas Date: Sat, 31 Oct 2026 07:21:30 -0400 Subject: [PATCH 2/2] docs: change entry for the macOS remote-task fixture fix Co-Authored-By: Claude Opus 5.5 --- docs/changes/unreleased/2092-remote-task-fixtures-macos.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 docs/changes/unreleased/2092-remote-task-fixtures-macos.md diff --git a/docs/changes/unreleased/2092-remote-task-fixtures-macos.md b/docs/changes/unreleased/2092-remote-task-fixtures-macos.md new file mode 100644 index 0000000000..bb15992617 --- /dev/null +++ b/docs/changes/unreleased/2092-remote-task-fixtures-macos.md @@ -0,0 +1,7 @@ +--- +kind: internal +title: Remote-task session fixtures pass on macOS temporary folders +pr: 2092 +surface: [engine] +invalidates: [] +---