SIGN IN SIGN UP

MUL-6530: report bytes transferred when a skill bundle download fails (#7386) (#7494)

* fix(daemon): report bytes transferred when a skill bundle download fails (MUL-6530)

A failed bundle download reported `skill bundle unavailable: skill "xlsx"
(id=..., 1101426 bytes) after 30.001s: context deadline exceeded`. Three
things about that text send readers the wrong way:

- The subject is the skill, so the reader concludes the skill is broken and
  re-imports it. The fault is in the link to the API; the skill is fine.
- `1101426 bytes` is ref.SizeBytes — how big the bundle *is* — but sitting
  next to `after 30.001s` it reads as "transferred 1.05 MB in 30s", the
  opposite of the truth when nothing arrived.
- Which skill gets named is just whichever was fetched first, so removing it
  only moves the failure to the next bundle. Reporters play whack-a-mole
  across a set of healthy skills.

Nothing in the message said how much data actually moved, which is the one
fact that separates a dead link (0 bytes — no deadline helps) from a slow one
(partial bytes — a larger deadline would). GitHub #7386 could not be resolved
because of this: the report claims both "0 bytes transferred" and "~18 KB/s"
and there is no way to tell which is true.

Count response-body bytes through a TransferStats sink threaded into the
bundle request, then lead the message with the network, the transfer, and the
host's proxy state:

  skill bundle unavailable: network error downloading skill "xlsx"
  (id=c5034ed6): no response from server after 30.001s (0 of 1.05 MB
  received); no proxy configured (HTTPS_PROXY unset); the skill content is
  not at fault: context deadline exceeded

The proxy note names the variable, never its value — proxy URLs routinely
carry credentials and this string is workspace-visible.

Behaviour is unchanged: the errSkillBundleUnavailable sentinel still wraps the
cause, so taskRunFailureReason keeps mapping it to the retryable platform-side
reason, and the taskfailure legacy shim matches the old "resolve skill
bundles:" prefix rather than this text.

Co-authored-by: multica-agent <github@multica.ai>

* fix(daemon): preserve skill bundle server errors

Co-authored-by: multica-agent <github@multica.ai>

* fix(daemon): distinguish truncated JSON from network errors

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: J <bohan@devv.ai>
Co-authored-by: multica-agent <github@multica.ai>
B
Bohan Jiang committed
1ea6d18f6b79245287dd835f204b5a223d370391
Parent: c8154f9
Committed by GitHub <noreply@github.com> on 8/24/2026, 7:59:23 AM