Skip to content

fix: pin thread betas and verify live docker memory - #621

Merged
dofastted merged 33 commits into
mainfrom
fix/thread-betas-and-memory-verify
Oct 20, 2026
Merged

dofastted merged 33 commits into
mainfrom
fix/thread-betas-and-memory-verify

Conversation

@dofastted

@dofastted dofastted commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Pin Anthropic message-thread betas for 24h (max 10k ids). A continue turn reuses the previous turn's betas when the model is unchanged, and still keeps betas derived on the new turn. Create turns for the mid-output-config model set emit mid-conversation-output-config from body.thread alone, so a continue that no longer replays message-level effort controls still carries the gate. Pin/miss/model-change is recorded on hop_meta.thread_betas.
  • Docker online memory raise now requires a running container, then accepts the new limit only when HostConfig.Memory, HostConfig.MemorySwap, and the container cgroup memory.max all equal the requested bytes. Mismatch or a stopped container returns 502 and does not write vm.machine.memory.
  • Official Claude Code login (activeMethod === 'cc') opens the slot terminal before the generated-link branch, so a ready auth link cannot hide the terminal login button.

git merge-tree against origin/main (f175be04) reports no conflicts. The branch also contains the already-merged seed / OAuth / egress commits that were still ahead of origin/fix/remote-slot-refresh; the net diff versus main is the 12 files below.

Not included: uncommitted sticky-pane.tsx copy change, and untracked docs/fork-vs-current-2026-10-20.md.

Review notes

  • Thread pins live in the control-plane process Map. A multi-process or restarted Node loses them; the continue turn then uses freshly computed betas (pin: miss) instead of failing.
  • docker update is not rolled back when the post-check fails. Config stays at the old value, but the container limit may already be the new one (memory_diverged / cgroup_memory_diverged).
  • cgroup v2 memory.max of max fails the numeric compare on purpose.

Test plan

  • node --test test/unit/thread-betas.test.mjs test/unit/docker-slot-memory.test.mjs test/unit/mid-convo-effort.test.mjs test/unit/panel-vm-memory-raise.test.mjs test/unit/runtime-state.test.mjs — 44 pass
  • Continue a thread after control-plane restart and confirm the miss path is acceptable
  • Raise memory on a running Docker slot and confirm HostConfig plus cgroup before the panel reports success

Note

Medium Risk
Changes upstream beta headers for threaded conversations and tightens live Docker memory raises; thread pins are process-local and lost on control-plane restart (miss path only).

Overview
Adds 24h in-process pinning of Anthropic anthropic-beta tokens across message-thread continue turns (bounded map, merge with freshly derived betas on model match). Worker outbound prep calls pinThreadBetas / rememberThreadTurn on success; mid-conversation-output-config is now emitted when body.thread is set on supported models even without replayed message-level effort controls. Pin outcomes are recorded on hop_meta.thread_betas in request logs.

Docker slot online memory raise is stricter: requires a running container, then persists vm.machine.memory only when Docker memory + swap limits and cgroup memory.max all equal the requested bytes (502 / no persist on mismatch). DEPLOY.md documents panel resize vs manual docker update.

Credential panel: official Claude Code (cc) login terminal is shown earlier in the branch order so a ready OAuth link cannot hide the terminal button.

Reviewed by Cursor Bugbot for commit 270aa7d. 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 后写入固定值。
容器运行且 cli-node 已安装后,claude auth login 自己生成链接并换票。宿主机不再构造 claude_code 授权链接。
授权码由用户直接粘进终端,不再由面板中转。
没有 credentials.json 时先建空文件,再把官方 .credentials.json 链过去,避免登录写到 worker 读不到的独立文件。
集群节点、未运行容器和缺少 cli-node 的槽不能打开官方登录终端。凭证链接失败时终端不再继续启动。
普通运维 ticket 即使带 login=1 也不能升级成官方登录终端。
shell 只负责拿到票。会话结束时写入槽唯一使用的 credentials.json,并删除官方 CLI 的临时副本。
shell 拿到的票交给 commitImportedOauth。导入后 .credentials.json 继续链接到 worker 的 credentials.json,终端和槽使用同一份。
已有授权链接不再挡住官方登录。选择 Claude Code 时显示终端,链接只留给普通 OAuth 和 Setup Token。
# Conflicts:
#	docs/PANEL_API.md
#	docs/TELEMETRY.md
#	scripts/claude-auth-login-pty.py
#	src/lib/cluster/remote-slot-files.mjs
#	src/lib/cluster/remote-slot.mjs
#	src/lib/vm/egress.mjs
#	src/lib/vm/fleet-update.mjs
#	test/unit/fleet-update.test.mjs
#	test/unit/go-worker-client.test.mjs
#	test/unit/panel-vm-seed-settings.test.mjs
#	test/unit/remote-slot-migration.test.mjs
#	web/src/components/ws-terminal.tsx
#	web/src/features/settings/protocol-pane.tsx
#	web/src/features/vm/detail-page.tsx
#	web/src/features/vm/queries.ts
#	web/src/features/vm/seed-policy-card.test.ts
#	web/src/features/vm/seed-policy-card.tsx
#	web/src/features/vm/seed-settings.test.ts
#	web/src/features/vm/seed-settings.ts
@dofastted

Copy link
Copy Markdown
Owner Author

合并方式

33 个提交里,净 diff 相对 main 只有 12 个文件、三处新改动。其余提交(种子页、OAuth 终端登录、Go 槽位服务热更新、egress 重启、auto compact)已经 squash 进 main:#600、#604、#605、#607、#608、#611、#613、#615。

不要 merge commit。用 squash,或者把分支重放到 origin/main 上只留这三处:

  • 7776c557 线程 beta pin,以及 create 轮补 mid-conversation-output-config
  • 26e0bdef Docker 在线扩容核对 Memory / MemorySwap / cgroup memory.max
  • bbdd7e57 把 cc 官方登录终端挪到已有授权链接之前

git merge-tree 对 origin/main(f175be04)无冲突。

@dofastted

Copy link
Copy Markdown
Owner Author

本 kitchen-sink PR 已按 release review 拆成三个独立 Ready PR(均基于当前 main tip f175be04),请分别 review/merge,勿合并本 PR。

功能 PR
thread betas pin #624
Docker 在线扩容 cgroup 校验 + 失败回滚 #623
CC 官方登录终端顺序 #622

各 PR 已在 CHANGELOG「未发布」追加对应条目;未改 VERSION。merge-no-tip tip gap→201;勿 tip-cut。

@dofastted dofastted closed this Oct 20, 2026
@dofastted
dofastted merged commit 8fcb644 into main Oct 20, 2026
8 checks passed
dofastted added a commit that referenced this pull request Oct 20, 2026
* fix(web): Claude Code 直接打开登录终端

已有授权链接不再挡住官方登录。选择 Claude Code 时显示终端,链接只留给普通 OAuth 和 Setup Token。

* docs(changelog): 未发布 — CC 登录终端顺序 (#621)

Co-authored-by: ted <kuhlmangarry24@gmail.com>

* docs(changelog): 本切片引用 #622

Co-authored-by: ted <kuhlmangarry24@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@dofastted dofastted mentioned this pull request Oct 20, 2026
dofastted added a commit that referenced this pull request Oct 20, 2026
VERSION → 1.3.201. Fold the unpublished notes plus #621 into the 1.3.201 section.
dofastted added a commit that referenced this pull request Oct 20, 2026
VERSION → 1.3.201. Fold unpublished notes plus #621 and #622 into the 1.3.201 section.
cursor Bot pushed a commit that referenced this pull request Oct 20, 2026
cursor Bot pushed a commit that referenced this pull request Oct 20, 2026
Co-authored-by: ted <kuhlmangarry24@gmail.com>
cursor Bot pushed a commit that referenced this pull request Oct 20, 2026
dofastted added a commit that referenced this pull request Oct 20, 2026
#622 与 #621 的第三条是同一次面板顺序调整,合并引用,删掉重复条目。
dofastted added a commit that referenced this pull request Oct 20, 2026
* fix(vm): cgroup v1/max 在线扩容校验与 docker update 回滚 (#621)

Co-authored-by: ted <kuhlmangarry24@gmail.com>

* style: biome format docker-slot-memory

Co-authored-by: ted <kuhlmangarry24@gmail.com>

* docs(changelog): #623 未发布条目与 1.3.201 分离

Co-authored-by: ted <kuhlmangarry24@gmail.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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