Skip to content

[upstream pr #503] fix(runtime): preserve peer worker temporary directories #51

Open

Description

@mengmengmengqiang

[upstream PR Ephemeral-AI-Lab#503] fix(runtime): preserve peer worker temporary directories

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 ENOENT and passes after this fix.
  • Both worker_temp_real.mjs container and worker_temp_real.mjs stdin pass under tools/worktree.py run --timeout 90 with fresh isolated Stores.
  • Existing worker_real.mjs inner, plus runtime transport-order, macos-worker, worker-frames and worker-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, and git diff --check pass.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstream-prMirrored upstream pull request as an issueupstream-syncMirror of Ephemeral-AI-Lab/layerfs upstream

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions