deepseek-ai/deepseek-harness · error · TypeError
{method} response must be a JSON object
Error message
{method} response must be a JSON object What it means
Error "{method} response must be a JSON object" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at python/sdk/src/deepseek_harness/client.py:177
method: str,
params: JsonObject | None,
*,
response_model: type[ModelT],
timeout_seconds: float | None = None,
on_notification: Callable[[Notification], None] | None = None,
notification_filter: NotificationFilter | None = None,
notification_subscription: "NotificationSubscription | None" = None,
) -> ModelT:
result = self._request_raw(
method,
params,
timeout_seconds=timeout_seconds,
on_notification=on_notification,
notification_filter=notification_filter,
notification_subscription=notification_subscription,
)
if not isinstance(result, dict):
raise TypeError(f"{method} response must be a JSON object")
return response_model.model_validate(result)
def notify(self, method: str, params: JsonObject | None = None) -> None:
message: JsonObject = {"jsonrpc": "2.0", "method": method}
if params is not None:
message["params"] = params
self._write_message(message)
def next_notification(self) -> Notification:
item = self._notifications.get()
if isinstance(item, BaseException):
raise item
return item
def subscribe_notifications(
self,
notification_filter: NotificationFilter | None = None,
) -> "NotificationSubscription":View on GitHub (pinned to b150a551b8)
Solutions
- Check the runtime version matches the SDK protocol; the named method must return a JSON object response.
When it happens
Trigger: Thrown at python/sdk/src/deepseek_harness/client.py:177 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/1b5a81c4a6443eb2.
Report an issue: GitHub.