paperclipai/paperclip · error · JsonRpcParseError

PARSE_ERROR

PARSE_ERROR

Error message

Empty message

What it means

Generic input guard in parseMessage: after trimming, the JSON-RPC line is empty (zero length). The plugin SDK's newline-delimited JSON-RPC parser requires each line to carry one message, so an empty line — heartbeat, blank keepalive, or framing bug — is rejected as invalid input before JSON.parse runs.

Source

Thrown at packages/plugins/sdk/src/protocol.ts:2452

    id,
    error: data !== undefined
      ? { code, message, data }
      : { code, message } as JsonRpcError<TData>,
  };
  return response;
}

/**
 * Create a JSON-RPC 2.0 notification (fire-and-forget, no response expected).
 *
 * @param method - The notification method name
 * @param params - Structured parameters
 */
export function createNotification<TMethod extends string>(
  method: TMethod,
  params: unknown,
): JsonRpcNotification<TMethod> {
  return {
    jsonrpc: JSONRPC_VERSION,
    method,
    params,
  };
}

// ---------------------------------------------------------------------------
// Type Guards
// ---------------------------------------------------------------------------

/**
 * Check whether a value is a well-formed JSON-RPC 2.0 request.
 *
 * A request has `jsonrpc: "2.0"`, a string `method`, and an `id`.
 */
export function isJsonRpcRequest(value: unknown): value is JsonRpcRequest {
  if (typeof value !== "object" || value === null) return false;
  const obj = value as Record<string, unknown>;

View on GitHub (pinned to 01ad858492)

Solutions

  1. Send a non-empty message.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/plugins/sdk/src/protocol.ts:2322 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/8ced4e4797d2546d. Report an issue: GitHub.