Skip to content

Releases

0.4.1 — aria2 缺失要说出来

Choose a tag to compare

@Jestions-dev Jestions-dev released this 15 Nov 06:55

0.4.1 — 没装 aria2 这件事,得说出来

补丁版。修的不是功能,是信息。

问题

没有 aria2 时,传输层会静默降级到 Node 单流。功能完全正常,速度大约只有并发的 1/10。

所以新装的人不会怀疑自己漏装了什么 —— 他会认为"DLS 就这速度",然后卸载。

改了什么

  • 缺 aria2 现在打 warn(原来打 info,宿主日志里基本看不到)
  • 警告里带按平台的安装命令:winget install aria2.aria2 / sudo apt install aria2 / sudo dnf install aria2 / sudo pacman -S aria2 / brew install aria2
  • download_status 能看出走的哪条通道 —— health().transport 会给出 mode、aria2Missing、hint
  • 降级行为没变:仍然能下,仍然不抛错。只是不再沉默

安装

dsh plugin add dsh-dl-server@0.4.1

验证

test/aria2-hint.test.mjs 五个用例,含"临时清空 PATH 走降级路径再还原"。全量 48/48 通过。

没做的事

没有把 aria2 打进 npm 包。六份二进制压缩后约 15 MB,而且 aria2 是 GPLv2 —— 混进 MIT 包要连带源码与许可声明。首次运行自动下载留到 0.5 再考虑。

完整说明:SPEC.md §11.4

DLS v0.3.1 — pause/resume race fixed

Choose a tag to compare

@Jestions-dev Jestions-dev released this 10 Nov 04:52

What was broken

pause() then resume() on a job whose transfer had not finished unwinding left it stuck in paused forever.

Two writes raced:

  1. pause() parks the job as paused
  2. the aborted transfer's handler ran #stopAs(host_restart) and wrote paused again — over the queued state a concurrent resume() had just set
  3. the scheduler never saw a queued job, so nothing restarted

The fix

  • #run only parks a job that is still running
  • #stopAs refuses to touch a job nobody is running

How it was found

test/acceptance.test.mjs — the ten acceptance criteria from SPEC §12, written today against a real HTTP server and the real transport. Criteria 2–8 had no automated coverage until now; the race surfaced on the first honest run.

Tests

30 offline cases, 7 of them the SPEC acceptance list.

node --test      # 30 pass

DLS v0.3.0 — de-duplication and mirror self-verification

Choose a tag to compare

@Jestions-dev Jestions-dev released this 10 Nov 04:31

New

Queue de-duplication One destination is never fetched twice. Same source + same path returns the running job; if that job already finished and its file is still on disk, the finished job is returned instead. A different source claiming the same path fails with dest-in-use rather than starting a second writer.
Mirror self-verification A mirror is HEADed before use: the length must equal the origin's, and when the origin advertises an ETag the mirror's must match after normalisation (W/"x" == x). Mirrors that fail are dropped and logged.

Behaviour worth knowing

{ "ok": true, "jobId": "J#12", "state": "completed", "dest": "D:\\a.bin", "deduplicated": true }

deduplicated: true appears when an existing job answered the request. The ownership rule is unchanged — the reused job still belongs to the session that started it, so another session can wait on it but cannot pause or cancel it.

A deleted file does not count as "already downloaded": the job is reused only while the file is still on disk, so a fresh download happens when it is not.

The honesty clause

Length and ETag are what a mirror claims. A malicious mirror can copy the origin's ETag and serve different bytes of the same size, and this check will accept it. What it does catch is the everyday failure: a mirror holding an older build, or answering with an HTML error page.

Only sha256 proves content. Mirrors are a fallback, not a guarantee.

Also fixed

Fairness had a bias: every scheduling pass started from the first session in iteration order, so the session served last kept losing ties. A rotating cursor now sends it to the back of the next pass.

Tests

23 offline cases (10 new here). No network, no aria2, no DSH needed.

Install

dsh plugin add dsh-dl-server@0.3.0

DLS v0.2.0 — mirrors, cooldown, size-aware concurrency, fairness

Choose a tag to compare

@Jestions-dev Jestions-dev released this 10 Nov 04:07

What's new

Mirror expansion GitHub Releases / HuggingFace / raw.githubusercontent / PyPI URLs gain a fallback mirror automatically. The original always stays first, and mirrors are only appended — never substituted.
Mirror cooldown Two consecutive failures on a host parks it for 10 minutes. Kept in memory only, so a restart clears it rather than turning a blip into a permanent ban.
Size-aware concurrency Under 1 MB skips aria2 entirely, 1–8 MB runs 4 connections, 8 MB and up gets 16. The size comes from a 5-second HEAD probe; if it fails the planner stays conservative at 8.
Session fairness When two sessions are queuing at once, each is capped at half the slots and the scheduler round-robins between them. A lone session still gets every slot.
Cumulative disk budget Enqueue now sums what already-queued jobs still need, so twenty "it fits" enqueues cannot quietly fill the disk.
Failures are loud Checkpoint write errors are counted and surfaced in download_status under storage. An unwritable destination is refused before the transfer starts.

Why storage appears in the output

A failing checkpoint means the next resume rewinds to a stale offset, which corrupts the file. v1 swallowed that write with .catch(() => {}). Now:

"storage": { "errors": 3, "lastError": "J#12: storage is read-only", "lastAt": 1794283232002 }

errors: 0 when everything is healthy.

Also fixed

Lifecycle writes (#fail, #stopAs, #finish, orphan cleanup, boot recovery) now go through a non-throwing helper. A broken storage used to surface as an exception from close(), which took down the shutdown path. A test exposed it.

Tests

13 offline cases, 10 of them new for this release. No network, no aria2, no DSH required.

node --test     # 13 pass

Install

dsh plugin add dsh-dl-server@0.2.0

Or in the UI: Settings → Plugins → Install a third-party plugin → Add plugin, and type dsh-dl-server@0.2.0.

Mirrors are best-effort: they cannot prove they serve the same bytes. Only sha256 can. The cooldown just stops dead hosts from being retried forever.

DLS v0.1.1 — fix: services stayed pending

Choose a tag to compare

@Jestions-dev Jestions-dev released this 10 Nov 03:43

What broke

0.1.0 declared @deepseek-ai/dsh-storage-domain under dependencies. pnpm then installed a second copy of it inside the plugin. The host runs its own copy, so the injected storageDomain service no longer matched, and the plugin never mounted — every service stayed pending.

Reported by a user in the comments of the release video.

The fix

- "dependencies": {
-   "@deepseek-ai/cordis": "~4.1.0",
-   "@deepseek-ai/dsh-storage": "^0.2.2-rc.1",
-   "@deepseek-ai/dsh-storage-domain": "^0.2.2-rc.1",
-   "zod": "^4.4.3"
- }

+ "dependencies": { "zod": "^4.4.3" },
+ "peerDependencies": {
+   "@deepseek-ai/dsh-storage-domain": ">=0.2.0-rc.1 <0.3.0-0"
+ },
+ "peerDependenciesMeta": { "@deepseek-ai/dsh-storage-domain": { "optional": true } },
+ "engines": { "node": ">=20", "dsh": ">=0.2.1-rc.1 <0.3.0-0" }

Also dropped @deepseek-ai/cordis and @deepseek-ai/dsh-storage entirely — the plugin never imported them.

Verified

Installed from the tarball into a clean profile:

deps                  zod only
duplicate storage-domain   none
bundles                    @deepseek-ai/dsh-base, dsh-dl-server

Install

dsh plugin add dsh-dl-server@0.1.1

Or in the UI: Settings → Plugins → Install a third-party plugin → Add plugin, and type dsh-dl-server@0.1.1.

⚠️ Use the explicit version. pnpm caches registry metadata, and without it you may still resolve 0.1.0.

Known gaps (next)

  • no queue de-duplication: two sessions enqueueing the same file start two jobs (#v1.2)
  • concurrency is always 16 regardless of file size (#v1.1)

DLS v1 — persistent, session-aware download queue

Choose a tag to compare

@Jestions-dev Jestions-dev released this 08 Nov 12:23

DLS v1 — dsh-dl-server@0.1.0

A download server for DeepSeek Harness. Not another blocking download_file tool — a persistent, session-aware queue.

DLS is all you need.

Why not just one tool function

Every existing DSH downloader is a single tool that blocks until the file lands. They make downloads fast; they don't solve three things:

  • the download dies when the session or the turn ends
  • there is no queue, no pause, no resume
  • nothing survives a restart

DLS is the queue layer, not the transport layer.

Seven tools

Tool What it does
download_enqueue Queue a file, return a J#1042 id immediately
download_status List every job; bytesDone / speedBps / etaSeconds are live
download_wait Block until terminal state or timeout
download_pause Stop mid-flight, keep the partial file
download_resume Continue from the checkpoint
download_cancel Abort and drop the job
download_cleanup Remove records; only all touches downloaded files

Highlights

  • Cross-session visibility, per-session ownership. Every session sees every job. Only the owner may pause, resume or cancel one in flight; anything else gets not-owner. Verified with a real second session.
  • Byte-level resume across restarts. Jobs survive a DSH restart, auto-resume when configured, and the finished file is byte-identical — checked against the ISO CD001 magic after two real restarts.
  • Transport with fallback. aria2 with 16 split connections when available, a Node single-stream implementation otherwise (with Range resume and .part handling).
  • Cleanup that defaults to safe. allWithoutFiles removes finished records and cache files but never the downloads themselves.
  • Failures are values. Domain errors come back as { ok: false, code, message }, not exceptions.

Install

dsh plugin add dsh-dl-server

or from source:

dsh plugin add github:Jestions-dev/dsh-download-server

Installing from a local directory (dsh plugin add link:...) does not register the plugin in dsh.profile.bundles. Add it there by hand or it will never mount.

Requirements

  • DSH 0.2.1-rc.5 or newer
  • aria2c on PATH, in Program Files, or via DLS_ARIA2C_PATH — optional, the plugin falls back to a single-stream transport

Measured

Same file, same machine, wired 500 Mbps link:

Source Single connection 16 connections DLS
TUNA (unthrottled, 1.99 GB) 43.98 MB/s 54.20 MB/s 61.08 MB/s
HuggingFace (per-connection capped, 255 MB) 1.00 MB/s 4.30 MB/s 6.96 MB/s

The gain from splitting depends entirely on the source: ~1.4× when the mirror already saturates the link, 7× when the host throttles each connection.

Known limitations

  • No mirror table yet — a slow source stays slow (~v1.1)
  • No torrent, no content-addressed dedupe, no pre-execute interception of shell downloads (~v2)
  • No GUI panel; user actions do not echo back to the agent (~v3)

Documentation

中文说明 · Full spec