github/spec-kit · error · ValueError

response declared {content_length} bytes, exceeding the {max

Error message

response declared {content_length} bytes, exceeding the {max_bytes}-byte workflow size limit

What it means

Error "response declared {content_length} bytes, exceeding the {max_bytes}-byte workflow size limit" thrown in github/spec-kit.

Source

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

    time) so tests can override the effective limit via monkeypatching the
    module attribute.
    """
    if max_bytes is None:
        max_bytes = _MAX_WORKFLOW_YAML_BYTES
    content_length = None
    getheader = getattr(response, "getheader", None)
    if callable(getheader):
        try:
            raw_length = getheader("Content-Length")
        except Exception:
            raw_length = None
        if raw_length is not None:
            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(

View on GitHub (pinned to bf88c9f9a8)

Solutions

  1. Serve a smaller workflow document, or host it locally and pass the file path directly.

When it happens

Trigger: Thrown at src/specify_cli/workflows/_commands.py:447 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/d43573a0f9b2a8f9. Report an issue: GitHub.