You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(agents): session-transport-macos flakes with ENOTEMPTY in gentle-agents teardown #1840
I searched open and closed issues and did not find a report of this problem.
I reviewed this report and removed credentials, tokens, private paths, hostnames, and other sensitive data.
Problem
The session-transport-macos CI job fails intermittently with ENOTEMPTY while a tests/gentle-agents.test.ts case removes its temporary profile directory. It has failed on at least two PRs (#1832 and #1835) in different tests and passed on rerun both times, so it blocks merges for no product reason.
Root cause: session_shutdown persists finished subagent history asynchronously (persist() calls void saveTask(...) into the profile's tasks directory). The test then calls rmSync(profile, { recursive: true, force: true }) right after shutdown. On macOS the late history write can land between the recursive deletion of the children and the removal of the directory, so rmdir sees a non-empty directory.
Steps to reproduce
Run the session-transport-macos job (or node --experimental-strip-types --test tests/gentle-agents.test.ts on macOS) repeatedly.
Observe an occasional failure in a teardown rmSync of a gentle-agents-continue-* or similar temporary directory.
Expected and actual behavior
Expected: test teardown removes its temporary directories reliably.
Actual: Error: ENOTEMPTY, Directory not empty: <tmp>/gentle-agents-continue-XXXX in "a writer continuation without its own section inherits the admitted surfaces end to end" (PR #1835) and in "a subdirectory session cwd and workspace_root ... share one writer key" (PR #1832).
✖ a writer continuation without its own section inherits the admitted surfaces end to end (55.832875ms)
Error: ENOTEMPTY, Directory not empty: <tmp>/gentle-agents-continue-ZJrSQZ
code: 'ENOTEMPTY',
Activity
test(agents): retry teardown removal raced by async history writes