{"record":{"id":"e049e1b7168d4b02","repo":"openclaw/openclaw","slug":"invalid-snappy-literal","errorCode":null,"errorMessage":"invalid Snappy literal","messagePattern":"invalid Snappy literal","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"extensions/anthropic/claude-desktop-groups.ts","lineNumber":92,"sourceCode":"    offset += 1;\n    const kind = tag & 0x03;\n    if (kind === 0) {\n      let length = tag >>> 2;\n      if (length < 60) {\n        length += 1;\n      } else {\n        const count = length - 59;\n        if (offset + count > compressed.length) {\n          throw new Error(\"invalid Snappy literal length\");\n        }\n        length = 1;\n        for (let index = 0; index < count; index += 1) {\n          length += (compressed[offset + index] ?? 0) * 2 ** (8 * index);\n        }\n        offset += count;\n      }\n      if (offset + length > compressed.length || written + length > output.length) {\n        throw new Error(\"invalid Snappy literal\");\n      }\n      output.set(compressed.subarray(offset, offset + length), written);\n      offset += length;\n      written += length;\n      continue;\n    }\n    let length: number;\n    let copyOffset: number;\n    if (kind === 1) {\n      length = ((tag >>> 2) & 0x07) + 4;\n      copyOffset = ((tag >>> 5) << 8) | (compressed[offset] ?? 0);\n      offset += 1;\n    } else if (kind === 2) {\n      length = (tag >>> 2) + 1;\n      copyOffset = (compressed[offset] ?? 0) | ((compressed[offset + 1] ?? 0) << 8);\n      offset += 2;\n    } else {\n      length = (tag >>> 2) + 1;","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/anthropic/claude-desktop-groups.ts#L74-L110","documentation":"After resolving a literal length, decodeSnappy copies that many bytes; this fires when the literal bytes run past the compressed buffer (source underrun) or the copy would overflow the declared output buffer (destination overrun). Both bounds are checked.","triggerScenarios":"kind===0 literal where offset+length > compressed.length or written+length > output.length — a mismatch between the declared uncompressed size and the actual literal stream.","commonSituations":"A corrupt declared length varint at the snappy frame head; a truncated literal payload; a compaction race.","solutions":["Non-fatal; the .ldb file is skipped.","Re-run with Claude Desktop closed.","If the entire store is unreadable, the leveldb is corrupt; let Desktop rebuild it."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const groups = await readClaudeDesktopCustomGroups(homeDir); // literal-underrun errors are swallowed per file","typeGuard":null,"tryCatchPattern":"try { decodeSnappy(block); } catch { /* skip block whose literal stream mismatches declared length */ }","preventionTips":["Treat a literal-overflow as corruption, not a signal to grow the output buffer.","Re-run discovery after closing Desktop.","Prefer the public API over direct snappy parsing of Desktop files."],"tags":["snappy","binary-parsing","data-integrity"],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}