{"record":{"id":"b238e69633e29d2f","repo":"earendil-works/pi","slug":"invalid-client-protocol-message","errorCode":null,"errorMessage":"Invalid client protocol message","messagePattern":"Invalid client protocol message","errorType":"exception","errorClass":"ProtocolValidationError","httpStatus":null,"severity":"error","filePath":"packages/protocol/src/codec.ts","lineNumber":43,"sourceCode":"function isProtocolValue(value: unknown, optionalProperty = false, ancestors = new Set<object>()): boolean {\n\tif (value === undefined) return optionalProperty;\n\tif (value === null || typeof value === \"boolean\" || typeof value === \"number\" || typeof value === \"string\") {\n\t\treturn true;\n\t}\n\tif (typeof value !== \"object\" || ancestors.has(value)) return false;\n\tancestors.add(value);\n\ttry {\n\t\tif (Array.isArray(value)) return value.every((item) => isProtocolValue(item, false, ancestors));\n\t\tif (Object.getPrototypeOf(value) !== Object.prototype) return false;\n\t\treturn Object.values(value).every((item) => isProtocolValue(item, true, ancestors));\n\t} finally {\n\t\tancestors.delete(value);\n\t}\n}\n\nexport function parseClientMessage(value: unknown): ClientMessage {\n\tif (!isProtocolValue(value) || !Check(ClientMessageSchema, value)) {\n\t\tthrow new ProtocolValidationError(\"Invalid client protocol message\");\n\t}\n\treturn value;\n}\n\nexport function parseServerMessage(value: unknown): ServerMessage {\n\tif (!isProtocolValue(value) || !Check(ServerMessageSchema, value)) {\n\t\tthrow new ProtocolValidationError(\"Invalid server protocol message\");\n\t}\n\treturn value;\n}\n\nfunction boundedErrorMessage(error: unknown): string {\n\tif (!(error instanceof Error)) return \"Unknown codec error\";\n\treturn error.message.length <= 500 ? error.message : `${error.message.slice(0, 497)}...`;\n}\n\nfunction encodeProtocolMessage<T>(\n\tvalue: T,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/protocol/src/codec.ts#L25-L61","documentation":"Error \"Invalid client protocol message\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/protocol/src/codec.ts:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The client sent a malformed protocol message; fix the client to follow the protocol schema."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}