abhigyanpatwari/GitNexus · error · SandboxError

sandbox_dependencies entries require only nonblank source an

Error message

sandbox_dependencies entries require only nonblank source and target

What it means

Raised by _sandbox_dependency_declarations for each entry that is not a Mapping, or whose set of keys is not exactly {source, target}, or where either field is not a non-blank string. The harness requires each dependency to declare precisely a source and a target and nothing else — extra keys, missing keys, blank values, or non-string types all fail. The strict key-set check (`set(item) != {"source", "target"}`) prevents typos and stray metadata from silently being ignored.

Source

Thrown at eval/workflow_bench/task_assets.py:574

            if path == other or path in other.parents or other in path.parents:
                raise SandboxError(f"sandbox_copy declarations overlap: {path} and {other}")
    return declarations, tuple(paths)


def _sandbox_dependency_declarations(
    task: Mapping[str, Any],
) -> tuple[_DependencyDeclaration, ...]:
    raw_declarations = task.get("sandbox_dependencies", [])
    if not isinstance(raw_declarations, list):
        raise SandboxError("sandbox_dependencies must be a list")
    declarations: list[_DependencyDeclaration] = []
    for item in raw_declarations:
        if (
            not isinstance(item, Mapping)
            or set(item) != {"source", "target"}
            or not all(isinstance(item[field], str) and item[field] for field in ("source", "target"))
        ):
            raise SandboxError("sandbox_dependencies entries require only nonblank source and target")
        source = str(item["source"])
        target = str(item["target"])
        source_path = PurePosixPath(source)
        target_path = PurePosixPath(target)
        if source_path.is_absolute() or ".." in source_path.parts or not source_path.parts:
            raise SandboxError(f"dependency source must stay inside the repository: {source_path}")
        if target_path.is_absolute() or ".." in target_path.parts or not target_path.parts:
            raise SandboxError(f"dependency target must stay inside the clone: {target_path}")
        _validate_manifest_path(source_path)
        _validate_manifest_path(target_path)
        declarations.append(
            _DependencyDeclaration(
                source=source,
                target=target,
                source_path=source_path,
                target_path=target_path,
            )
        )

View on GitHub (pinned to d540b00184)

Solutions

  1. Use exactly the keys `source` and `target` with non-empty string values; remove any extra keys.
  2. Double-check key spelling — `source` not `src`, `target` not `dest`/`to`/`mount`.
  3. Ensure both fields are present and non-blank strings.
  4. Validate each entry with the provided type guard before prepare() (see typeGuard).

Example fix

// before
{"sandbox_dependencies": [
  {"src": "node_modules", "target": "node_modules", "readonly": true}
]}

// after
{"sandbox_dependencies": [
  {"source": "node_modules", "target": "node_modules"}
]}
Defensive patterns

Strategy: type-guard

Validate before calling

from collections.abc import Mapping

def validate_dependency_entries(task: dict) -> None:
    for i, item in enumerate(task.get("sandbox_dependencies", [])):
        if (
            not isinstance(item, Mapping)
            or set(item) != {"source", "target"}
            or not all(isinstance(item[f], str) and item[f] for f in ("source", "target"))
        ):
            raise ValueError(f"dependency entry {i} must have only nonblank source and target: {item!r}")

validate_dependency_entries(task)

Type guard

from collections.abc import Mapping

def is_valid_dependency_entry(item: object) -> bool:
    return (
        isinstance(item, Mapping)
        and set(item) == {"source", "target"}
        and all(isinstance(item[f], str) and item[f] for f in ("source", "target"))
    )

Try / catch

from eval.workflow_bench.propposer_sandbox import SandboxError

try:
    snapshot = cache.prepare(task, repo=repo, resolved_sha=sha)
except SandboxError as exc:
    if "require only nonblank source and target" in str(exc):
        # fix key names (source/target), remove extras, ensure non-blank
        raise
    raise

Prevention

When it happens

Trigger: An entry like `{"src": "a", "target": "b"}` (typo: src not source), `{"source": "a", "target": "b", "mode": "ro"}` (extra key), `{"source": "", "target": "b"}` (blank source), `{"source": "a"}` (missing target), or `"a:b"` (a string, not a mapping). Also `{"source": 123, "target": "b"}` (non-string).

Common situations: Typo in key names from hand-authoring. Copying a schema from another tool that uses `from`/`to` or `path`/`mount`. Adding an unused `readonly` or `mode` field that the strict check rejects. Blank values from incomplete templating.

Related errors


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