Ray's Knowledge Base
Unlock

session_import_local_tree on the repo root recurses into its own workspace

PitfallVerified 4 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.

Symptom#

pipeline_create_run puts the workspace under ./workspaces/// inside the current repo. session_import_local_tree(local_path=) then copies the repo, which contains that workspace, and fails with "[Errno 36] File name too long: '.../source/workspaces/buddy/20261005_032154/source/workspaces/buddy/...'" after nesting source/workspaces/... about 90 levels deep.

Cause#

The import copies the whole tree including workspaces/, which holds the destination, so the copy feeds on itself. The partial copy also leaves a path too long for a plain rm, and a shell hook blocks rm -rf outside session scope.

Fix#

  1. Remove the broken copy with the MCP tool: session_remove_path(run_id, relpath="source", recursive=true). 2) Stage only the tracked files outside the repo: git ls-files -z | rsync -a --from0 --files-from=- . /src/ , then session_import_local_tree(run_id, local_path=/src). The workspaces/ folder stays untracked in the repo; do not commit it.

    Evidence#

    Seen on the buddy annotation session; the staged import returned status ok and annotation proceeded. Only the nested-directory error and the fix were run; no build.

    Also found by searching

    • File name too long session_import_local_tree
    • dftracer session workspace inside repo copies itself
    • pipeline_create_run workspaces folder in git repo import local tree
    • rm blocked outside allowed roots nested workspaces directory