Repository navigation
种子配置默认锁定,时区跟随当前 SOCKS5 #612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ce99542
feat(seed): add editable claude.setting to seed policy
dofastted d7edadf
merge: 接入 main 上已合入的 thinking 显示与 kernel/cli payload
dofastted a7c3dfb
feat(vm): update Go slot services without VM rebuild
dofastted 8997953
feat(protocol): 按模型和请求保留 auto compact 窗口
dofastted bb0a63c
fix(protocol): 清理 settings 前保留 auto compact 窗口
dofastted a467c45
fix(web): 去掉协议页未使用的图标导入
dofastted acb82f4
test(protocol): 确认清理后的 body 不再携带 compact 窗口
dofastted ef9a730
feat(vm): migrate legacy containers for service updates
dofastted 09a125f
fix(vm): restart kin-egress after its binary is replaced
dofastted 0302892
fix(vm): fail upgrade until a replaced kin-egress is restarted
dofastted e615b2f
feat(web): 种子页按当前槽 settings.json 显示
dofastted 85db559
fix(web): 空的 claude.setting 不再显示成默认配置
dofastted 2c62e8e
fix(panel): 缺失的 claude.setting 返回 null
dofastted 7776c55
fix(protocol): pin message thread betas across turns
dofastted c399c2d
feat(web): 种子配置项可直接编辑
dofastted f8c0246
feat(vm): 调试开关显示遥测实际上传
dofastted 635008b
fix(web): 种子账本保留顶层配置项
dofastted 9e61a36
fix(vm): 遥测上传日志只保留最近四十行
dofastted 3099699
fix(web): 播种后同时刷新调试中的种子查询
dofastted fb2bd5f
fix(vm): 调试日志记录实际上传的 events 包装
dofastted b309bb2
feat(web): 种子配置默认锁定,时区和语言提供基础选项
dofastted 109f0ac
fix(web): 空时区继续跟随当前 SOCKS5
dofastted 7ed4586
fix(web): 跟随 SOCKS5 时仍可改成固定时区
dofastted File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Product | ||
|
|
||
| <!-- impeccable:product-schema 1 --> | ||
|
|
||
| ## Platform | ||
|
|
||
| web | ||
|
|
||
| ## Users | ||
|
|
||
| 本机管理员。在深色运维控制台里打开某个虚拟机槽位,核对并改写该槽 Claude Code 的种子配置。 | ||
|
|
||
| ## Product Purpose | ||
|
|
||
| vm2api 把 Claude / Codex 账号做成可调度的虚拟机槽,并对外提供兼容上游的 API。种子页的成功标准:管理员不用进容器,就能看见当前槽 `settings.json` 里实际生效的配置项,改完能播种,并实时看到遥测开或关。 | ||
|
|
||
| ## Positioning | ||
|
|
||
| 种子不是一份预设表单。它读当前槽家目录里已经写好的 Claude 配置,按文件内容逐项显示,再把改动写回同一份文件。 | ||
|
|
||
| ## Operating Context | ||
|
|
||
| 管理员在 `/vm/$id` 的「种子」页签工作。数据来自该槽 `cli-home/.claude/settings.json`、`claude.setting` 和种子策略。遥测进程状态来自槽详情里的实时观测。 | ||
|
|
||
| ## Capabilities and Constraints | ||
|
|
||
| - 显示当前槽 `settings.json` 的真实键值,而不是只显示种子策略里的默认串。 | ||
| - `claude.setting` 以可编辑文本提供,保存时写回并重新播种。 | ||
| - 遥测开、关状态实时刷新;配置开关和进程是否在跑是两件事。 | ||
| - 「拒客户端 settings」和「拒客户端身份」按当前策略准确显示,并可切换。 | ||
| - 平台是现有 React 面板,不另起一套视觉系统。 | ||
|
|
||
| ## Product Principles | ||
|
|
||
| - 槽内文件是事实,表单默认值不是。 | ||
| - 开和关都要能被看见,未知不能伪装成关闭。 | ||
| - 能改的项和只读观测分开。 | ||
| - 播种是显式动作,不在切换开关时偷偷写盘。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # VM telemetry service | ||
|
|
||
| Telemetry is an explicit seed-policy opt-in. A newly created VM is disabled; | ||
| setting `telemetry_disabled` to `false` writes the VM's `worker.json` identity | ||
| and starts the Go `kin-worker telemetry` service. Setting it back to `true` | ||
| stops that child process and leaves the VM and its Rust kernel running. | ||
|
|
||
| The service reads credentials only from the VM's own Claude home. Its feature | ||
| payload uses facts collected from that VM (including its timezone, OS, | ||
| hardware, shell and runtime versions), never controller-host defaults or a | ||
| synthetic fingerprint. Requests leave through the VM's bound egress, so the | ||
| service observes the VM's actual network address. Uploads are periodic and are idle-gated | ||
| by `run/telemetry.touch`. | ||
|
|
||
| `claude.setting` is a plain, editable seed file beside `settings.json` and is | ||
| initialized with: | ||
|
|
||
| ```text | ||
| CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 | ||
| ``` | ||
|
|
||
| ## Service-only updates | ||
|
|
||
| Go payloads are copied atomically into each slot's persistent `slot-bin` | ||
| directory. Cluster containers bind that directory at `/opt/kin-live` (and the | ||
| KVM guest payload at `/opt/kin-live`). The panel/fleet `telemetry` action | ||
| restarts only the telemetry child and the `kin-egress` helper; it does not | ||
| rebuild a VM, replace `vms/`, rotate credentials, or restart the Rust kernel. | ||
|
|
||
| An update must verify the new binary hash and the replacement process before | ||
| reporting success. A failed service restart is reported per slot so the old VM | ||
| identity remains intact and can be rolled back by republishing the previous | ||
| binary. | ||
|
|
||
| For a controlled rollout, run `scripts/migrate-legacy-cluster-slots.mjs` in | ||
| the control-plane container. Pass VM IDs after the root and concurrency | ||
| arguments to limit the rollout. It performs the same migration used by the | ||
| one-click installer: legacy slot and egress containers are stopped, renamed to | ||
| `*-legacy-<timestamp>`, and kept as stopped rollback copies; replacement | ||
| containers use the persistent `/opt/kin-live` mount. Container IDs therefore | ||
| change, but the VM, credentials, `vms/`, routing, and network identity do not. | ||
| After this one-time migration, subsequent updates atomically replace only the | ||
| Go binaries in `slot-bin` and restart the service processes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { runFleetUpdate } from '../src/lib/vm/fleet-update.mjs' | ||
|
|
||
| const root = process.argv[2] || process.env.KIN_PROJECT_ROOT || '/opt/vm2api' | ||
| const concurrency = Number(process.argv[3] || 4) | ||
| const report = await runFleetUpdate(root, { | ||
| action: 'telemetry', | ||
| concurrency, | ||
| }) | ||
| console.log(JSON.stringify(report)) | ||
| if (report.failed_count) process.exit(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Migrate legacy cluster slot containers to the persistent Go-service mount. | ||
| * This never rebuilds a VM: the old container is renamed and retained as a | ||
| * stopped rollback copy, while the replacement reuses its image and settings. | ||
| */ | ||
| import { runFleetUpdate } from '../src/lib/vm/fleet-update.mjs' | ||
|
|
||
| const root = process.argv[2] || process.env.KIN_PROJECT_ROOT || '/opt/vm2api' | ||
| const concurrency = Number(process.argv[3] || process.env.KIN_FLEET_CONCURRENCY || 4) | ||
| const ids = process.argv | ||
| .slice(4) | ||
| .flatMap((value) => String(value).split(',')) | ||
| .map((value) => value.trim()) | ||
| .filter(Boolean) | ||
|
|
||
| const report = await runFleetUpdate(root, { | ||
| action: 'telemetry', | ||
| concurrency, | ||
| ids: ids.length ? ids : null, | ||
| }) | ||
| console.log(JSON.stringify(report)) | ||
| if (report.failed_count) process.exitCode = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 restartskin-egressand, 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)
src/lib/vm/fleet-update.mjs#L30-L37src/lib/cluster/remote-slot.mjs#L1086-L1105Reviewed by Cursor Bugbot for commit 7ed4586. Configure here.