{"record":{"id":"d43573a0f9b2a8f9","repo":"github/spec-kit","slug":"response-declared-content-length-bytes-exceedin","errorCode":null,"errorMessage":"response declared {content_length} bytes, exceeding the {max_bytes}-byte workflow size limit","messagePattern":"response declared (.+?) bytes, exceeding the (.+?)-byte workflow size limit","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/specify_cli/workflows/_commands.py","lineNumber":447,"sourceCode":"    time) so tests can override the effective limit via monkeypatching the\n    module attribute.\n    \"\"\"\n    if max_bytes is None:\n        max_bytes = _MAX_WORKFLOW_YAML_BYTES\n    content_length = None\n    getheader = getattr(response, \"getheader\", None)\n    if callable(getheader):\n        try:\n            raw_length = getheader(\"Content-Length\")\n        except Exception:\n            raw_length = None\n        if raw_length is not None:\n            try:\n                content_length = int(raw_length)\n            except (TypeError, ValueError):\n                content_length = None\n    if content_length is not None and content_length > max_bytes:\n        raise ValueError(\n            f\"response declared {content_length} bytes, exceeding the \"\n            f\"{max_bytes}-byte workflow size limit\"\n        )\n\n    chunks: list[bytes] = []\n    total = 0\n    while True:\n        chunk = response.read(_DOWNLOAD_CHUNK_SIZE)\n        if not chunk:\n            break\n        total += len(chunk)\n        if total > max_bytes:\n            raise ValueError(f\"response exceeds the {max_bytes}-byte workflow size limit\")\n        chunks.append(chunk)\n    return b\"\".join(chunks)\n\n\ndef _workflow_yaml_is_declared(","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/src/specify_cli/workflows/_commands.py#L429-L465","documentation":"Error \"response declared {content_length} bytes, exceeding the {max_bytes}-byte workflow size limit\" thrown in github/spec-kit.","triggerScenarios":"Thrown at src/specify_cli/workflows/_commands.py:447 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Serve a smaller workflow document, or host it locally and pass the file path directly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}