Skip to content

种子页显示当前槽配置,并修正服务升级后的出口 - #606

Closed
dofastted wants to merge 13 commits into
mainfrom
fix/remote-slot-refresh
Closed

dofastted wants to merge 13 commits into
mainfrom
fix/remote-slot-refresh

Conversation

@dofastted

@dofastted dofastted commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • 种子页按当前槽 settings.json 列出真实配置项;claude.setting 可编辑后播种。遥测开/关和进程状态分开,页签打开时 2 秒刷新。
  • 文件缺失时 GET /seed-settings 的 claude_setting 返回 null,空文件返回空串,不再用默认串冒充。
  • 同分支还包含服务二进制替换后的 kin-egress 重启、旧容器迁移,以及 auto compact 窗口保留。

Test plan

  • pnpm -C web exec vitest run src/features/vm/seed-settings.test.ts src/features/vm/seed-policy-card.test.ts
  • pnpm -C web exec tsc -b
  • node --test test/unit/panel-vm-seed-settings.test.mjs
  • pnpm -C web build
  • 部署后 verify-live.py 1.3.199

VERSION 仍是 1.3.199。这次不跑 wrap-cli/sync。


Note

Medium Risk
槽容器迁移、安装后强制 fleet 刷新与 egress 进程生命周期改动会影响升级与 SOCKS 出口;种子 API 与遥测重启路径变更需回归。

Overview
种子页从策略预设改为以槽内文件为准:展示当前 settings.json 键值、可编辑 claude.setting,播种时写回;遥测配置与进程状态分开显示,种子页签约 2 秒轮询。GET/PUT /seed-settings 对缺失的 claude.setting 返回 null,空文件返回空串;遥测开关变化或显式重启时走 fleet-update 的 telemetry 动作,只重启 Go 遥测与 kin-egress,不重建 VM。

Go 服务升级:kin-worker / kin-egress 经持久化 slot-bin 挂到 /opt/kin-live(槽布局 v3);远程槽可迁移旧容器(重命名保留回滚副本)。安装/面板升级后调用 fleet-services.mjs 刷新各槽二进制。kin-egress 在二进制被替换或 PID 陈旧时会停掉旧进程并重启,避免旧可执行文件仍占端口。

另加路由 auto_compact_window(面板协议页、kernel.json、CLI hop 保留调用方窗口)及 PRODUCT.md / TELEMETRY.md 文档。

Reviewed by Cursor Bugbot for commit 2c62e8e. Configure here.

默认跟随请求模型,调用方窗口经内部字段送到当前 job,面板值可热配置。
窗口在入站清理前提取,再经内部字段进入 native body。
窗口必须在 settings 删除前提取,再传给 native body。
A replaced helper keeps the old inode and the listen port. Ownership now
treats that process as down and the next start or fleet refresh stops every
helper bound to the proxy config, including one the pidfile no longer names.
Fleet refresh now waits for every helper bound to the proxy config to exit
before binding the new one. install.sh no longer treats a failed refresh as
a successful upgrade.
账本列出文件里的真实配置项,claude.setting 可编辑后播种。遥测开/关与进程状态分开,种子页打开时 2 秒刷新。
编辑框只显示当前槽文件的原文。文件缺失或为空都保持空白,不再回退到策略文本或默认串。
GET /seed-settings 不再用策略默认串填补不存在的文件。空文件仍返回空串,策略字段保持独立。
@dofastted

Copy link
Copy Markdown
Owner Author

部署验证通过,PR 保持未合并。

  • VERSION:1.3.199
  • 备份:/opt/vm2api/.deploy-bak-vm2api-1.3.199-20261019T125126Z
  • verify-live.py 1.3.199 --auth-mode master:exit 0
  • 版本文件、Node health、面板 me.version、13 个槽、公开控制台均通过
  • 8 个 kin 容器保持 Up,容器 ID 与部署前一致
  • POST /v1/messages(claude-haiku-4-5)返回 pong
  • 未执行 wrap-cli/sync,Node 只重启一次

密码登录门未用:主机 systemd 环境里没有面板用户名/密码,master 鉴权通过。

Copy link
Copy Markdown
Owner Author

关闭:发版审拒——厨房水槽(含 #604/#605/#600 旧稿与重叠、另捆 auto_compact+种子页,dirty、无 CHANGELOG、无五职绿)。

分支 fix/remote-slot-refresh 不再叠 #600/#604/#605。

@dofastted dofastted closed this Oct 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 2c62e8e. Configure here.


export function needsLegacyServiceMigration(info, { sourceDir = '' } = {}) {
return !!info && !hasBindDestination(info, LIVE_BIN, sourceDir)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KVM telemetry fleet recreates slots

High Severity

Telemetry fleet treats any container without a read-only /opt/kin-live bind as legacy, then remounts slot-bin at that path. KVM runners actually overlay slot-bin at /opt/kin-guest/opt/kin-live, so already-current KVM slots look stale, get stopped and recreated on Go-only refresh, and the new bind sits where the guest never sees kin-worker.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Slot-bin v3; telemetry fleet restarts Go only

Reviewed by Cursor Bugbot for commit 2c62e8e. Configure here.

await rename(docker, name, backup)
let createdId = null
try {
createdId = await create(docker, name, body)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Migration keeps IP on renamed backup

High Severity

Legacy slot migration copies the old IPv4 into the replacement body, then only stops and renames the original container. On user-defined networks a stopped container still holds that address, so create with the same IPAMConfig fails and the rollback path has to put the old container back.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 2c62e8e. Configure here.

@dofastted

Copy link
Copy Markdown
Owner Author

更正:第一次覆盖层的 web/dist 混入了未提交的设置页文案(池账号绑定 TTL…)。已用提交树重新构建并再次部署。

  • 当前备份:/opt/vm2api/.deploy-bak-vm2api-1.3.199-20261019T125729Z
  • 线上入口可达的设置页是已提交文案 绑定记录 TTL…,种子页是 当前槽 settings.json
  • 旧的未引用 dist 资源已删除,目录里不再有未提交文案
  • verify-live.py 1.3.199 --auth-mode master 再次 exit 0:13 个槽,8 个容器 ID 未变,对话 pong
  • 未合并,未跑 wrap-cli/sync

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