Skip to content

feat(workspacedeps): unpinned CLIs, runtime overlays and the redesigned dependency UI - #1143

Closed
sheepbox8646 wants to merge 12 commits into
workspace-deps/04-webfrom
workspace-deps/05-versions-overlays
Closed

feat(workspacedeps): unpinned CLIs, runtime overlays and the redesigned dependency UI#1143
sheepbox8646 wants to merge 12 commits into
workspace-deps/04-webfrom
workspace-deps/05-versions-overlays

Conversation

@sheepbox8646

@sheepbox8646 sheepbox8646 commented Sep 3, 2026

Copy link
Copy Markdown
Member

变更内容

workspace-deps 第 5 层。落实两项产品决定并重做依赖 UI:

不钉版。 agent CLI(Codex、Claude Code)与其他依赖同等管理:安装默认解析上游最新版、可指定版本、check-update 对所有依赖生效、可回滚。删除 required_versionneeds_alignment、启动期钉版校验、agent_dependency_version_mismatch 通知与协议快照同源测试;runtime 自身的握手版本告警保留。

镜像底座+覆盖层。 node/python/uv 保留镜像副本作底座,可安装 managed 覆盖层(Node.js LTS 来自 nodejs.org、CPython 经 uv、uv 来自其 releases),支持更新/回滚,卸载=移除覆盖层回到镜像版本。覆盖层生效靠 PATH 优先级:bridge 对每次 exec 前置 /data/.memoh/deps/bin,direct runtime 与通用 ACP 的 containerPath 同步。

  • catalog:五个依赖新增 check-update.sh;install/update 先在 staging 目录完成并校验,再原子切换,同版本重装不会让 current 悬空(WD-FS-001);descriptions 改为中性文案;docker 测试对真实 workspace 镜像跑 install → check → update → remove(node 24.20.0、python 3.14.7、uv 0.12.9、codex 0.153.0、claude-code 2.1.259 全部通过)。
  • API:install/update/reinstall 接受 { "version"?: string };列表项新增 image_versionoverlay;新增与 bot 无关的 GET /workspace-dependencies/catalog 供 Supermarket 使用;swagger/SDK 再生成。
  • 前端:Bot 页「依赖」tab 平铺(需处理的排前)、只显示已安装、挪到 capability 组(MCP 之后);去掉「镜像自带」标签与「不可卸载」说明,名称与描述按依赖本地化;所有依赖同一套动作(安装/更新/重装/卸载/回滚/查看脚本/检查更新,由后端 actions 决定);安装/更新确认框提供可选版本输入;Supermarket 新增「依赖」tab,选择 Bot(与 target)安装并复用进度对话框;@memohai/icon 新增 Node.js/Python/uv 图标,按 catalog icon 标识映射。

截图与操作步骤

A. Bot 页「依赖」tab

  1. 进入 bot → 侧栏 capability 组的「依赖」:平铺列表,图标、版本、状态、本地化描述,无来源标签。
    v5-deps-01
  2. 空态(无已安装依赖时):引导「去 Supermarket 添加」。
    v5-deps-02
  3. 有更新时行内主按钮「更新」(此图 mock 上游 latest)。
    v5-deps-06a
  4. 更新确认框:可选「版本」输入,留空即最新。
    v5-deps-06

B. Supermarket「依赖」tab → 安装到 Bot(真实安装 Node.js 覆盖层)

  1. /settings/supermarket?tab=dependencies:catalog 全部可安装依赖。
    v5-market-01
  2. Node.js 卡片「安装到 Bot」:选择 Bot(多 target 时再选 target),版本留空。
    v5-market-02
  3. 安装进度(真实下载 nodejs.org LTS)。
    v5-market-03
  4. 完成:解析到 24.20.0,可「查看 Bot 依赖」。
    v5-market-04
  5. Bot 页里 Node.js 版本已是覆盖层的 24.20.0。
    v5-deps-03
  6. 卸载确认只陈述结果:「将移除 24.20.0,工作区回到 24.14.0」。
    v5-deps-04
  7. 卸载后版本回到镜像的 24.14.0。
    v5-deps-05

C. 启用 Agent 前置检查

缺失时的安装确认框不再展示后端决定的「目标版本」。
v5-agent-01

验证

  • go test ./... 全绿(pre-commit 全量);golangci-lint 涉及包干净;shellcheck 20 个脚本零告警。
  • go test -tags dockertest ./internal/workspacedeps/:五个依赖对真实 memohai/workspace:debian 镜像 install/check-update/同版本 update/remove 全部通过。
  • 第二套 dev 环境真实验证:catalog 接口、覆盖层安装与卸载(上图)、PATH 前置后 node --version 在 exec 中返回覆盖层版本。
  • 前端:vitest 相关 47 例通过;eslint 0 错误;check-ui-contract 新文件零命中;icon 生成产物与源一致。

⚠️ No human QA — this PR has not been verified by a human yet. Remove this line once a human confirms the happy path.

🤖 Generated with Claude Code

https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ

@sheepbox8646 sheepbox8646 changed the title workspace deps/05 versions overlays feat(workspacedeps): unpinned CLIs, runtime overlays and the redesigned dependency UI Sep 3, 2026
sheepbox8646 and others added 12 commits September 3, 2026 17:37
…store

Adds migration 0146 (mirrored into 0001), team-scoped sqlc queries and a
Store contract plus its Postgres implementation. The table records intent
per (bot, workspace target, dependency); discovery corrects the observed
columns and a stale reaper recovers interrupted operations.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…ecks

The service owns the install/update/reinstall/remove/rollback state
machine over the runner, writes state.json and shims after each success,
reconciles database intent against discovery (installed / missing /
adopted) and exposes preflight for the enable-agent flow. Agent-class
entries compare against the catalog pin; tool-class entries get a 24h
upstream check worker with per-(dependency, platform) deduplication.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Exposes the dependency service under /bots/{bot_id}/dependencies: list,
preflight, install/update/reinstall/remove as SSE log streams, rollback,
check-updates and a script preview. Adds the workspace_dependency.* error
codes with web locale strings, wires catalog/service/update worker/stale
reaper into the FX graph, runs an agent alignment scan after container
reconciliation, and regenerates swagger and the TypeScript SDK.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Adds the neutral port between direct runtimes and the workspace dependency
manager: drivers declare the catalog dependency and pinned version that
provides their CLI, and resolve the executable through LauncherResolver at
launch time. Also adds the two stable feedback codes for a missing
dependency and a version mismatch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…ager

Codex and Claude Code drivers declare their workspace dependency and pinned
CLI version, resolve the executable through the LauncherResolver before
launching (managed at pin → toolkit at pin → any managed → any toolkit →
PATH) and surface a one-time runtime_notice per thread when the running
copy differs from the pin. A missing copy returns the stable
agent_dependency_missing feedback and starts a background install through
the new background.SpawnManaged task kind. Bot agents API responses now
carry the runtime's dependency requirement, direct agents can be created
disabled, and the toolkit launcher wrappers lose their PATH fallback.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…rivers

Injects the workspace dependency service into the Codex and Claude Code
drivers, validates at startup that every driver's declared dependency
exists in the catalog at the declared pin with the expected launcher
command, projects runtime_notice metadata into UI message args so the web
client can render alignment actions, and makes the panel's alignment
verdict follow the same launcher candidate order the resolver and
preflight use.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Adds the SDK-backed query and SSE composables for the dependency API, pure
status/action/icon helpers with tests, the confirm/progress/script/rollback
dialogs, and the en/zh/ja strings the dependencies tab and enable flow use.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Adds the Dependencies tab on the bot detail page (target picker, workspace
state banner, grouped rows with status badges, install/update/reinstall/
remove/rollback/script actions, streaming progress dialog with background
mode and a needs-attention badge in the sidebar), gates enabling a direct
agent behind a dependency preflight (install-and-enable flow, workspace
not running guidance), and renders the agent_dependency_missing chat error
with a link to the tab and the background install task status.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
… and PATH precedence

Agent CLIs are no longer pinned to the server's protocol snapshot: install
resolves the latest upstream version by default, an explicit version can be
requested, check-update works for every dependency, and the alignment
notice, required-version fields and startup pin validation are gone.
node, python and uv keep the image copy as a baseline and can now install
a managed overlay (LTS Node from nodejs.org, CPython via uv, uv from its
releases) that wins on PATH because the bridge prepends the deps shim
directory to every exec and the direct runtimes do the same. Adds a
bot-independent catalog endpoint for the Supermarket, per-dependency
check-update scripts, and a docker-backed test that installs, checks,
updates and removes every catalog entry against the real workspace image.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…ies tab, icons and version input

The bot page shows installed dependencies as one flat list ordered by
attention, moves the tab into the capability group, drops the provenance
labels and limitation blurbs, localizes names and descriptions, and lets
every dependency use the same action set (install/update/reinstall/remove/
rollback/script/check-update) with an optional version input. Supermarket
gains a Dependencies tab backed by the catalog endpoint that installs into a
chosen bot and workspace target with the shared progress dialog. Adds
Node.js, Python and uv marks to @memohai/icon and maps catalog icon
identifiers to them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
@sheepbox8646
sheepbox8646 force-pushed the workspace-deps/05-versions-overlays branch from 840ebf8 to 178ec13 Compare September 3, 2026 09:44
@sheepbox8646

Copy link
Copy Markdown
Member Author

折叠进 #1135/#1137/#1138/#1141,各层 PR 现已自洽。

@sheepbox8646
sheepbox8646 deleted the workspace-deps/05-versions-overlays branch September 3, 2026 12:21
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