Skip to content

Conversation

@declanjackson
Copy link
Collaborator

@declanjackson declanjackson commented Jan 20, 2026

Fix: Skills directory not transferring to sub-agents

Problem

When a supervisor agent with a skills_dir delegated tasks to sub-agents, the skills directory was not being
transferred to the sub-agent's execution environment for cross-environment transfers.

Root Cause

The upload_files method in CodeExecToolProvider only supported single file transfers for cross-environment
operations (e.g., E2B sandbox to E2B sandbox). When the agent tried to transfer the skills directory:

await state.exec_env.upload_files("skills", source_env=parent_state.exec_env)

The code would call read_file_bytes("skills") which fails because you can't read a directory as bytes. The
transfer silently failed, leaving sub-agents without access to skills.

Additionally, files were being placed in the wrong location (data_analysis/SKILL.md instead of skills/data_analysis/SKILL.md) because the source directory name wasn't being preserved.

Solution

Added two new abstract methods to CodeExecToolProvider:

  • is_directory(path) - Check if a path is a directory in the execution environment
  • list_files(path) - Recursively list all files in a directory

Updated upload_files to handle directories in cross-environment transfers:

  1. Check if the source path is a directory
  2. If so, list all files recursively and transfer each one
  3. Preserve the source directory name when dest_dir is not specified

Other

This PR also updates the tasks in the following examples:

  • examples/browser_use_example.py
  • examples/open_responses_example.py

@declanjackson declanjackson changed the title Fix: e2b to e2b file transfer Fix: cross execution environment file transfer Jan 20, 2026
@declanjackson declanjackson merged commit bb0b64b into main Jan 20, 2026
2 checks passed
@declanjackson declanjackson deleted the fix/e2b_to_e2b_file_transfer branch January 20, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants