HKUDS/Vibe-Trading · error · ValueError
Unsupported config file format: {suffix or '<none>'}
Error message
Unsupported config file format: {suffix or '<none>'} What it means
Raised by _read_config_file when the config file suffix is neither .json, .yaml, nor .yml. The loader dispatches purely on file extension, so any other suffix (including no suffix) is rejected before parsing.
Source
Thrown at agent/src/config/loader.py:255
Returns:
The decoded config object as a dictionary.
Raises:
ValueError: If the file format is unsupported, YAML support is
unavailable, or the decoded payload is not an object.
"""
suffix = path.suffix.lower()
text = path.read_text(encoding="utf-8")
if suffix == ".json":
data = json.loads(text)
elif suffix in {".yaml", ".yml"}:
if yaml is None:
raise ValueError("YAML config is not available because PyYAML is missing")
data = yaml.safe_load(text) or {}
else:
raise ValueError(f"Unsupported config file format: {suffix or '<none>'}")
if not isinstance(data, dict):
raise ValueError("Agent config must decode to a JSON/YAML object")
return data
def _merge_agent_config_dicts(base: dict[str, Any], override: dict[str, Any]) -> dict[str, Any]:
"""Merge top-level agent config payloads with MCP-aware server replacement."""
non_mcp_override = {key: value for key, value in override.items() if key != "mcp_servers"}
merged = _merge_dicts(base, non_mcp_override)
override_servers = override.get("mcp_servers")
if not isinstance(override_servers, dict):
if "mcp_servers" in override:
merged["mcp_servers"] = override_servers
return merged
merged_servers = dict(base.get("mcp_servers", {}))View on GitHub (pinned to 80ffdda44c)
Solutions
- Rename the file to end in .json, .yaml, or .yml.
- If the content is JSON in a differently named file, copy it to a .json path.
- Check for stray characters/whitespace in the filename that corrupt the suffix.
Example fix
# before
load_agent_config(Path('config.toml'))
# after
load_agent_config(Path('config.json')) Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
SUPPORTED = {'.json', '.yaml', '.yml'}
def config_path_ok(path: str) -> bool:
return Path(path).suffix.lower() in SUPPORTED Prevention
- Standardize config filenames on .json/.yaml in tooling and templates
- Fail fast in CLI arg parsing on unsupported extensions
When it happens
Trigger: Passing a config path like config.toml, config.conf, config.ini, or a file with no extension to load_agent_config.
Common situations: Renaming configs during migration; symlinks or generated temp files that lose the extension; assuming format detection is content-based.
Related errors
- Feishu QR login requires a JSON agent config; use ~/.vibe-tr
- group_message_buffer_size must be > 0
- SWARM_WORKER_RETRY_MAX_DELAY_S must be greater than or equal
- HTTP MCP servers require an explicit type of 'sse' or 'strea
- stdio MCP servers require a command
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/985dcbf9de2e261e.
Report an issue: GitHub.