abhigyanpatwari/GitNexus · error · SandboxError

dependency snapshot is empty: {declaration.source}

Error message

dependency snapshot is empty: {declaration.source}

What it means

After copying a declared dependency into its container, no payload entry exists in the manifest - _SnapshotBuilder.copy_descriptor recorded nothing under payload. The dependency source resolved to an empty (or non-capturable) tree, so there is nothing to mount.

Source

Thrown at eval/workflow_bench/task_assets.py:289

                    payload_entry = dependency_builder.entries.get(PurePosixPath("payload"))
                    if (
                        payload_entry is not None
                        and payload_entry.kind == "directory"
                        and PurePosixPath(declaration.target).name == DEPENDENCY_MOUNT_BASENAME
                    ):
                        dependency_builder.ensure_directory(PurePosixPath("payload") / VITE_TEMP_DIR)
                    dependency_entries = dependency_builder.finished_entries()
                    _validate_dependency_symlinks(
                        container,
                        dependency_entries,
                        mount_target=declaration.target_path,
                    )
                    payload = next(
                        (entry for entry in dependency_entries if entry.path == PurePosixPath("payload")),
                        None,
                    )
                    if payload is None:
                        raise SandboxError(f"dependency snapshot is empty: {declaration.source}")
                    dependency_snapshots.append(
                        DependencySnapshot(
                            source=declaration.source,
                            target=declaration.target,
                            snapshot_path=PurePosixPath("dependencies", container_name, "payload"),
                            kind=payload.kind,
                            entries=dependency_entries,
                            total_bytes=dependency_builder.total_bytes,
                        )
                    )
            finally:
                os.close(repo_fd)

            entries = builder.finished_entries()
            manifest_digest = _manifest_digest(entries)
            dependencies = tuple(dependency_snapshots)
            dependency_content_digest, dependency_manifest_digest = _dependency_digests(dependencies)
            if expected_dependency_binding is not None:

View on GitHub (pinned to d540b00184)

Solutions

  1. Confirm the dependency source path in the repo is non-empty before declaring it.
  2. Run install/generation so the source tree is populated.
  3. If empty is legitimately invalid for this dependency, remove the declaration.
Defensive patterns

Strategy: validation

Validate before calling

import os

def assert_dependency_source_nonempty(repo, source):
    root = os.path.join(repo, source)
    if not os.path.exists(root):
        raise RuntimeError(f"dependency source missing: {source}")
    if os.path.isdir(root) and not any(os.scandir(root)):
        raise RuntimeError(f"dependency source is empty: {source}")

Prevention

When it happens

Trigger: A sandbox_dependencies entry whose source resolves to an empty directory (or a path with no capturable entries) is prepared via TaskAssetCache.prepare.

Common situations: Declaring a dependency on node_modules before install; pointing source at an empty/generated folder; a source path that exists but contains only entries the copier skips.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/291be2d605d348d1. Report an issue: GitHub.