Skip to content

种子配置默认锁定,时区跟随当前 SOCKS5 - #612

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

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

Conversation

@dofastted

@dofastted dofastted commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • 种子配置默认锁定。解锁要确认,播种再确认一次,写入后重新锁定。
  • 时区和语言提供 en、cn、jp。空 TZ 表示跟随当前 SOCKS5,展示当前代理时区,播种时才写入;选择固定时区后不再跟随。
  • 同分支还包含当前槽 settings.json 的真实展示、可编辑 env、调试上传日志,以及日志只保留最近 40 行并去掉身份字段。

Test plan

  • pnpm -C web exec vitest run src/features/vm/seed-settings.test.ts
  • pnpm -C web exec tsc -b
  • 部署后验证。当前线上还没有这三个提交。

不合并。


Note

High Risk
Touches slot container mounts, egress lifecycle, and fleet upgrade paths; a failed Go service refresh can leave stale kin-egress serving traffic while VMs look upgraded.

Overview
Reworks the VM seed tab so admins see and edit what is actually on the slot (settings.json env rows, claude.setting text, reject flags) with lock → confirm → 播种 flow, 2s polling for telemetry config vs process state, optional debug upload log, and empty TZ meaning follow current SOCKS5 at save time.

Adds service-only fleet updates for Go kin-worker / kin-egress: persistent per-slot slot-bin mounted at /opt/kin-live, layout v3, legacy container rename-and-replace migration, fleet-update / install / panel upgrade hooks to publish binaries and restart telemetry + egress without rebuilding VMs. Hardens kin-egress when binaries are replaced or PID files lie.

Protocol / routing: pins Anthropic betas across thread continue turns; propagates auto_compact_window from panel compatibility and caller env into CLI hops and kernel.json; derives mid-conversation output-config beta when thread is present.

Backend seed API reads/writes claude_setting, toggling telemetry on a running slot triggers targeted telemetry fleet refresh instead of full slot reload; Go telemetry sidecar writes redacted rolling upload logs for ?debug=1.

Reviewed by Cursor Bugbot for commit 7ed4586. 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 不再用策略默认串填补不存在的文件。空文件仍返回空串,策略字段保持独立。
settings.json 的 env 改成输入框,播种时写回。缺少 CLAUDE_CODE_ATTRIBUTION_HEADER 时默认 0。
默认不拉取。打开后读取本槽 telemetry-upload.log,sidecar 在每次上传后追加正文。
theme 可编辑并随播种写回。autoUpdates 与 grove_enabled 由播种固定,只读显示,不再被环境项过滤掉。
落盘前去掉邮箱、账号、组织和设备标识。超过四十行时原子替换,不再无限追加。
调试开关会改变查询键。保存成功按种子前缀失效,避免日志继续显示旧记录。
batch 日志改为 PostBatch 发出的 BatchRequest。身份字段仍在包装内删除。
解锁和播种都要确认。时区与语言提供 en、cn、jp;时区也可以改成当前 SOCKS5 的时区。
TZ 为空表示跟随。展示用当前代理时区,播种时才写入;代理时区变化后下一次播种跟着变。
空 TZ 保持跟随,但时区选择不被禁用。选中 en、cn、jp 后写入固定值。

Copy link
Copy Markdown
Owner Author

发版已拒(同 #606/#610 厨房水槽,fix/remote-slot-refresh dirty)。勿合、勿 tip。

— vm2api代码

Copy link
Copy Markdown
Owner Author

主聊已授权关闭并删除 fix/remote-slot-refresh。

勿合。 迁移只走 #605;协议(auto_compact)只走 #607;种子增量只走修好的 #611;「锁定 + TZ 跟 SOCKS5」等 #611 修好后从 tip 叠 #611 新开干净 PR。

勿 tip。

— vm2api代码

@dofastted dofastted closed this Oct 19, 2026
@cursor
cursor Bot deleted the fix/remote-slot-refresh branch October 19, 2026 14:07

@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 5 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 7ed4586. Configure here.

const out = applyRequiredSeedEnv(env, pol)
// 2.1.283+ sends x-claude-code-prompt-id only when this is set. Default on.
out.CLAUDE_CODE_GATEWAY_HINT_HEADERS = '1'
if (out.CLAUDE_CODE_ATTRIBUTION_HEADER == null) out.CLAUDE_CODE_ATTRIBUTION_HEADER = '0'

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.

Seed TZ and locale discarded

High Severity

The seed form now writes TZ, LANG, and LC_ALL through extra_env, including filling an empty TZ from the current SOCKS5 zone. buildSlotSettingsEnv then overwrites those keys from vm.timezone and vm.locale (locale always has a fallback), so a seeded zone or language does not land in settings.json. Follow-proxy and a pinned zone both lose to the slot identity values.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ed4586. Configure here.

concurrency: 1,
routing: ctx.routingConfig,
})
service = report.items?.[0] || report

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.

Seed PUT restarts egress

High Severity

Toggling telemetry on seed PUT now runs fleet action: 'telemetry'. That path always restarts kin-egress and, on nodes, may migrate/recreate slot containers. Seed writes are supposed to stay a service-status payload without bouncing egress or reloading the slot. A telemetry switch can drop the slot’s proxy path and, for unmigrated node slots, replace the container.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ed4586. 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 live-bin migration misfires

High Severity

needsLegacyServiceMigration only looks for a read-only bind at /opt/kin-live. Cluster KVM slots mount slot-bin at /opt/kin-guest/opt/kin-live, so they always look legacy. Telemetry updates then recreate the runner and attach binaries at /opt/kin-live instead of the guest payload path, which can bounce the VM and leave kin-worker off the path startRemoteTelemetry uses.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ed4586. Configure here.

toast.success('已播种')
await qc.invalidateQueries({
queryKey: vmSeedQueryOptions(id).queryKey,
queryKey: ['panel', 'vm', id, 'seed'],

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.

Seed toast ignores service failure

Medium Severity

Seed PUT now always returns HTTP 200 and reports sidecar/fleet outcome in service. The save mutation always toasts 已播种 on HTTP success and never reads service.ok. A failed telemetry restart still looks like a full seed success in the panel.

Fix in Cursor Fix in Web

Triggered by learned rule: Seed GET honest files; PUT 200 on sidecar fail

Reviewed by Cursor Bugbot for commit 7ed4586. Configure here.

telemetryEnabled(draft) !== telemetryEnabled(saved) ||
REJECT_FLAGS.some(([k]) => !!draft[k] !== !!saved[k])
setDraft(seedDraftOf(seed))
}, [seed])

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.

Seed poll resets dirty draft

Medium Severity

The seed card copies seed into draft on every seed identity change, and the seed query now refetches every 2s on that tab. Unlocking and editing is wiped whenever GET payload changes, including when debug upload logs grow. Dirty edits are not preserved.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 7ed4586. Configure here.

dofastted added a commit that referenced this pull request Oct 19, 2026
从 tip(#611)干净重做 #612 拆分:解锁/播种确认;时区/语言 en/cn/jp;跟随 SOCKS5 经 timezone_follow_proxy,不经 extra_env。

不含 egress/migration/auto_compact/thread-betas/VERSION。
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