NousResearch/hermes-agent · error · Error

Corrupt zip: bad local file header.

Error message

Corrupt zip: bad local file header.

What it means

Error "Corrupt zip: bad local file header." thrown in NousResearch/hermes-agent.

Source

Thrown at apps/desktop/electron/vscode-marketplace.ts:255

    const nameLen = buf.readUInt16LE(offset + 28)
    const extraLen = buf.readUInt16LE(offset + 30)
    const commentLen = buf.readUInt16LE(offset + 32)
    const localOffset = buf.readUInt32LE(offset + 42)
    const name = buf.toString('utf8', offset + 46, offset + 46 + nameLen)

    records.set(name, { method, compressedSize, localOffset })
    offset += 46 + nameLen + extraLen + commentLen
  }

  return records
}

/** Inflate a single entry to a string. */
function extractEntry(buf, record) {
  // The local header's name/extra lengths can differ from the central record,
  // so re-read them here to locate the compressed payload.
  if (buf.readUInt32LE(record.localOffset) !== 0x04034b50) {
    throw new Error('Corrupt zip: bad local file header.')
  }

  const nameLen = buf.readUInt16LE(record.localOffset + 26)
  const extraLen = buf.readUInt16LE(record.localOffset + 28)
  const dataStart = record.localOffset + 30 + nameLen + extraLen
  const data = buf.subarray(dataStart, dataStart + record.compressedSize)

  // 0 = stored, 8 = deflate. Theme files are one or the other.
  return record.method === 0 ? data.toString('utf8') : zlib.inflateRawSync(data).toString('utf8')
}

/** Normalize a package.json theme path to its zip entry name. */
function themeEntryName(themePath) {
  const clean = String(themePath).replace(/^\.\//, '').replace(/^\//, '')

  return `extension/${clean}`
}

View on GitHub (pinned to c896c09c42)

Solutions

  1. Re-download the package; the zip is corrupt.
  2. Verify the downloaded file size/hash matches the Marketplace artifact.
  3. Retry on a network path that does not rewrite or buffer binary downloads.

When it happens

Trigger: Thrown at apps/desktop/electron/vscode-marketplace.ts:255 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14). Data as JSON: /api/errors/1fd0c10825db0606. Report an issue: GitHub.