github/spec-kit · error · ValueError

response exceeds the {max_bytes}-byte workflow size limit

Error message

response exceeds the {max_bytes}-byte workflow size limit

What it means

Error "response exceeds the {max_bytes}-byte workflow size limit" thrown in github/spec-kit.

Source

Thrown at src/specify_cli/workflows/_commands.py:460

            try:
                content_length = int(raw_length)
            except (TypeError, ValueError):
                content_length = None
    if content_length is not None and content_length > max_bytes:
        raise ValueError(
            f"response declared {content_length} bytes, exceeding the "
            f"{max_bytes}-byte workflow size limit"
        )

    chunks: list[bytes] = []
    total = 0
    while True:
        chunk = response.read(_DOWNLOAD_CHUNK_SIZE)
        if not chunk:
            break
        total += len(chunk)
        if total > max_bytes:
            raise ValueError(f"response exceeds the {max_bytes}-byte workflow size limit")
        chunks.append(chunk)
    return b"".join(chunks)


def _workflow_yaml_is_declared(
    source_name: str, content_type: str | None
) -> bool:
    """Return whether response metadata explicitly identifies workflow YAML."""
    from urllib.parse import urlparse

    path = urlparse(source_name).path.casefold()
    media_type = (content_type or "").split(";", 1)[0].strip().casefold()
    return path.endswith((".yml", ".yaml")) or media_type in {
        "application/yaml",
        "application/x-yaml",
        "text/yaml",
        "text/x-yaml",
    }

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Reduce the workflow YAML size below the byte limit, or install from a local file.

When it happens

Trigger: Thrown at src/specify_cli/workflows/_commands.py:460 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of github/spec-kit@bf88c9f9a8 (2026-08-14). Data as JSON: /api/errors/f69f99ca4ecdef46. Report an issue: GitHub.