HKUDS/Vibe-Trading · error · ValueError
manifest file {manifest_path} is not valid JSON: {exc.msg} a
Error message
manifest file {manifest_path} is not valid JSON: {exc.msg} at line {exc.lineno} column {exc.colno} What it means
load_manifest parses the manifest bytes as JSON with json.loads; a JSONDecodeError (syntax error such as trailing commas, single quotes, comments, truncated file) is re-raised as ValueError including the parser message plus line/column of the fault. The file was readable but not valid JSON.
Source
Thrown at agent/src/tools/strategy_discovery_tool.py:474
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:
raise ValueError(
f"manifest file {manifest_path} is not valid JSON: {exc.msg} "
f"at line {exc.lineno} column {exc.colno}"
) from exc
if isinstance(parsed, list):
return parsed
if isinstance(parsed, dict):
runs = parsed.get("runs")
if not isinstance(runs, list):
raise ValueError(
f"manifest file {manifest_path} must be a JSON object with a "
"'runs' array or a bare JSON array of run specs"
)
return runs
raise ValueError(
f"manifest file {manifest_path} must be a JSON object with a 'runs' "
"array or a bare JSON array of run specs"
)
View on GitHub (pinned to 80ffdda44c)
Solutions
- Validate the file: python -m json.tool <path> to see the exact syntax error position
- Remove comments/trailing commas, use double quotes, null/false/true literals
- Regenerate the manifest programmatically with json.dump instead of editing by hand
Example fix
# before (manifest.json)
{ "runs": [ {"id": "r1",}, ] }
# after
{ "runs": [ {"id": "r1"} ] } Defensive patterns
Strategy: validation
Validate before calling
import json json.loads(Path(manifest_path).read_text(encoding="utf-8")) # fail fast with line/col
Try / catch
except ValueError as e: surface the line/column from the message to pinpoint the JSON syntax error
Prevention
- Generate manifests with json.dump, never hand-edit
- Run python -m json.tool in CI on manifest artifacts
When it happens
Trigger: Manifest containing trailing commas, unquoted keys, Python-style None/True literals, single-quoted strings, or a truncated file; e.g. a hand-edited manifest with a comment line // runs.
Common situations: Hand-editing manifests in an editor that allows JSON5-style syntax; concatenating JSON files without joining into an array; log truncation cutting the last entry; YAML mistakenly saved with a .json extension.
Related errors
- manifest path {manifest_path} could not be resolved: {exc}
- manifest path {manifest_path} is outside the runtime root an
- manifest file {manifest_path} is missing or unreadable ({exc
- manifest file {manifest_path} must be a JSON object with a '
- run_id must not be empty
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/f71dbcb6f9043698.
Report an issue: GitHub.