affaan-m/ECC · error · ValueError
unsupported remote content type: {content_type}
Error message
unsupported remote content type: {content_type} What it means
Error "unsupported remote content type: {content_type}" thrown in affaan-m/ECC.
Source
Thrown at skills/continuous-learning-v2/scripts/instinct-cli.py:231
or ip.is_reserved
or ip.is_unspecified
):
raise ValueError(f"remote import host resolves to a non-public address: {host}")
return urllib.parse.urlunparse(parsed)
def _fetch_import_url(source: str, *, max_bytes: int = 2 * 1024 * 1024) -> str:
"""Fetch a validated remote instinct file with bounded size and timeout."""
url = _validate_import_url(source)
req = urllib.request.Request(url, headers={"User-Agent": "ECC-instinct-import/2"})
with urllib.request.urlopen(req, timeout=15) as response:
content_type = response.headers.get("Content-Type", "")
if content_type and not any(
allowed in content_type.lower()
for allowed in ("text/", "markdown", "yaml", "json", "octet-stream")
):
raise ValueError(f"unsupported remote content type: {content_type}")
data = response.read(max_bytes + 1)
if len(data) > max_bytes:
raise ValueError(f"remote import exceeds {max_bytes} bytes")
return data.decode("utf-8")
def _yaml_quote(value: str) -> str:
"""Quote a string for safe YAML frontmatter serialization.
Uses double quotes and escapes embedded double-quote characters to
prevent malformed YAML when the value contains quotes.
"""
escaped = value.replace('\\', '\\\\').replace('"', '\\"')
return f'"{escaped}"'
# ─────────────────────────────────────────────
# Project Detection (Python equivalent of detect-project.sh)View on GitHub (pinned to 01e15490f0)
Solutions
- Serve the instinct file with an allowed Content-Type: text/*, markdown, yaml, json, or application/octet-stream.
- If the server returns HTML (e.g. an error or login page), download the raw file URL instead of a viewer page.
Example fix
# use the raw URL: https://raw.example.com/instinct.md (text/markdown), not an HTML preview page
When it happens
Trigger: Thrown at skills/continuous-learning-v2/scripts/instinct-cli.py:231 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of affaan-m/ECC@01e15490f0 (2026-08-13).
Data as JSON: /api/errors/1aad851908b9476c.
Report an issue: GitHub.