Skip to content

feat(dev-suite): 离线导入 + 断点续传 + MCP 状态文案 l10n(四个兜底) - #24

Merged
tall-1997 merged 4 commits into
mainfrom
fix/devsuite-offline-resume
Oct 14, 2026
Merged

tall-1997 merged 4 commits into
mainfrom
fix/devsuite-offline-resume

Conversation

@tall-1997

Copy link
Copy Markdown
Owner

PR23 落地后的四个可靠性兜底,全部来自实际使用场景:

1. 已装资源再点装配

PR23 已有:探针优先(checkCommand 返回 0 直接跳过,不碰 apt),apt 对已装包也是幂等 no-op。本次在智能体提示词里明确写出「重复装配是无操作,可安全重试」,模型不再瞎猜。

2. 网络受限:离线导入(对标 taixu importArchive)

  • 新增 minis-devsuite-offline-list:打印载荷清单(文件名 + URL + 放置路径)
  • 用户在别的设备下载,放进 /var/minis/shared/offline/(宿主可见共享目录,guest 同路径)
  • 所有 7 个下载点接入 offline_pick(sdk-tools / cmdline-tools / platform / cmake / NDK / flutter / jadx / rustup / llama.cpp 源码 tarball 替代 git clone)——命中本地文件完全跳过网络
  • 套件分区 footer(16 locale)提示离线入口

3. 断点续传(app 被杀后不重头下载)

  • 下载落点从 /tmp/$$.zip(每次重跑必然重下)改为固定 .part 缓存 /var/minis/shared/cache/devsuite/(shared 持久,rootfs 重建也在)
  • curl -C - 跨 app 杀死 / 重启 / 镜像切换续传(镜像代理同一 release 字节,可跨镜像续)
  • 无 Range 镜像(curl rc 33)自动回退从零重试
  • 本地实测四场景全过:全新下载 / 40% 断点续传 / 无 Range 回退 / 离线副本优先(Range-aware 本地 server 验证)
  • 离开装配页后台跑本来就有(自建 SupervisorJob scope + SandboxJobKeepAlive 前台服务);进程被杀这个洞由 .part 缓存补上

4. 文案

  • 插件市场 subtitle 还在宣传 MCP 预设(已移到 MCP 页)→ 改为「开发环境套件、本地工具与在线 OpenAPI 工具」,16 locale 补齐(历史欠账 14 个 locale 从没有过这个 key)
  • 删除死字符串 plugin_market_section_mcp / footer_mcp
  • MCP 服务器状态行与启动失败 Toast 原来是硬编码中文(英文用户看到中文)→ stringResource 化,6 个新 key × 16 locale

智能体暴露

提示词新增可靠性兜底段:探针跳过、断点续传、离线清单、apt 镜像——模型能主动告诉用户而不是道歉。

Four reliability gaps from the field, closed:

1. Already-installed components (user apt'd rg/nodejs themselves):
   covered since PR23 — the probe short-circuits before apt, re-assembly
   is a no-op. Documented in the agent prompt so it says so instead of
   guessing.

2. Network-restricted users: offline import. New
   minis-devsuite-offline-list prints the payload manifest (file names +
   URLs); the user downloads on another device, drops files into
   /var/minis/shared/offline/ (host-visible shared folder), and every
   installer (offline_pick in /usr/local/lib/minis/offline.sh) uses the
   local copy, skipping the network entirely. All seven download sites
   wired: sdk-tools, cmdline-tools, platform zips, cmake, NDK, flutter,
   jadx, rustup, llama.cpp (source tarball replaces the git clone).

3. Interrupted downloads: crash-safe resume. Downloads now land in a
   FIXED .part under /var/minis/shared/cache/devsuite (was /tmp/$$.zip —
   every retry started from zero) and curl -C - resumes across app
   kills, reboots, and even mirror switches (mirrors proxy identical
   release bytes). Range-less mirrors (curl rc 33) fall back to a
   from-zero retry. Verified end-to-end against a local Range-aware
   server: fresh / resume-from-40% / no-range fallback / offline-priority.

   Leaving the install screen was already safe (installer runs in its
   own SupervisorJob scope, not composition) and the shell keeps the
   SandboxJobKeepAlive foreground service — the remaining hole was the
   process dying, which the .part cache now covers.

4. Plugin market copy: subtitle still advertised MCP presets (moved to
   the MCP screen) — reworded to dev suites + local + online tools;
   dead plugin_market_section_mcp/footer_mcp strings removed; the
   hardcoded-Chinese MCP server status line and start-failure toast are
   now proper stringResources in all 16 locales (mcp_status_*).

Agent prompt now carries the full fallback story (probe skip, resume,
offline manifest, apt mirrors) so the model can tell users instead of
apologizing.
@tall-1997
tall-1997 merged commit 2826252 into main Oct 14, 2026
1 check passed
@tall-1997
tall-1997 deleted the fix/devsuite-offline-resume branch October 14, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant