From a8d0dd4044c2b625a90a861b1abff57d5a7b48b2 Mon Sep 17 00:00:00 2001 From: Quickbeard Date: Tue, 4 Aug 2026 17:09:26 +0700 Subject: [PATCH 1/3] fix(office): honor opts.size when the server omits content-length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two download-path bugs found while reading `codevhub skill office`, plus the README section the command never got. - download.ts: `Number(res.headers.get("content-length"))` is `Number(null)` === 0 when the header is absent, and 0 is finite — so the `opts.size` fallback was unreachable and a chunked response reported `total = offset` (0 on a fresh download), rendering as Infinity%. Read the header first and only coerce when it is present. - office.ts: the progress printer now treats a 0 total like an unknown one, so an empty body can't reintroduce the NaN%/Infinity% line. - office.ts: always-refetch the setup script now drops `