Repository navigation
[upstream pr #503] fix(runtime): preserve peer worker temporary directories #51
Description
[upstream PR Ephemeral-AI-Lab#503] fix(runtime): preserve peer worker temporary directories
- Upstream: fix(runtime): preserve peer worker temporary directories Ephemeral-AI-Lab/layerfs#503
- Type: pull request
- State: OPEN
- Draft: False
- Mergeable: MERGEABLE
- Updated: 2026-10-29
- Upstream labels: -
Original body (excerpt)
Starting a worker for a second LayerFS home deletes the first worker's live temporary directory when they share a temporary parent. The first worker stays alive, but its next fs.write fails to bind its private overlay with ENOENT; workspace.exec output beyond the inline limit also fails when it needs its output spool.
Remove the prefix-wide startup cleanup. Each start already creates a random private directory, and graceful stdin shutdown already removes only that instance's directory. Directories left by abnormal exits remain available for explicit cleanup rather than being deleted by another worker.
Add api/runtime/test/verify/worker_temp_real.mjs, using the real addon, Disposable Store, Docker and daemon. It starts two homes under an isolated shared TMPDIR and checks:
- SDK writes and exact 2,097,153-byte stdout through the first worker after the second starts.
- Both workers' private directories and unrelated retained evidence survive peer startup.
- Stopping the second worker leaves the first operational; graceful stdin shutdown removes its own directory.
- Readiness/shutdown waits are bounded, and failed fixtures are retained.
Validation on Linux/WSL2 with Node 22.19.0 and Rust 1.85.1:
- The new container regression fails on unchanged main with the original overlay-bind
ENOENTand passes after this fix. - Both
worker_temp_real.mjs containerandworker_temp_real.mjs stdinpass undertools/worktree.py run --timeout 90with fresh isolated Stores. - Existing
worker_real.mjs inner, plus runtimetransport-order,macos-worker,worker-framesandworker-docker, pass. - Product boundary guard and all 155 Python tool self-tests pass.
cargo test --locked --offline -p layerfs-node -p layerfs-daemon --all-targets --no-run, warning-denying Clippy for the same targets,cargo fmt --all -- --check, andgit diff --checkpass.
Both startup protocols were exercised on Linux; native macOS and Windows launcher integration was not tested. No SDK documentation changes are included.
Sync note
这是只读镜像,不是上游仓库的替代。上游 issue/PR 仍是唯一真源;本镜像不复制评论、不复制代码分支。
Activity