{"record":{"id":"e4f8289620be2f3d","repo":"paperclipai/paperclip","slug":"unknown-operation","errorCode":"unknown_operation","errorMessage":"unknown operation: ${String(op)}","messagePattern":"unknown operation: (.+?)","errorType":"error_code","errorClass":"ProtocolError","httpStatus":null,"severity":"error","filePath":"packages/tailscale-https-broker/src/protocol.ts","lineNumber":111,"sourceCode":"      \"malformed_request\",\n      `invalid JSON: ${(error as Error).message}`,\n    );\n  }\n\n  const obj = asObject(parsed);\n\n  if (obj.v !== BROKER_PROTOCOL_VERSION) {\n    throw new ProtocolError(\n      \"unsupported_version\",\n      `unsupported protocol version: ${String(obj.v)}`,\n    );\n  }\n\n  const requestId = requireStringField(obj, \"requestId\", REQUEST_ID_RE, \"malformed_request\", null);\n\n  const op = obj.op;\n  if (op !== \"reserve\" && op !== \"expose\" && op !== \"remove\" && op !== \"list\") {\n    throw new ProtocolError(\"unknown_operation\", `unknown operation: ${String(op)}`, requestId);\n  }\n\n  if (op === \"list\") {\n    assertExactKeys(obj, [\"v\", \"op\", \"requestId\"], requestId);\n    return { op: \"list\", requestId };\n  }\n\n  if (op === \"remove\" || op === \"expose\") {\n    assertExactKeys(obj, [\"v\", \"op\", \"requestId\", \"runtimeId\", \"handle\"], requestId);\n    const runtimeId = requireStringField(obj, \"runtimeId\", UUID_RE, \"invalid_runtime_id\", requestId);\n    const handle = requireStringField(obj, \"handle\", HANDLE_RE, \"malformed_request\", requestId);\n    return { op, requestId, runtimeId, handle };\n  }\n\n  // reserve\n  assertExactKeys(obj, [\"v\", \"op\", \"requestId\", \"runtimeId\", \"listeners\"], requestId);\n  const runtimeId = requireStringField(obj, \"runtimeId\", UUID_RE, \"invalid_runtime_id\", requestId);\n  const rawListeners = obj.listeners;","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/tailscale-https-broker/src/protocol.ts#L93-L129","documentation":"Operation dispatch guard in decodeRequest: the `op` field is not one of reserve/expose/remove/list. ProtocolError('unknown_operation') rejects the frame after requestId was validated, so a malformed or future op cannot reach the command handlers.","triggerScenarios":"Thrown at packages/tailscale-https-broker/src/protocol.ts:111 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Send one of the operations the broker supports; check the client for a typo or version mismatch."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}