{"record":{"id":"694581fcd8199b77","repo":"langchain-ai/deepagents","slug":"offload-result-has-no-status","errorCode":null,"errorMessage":"Offload result has no status.","messagePattern":"Offload result has no status\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/client/remote_client.py","lineNumber":137,"sourceCode":"    `KeyError` reported as a generic reporting failure for an offload the server\n    already committed.\n\n    Args:\n        result: The `result` object from a `complete` operation response.\n\n    Returns:\n        The same mapping, once its required fields are known to be present.\n\n    Raises:\n        RuntimeError: If a required field is missing or has the wrong type.\n    \"\"\"\n    if not isinstance(result, dict):\n        msg = \"Offload server completed without a typed result.\"\n        raise RuntimeError(msg)  # noqa: TRY004  # protocol fault, not a type misuse\n    status = result.get(\"status\")\n    if not isinstance(status, str) or not status:\n        msg = \"Offload result has no status.\"\n        raise RuntimeError(msg)\n    # Statistics are only meaningful (and only read) for a committed compaction.\n    if status == \"compacted\":\n        for field in _OFFLOAD_RESULT_INT_FIELDS:\n            value = result.get(field)\n            if not isinstance(value, int) or isinstance(value, bool):\n                msg = (\n                    f\"Offload result field {field!r} must be an integer, got \"\n                    f\"{type(value).__name__}.\"\n                )\n                raise RuntimeError(msg)  # noqa: TRY004  # protocol fault\n    return cast(\"OffloadResult\", result)\n\n\ndef _require_thread_id(config: Mapping[str, Any] | None) -> str:\n    \"\"\"Extract and validate that `thread_id` is present in config.\n\n    Args:\n        config: Config dict with `configurable.thread_id`.","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/client/remote_client.py#L119-L155","documentation":"After confirming the offload result is a dict, `_validated_offload_result` requires a non-empty string `status` field; a missing, `None`, empty, or non-string `status` raises `RuntimeError` with this message. The status drives downstream handling (e.g. `compacted` vs failed), so an absent status makes the result unusable.","triggerScenarios":"The offload server's completed response dict lacks `status`, or contains `\"\"`/`null`/a non-string value, when `aoffload` validates the result.","commonSituations":"Server bug omitting the field on some code path; partial schema change where status was renamed; intermediary truncating JSON; mismatched client/server versions.","solutions":["Update the server (or client) so both sides agree the response includes a non-empty `status` string.","Check server logs for the code path that produced the result without a status.","Capture and inspect the full JSON response to confirm which field is missing/renamed.","Retry the offload after fixing; report persistent cases as a protocol bug."],"exampleFix":"// before: status omitted on failure path\nreturn {\"error\": err}\n// after: always include status\nreturn {\"status\": \"failed\", \"error\": err}","handlingStrategy":"validation","validationCode":"def has_status(result: dict) -> bool:\n    status = result.get(\"status\")\n    return isinstance(status, str) and status != \"\"\n# check before consuming the result\nif not has_status(result): request_missing_status_from_server()","typeGuard":"def has_status(result: object) -> TypeGuard[dict]:\n    return isinstance(result, dict) and isinstance(result.get(\"status\"), str) and bool(result[\"status\"])","tryCatchPattern":"try:\n    result = await aoffload(...)\nexcept RuntimeError as exc:\n    if \"has no status\" in str(exc):\n        log_payload(result_if_any)  # server omitted/renamed status; align schemas","preventionTips":["Always include a non-empty `status` on every server response path, including failures","Watch for renames of the `status` field during schema changes","Contract-test the offload response schema"],"tags":["offload","protocol","validation","remote"],"backgroundTag":"invalid-server-response","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}