HKUDS/Vibe-Trading · error · ValueError

manifest path {manifest_path} could not be resolved: {exc}

Error message

manifest path {manifest_path} could not be resolved: {exc}

What it means

load_manifest resolves the given manifest path with Path.resolve() and wraps OSError/RuntimeError (symlink loops, permission issues on resolution, filesystem errors) into a ValueError. This fires before any allowed-root or content checks, meaning the path itself couldn't even be canonicalized.

Source

Thrown at agent/src/tools/strategy_discovery_tool.py:455

    Two shapes are accepted (plan §4.6): a JSON object with a ``runs`` array
    (``{"runs": [{strategy_id, run_dir, position_size?}, ...]}``) or a bare
    JSON array of the same entries. The manifest itself must sit inside the
    runtime root or an allowed run root (same containment discipline as the
    run_dir entries it names).

    Raises:
        ValueError: With an operator-facing message when the path escapes the
            allowed roots, the file is missing or unreadable, is not valid
            JSON, or has the wrong shape. The agent tool and the CLI share
            this helper so both surfaces report the same failure the same
            way.
    """
    manifest_path = Path(str(path)).expanduser()
    try:
        resolved_manifest = manifest_path.resolve()
    except (OSError, RuntimeError) as exc:
        raise ValueError(
            f"manifest path {manifest_path} could not be resolved: {exc}"
        ) from exc
    if not _manifest_path_allowed(resolved_manifest):
        raise ValueError(
            f"manifest path {manifest_path} is outside the runtime root and "
            "the allowed run roots; place the manifest under one of them "
            "(e.g. next to the runs it lists)"
        )
    try:
        raw = manifest_path.read_text(encoding="utf-8")
    except OSError as exc:
        raise ValueError(
            f"manifest file {manifest_path} is missing or unreadable "
            f"({exc.strerror or 'I/O error'})"
        ) from exc
    try:
        parsed = json.loads(raw)
    except json.JSONDecodeError as exc:

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Check the path manually: run `readlink -f <path>` or Path(path).resolve() in a REPL to reproduce and see the underlying OSError/RuntimeError
  2. Remove/fix broken or looping symlinks in the path chain
  3. Use a plain, direct file path under the runtime root instead of symlink-heavy paths

Example fix

# before
core(manifest_path="/srv/links/self_loop.json", ...)
# after
# fix the symlink: ln -sfn /srv/data/manifest.json /srv/links/manifest.json
core(manifest_path="/srv/data/manifest.json", ...)
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
resolved = Path(manifest_path).expanduser().resolve()  # raises the same errors early
print("resolved ok:", resolved)

Try / catch

try: core(...); except ValueError as e: report e and ask the operator to fix the path/symlinks

Prevention

When it happens

Trigger: Passing a path containing a symlink loop (ELOOP -> RuntimeError), a path component on an inaccessible filesystem, or a path with an overlong/invalid encoding causing OSError during resolve(); e.g. manifest_path="/tmp/loop/link.json" where link points to itself.

Common situations: Broken symlinks created by deployment scripts; containerized runs where a mounted path disappeared mid-flight; deeply nested or OS-limit-exceeding paths.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/5154cd61b2274772. Report an issue: GitHub.