Skip to content

feat(web): VM 定时测试表单支持续热模式与自动续热 - #1971

Open
dofastted wants to merge 2 commits into
devfrom
cursor/vm-test-schedule-mode-fields-68f6
Open

dofastted wants to merge 2 commits into
devfrom
cursor/vm-test-schedule-mode-fields-68f6

Conversation

@dofastted

@dofastted dofastted commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

修复 #1874 分项 4:面板「定时测试」表单可配置 mode / auto_renew。本次在审查反馈后修复 同步路径 丢弃模式字段的问题。

前端(首提交,未改)

  • 表单:运行模式 test | preheat,自动续热仅 preheat 可选。
  • 旧计划缺字段 → test + 未勾选。
  • 单槽 PUT、全局默认模板 PUT/GET 已正确提交与回读。

后端(本轮)

  • 新增 explicitScheduleModeFields():在 normalizeScheduleStructure 压缩之前从原始 schedule / test 取显式 mode/auto_renew。
  • scope=ids:applyScheduleStructure(..., { modeSource: schedule }) 写入显式字段;未提供则 mergeVmTestSchedulePreserve 保留原值。
  • scope=all:normalizeSyncTest 校验后把规范化后的 mode/auto_renew 经 _applyFullTest 写入各槽。
  • 全局默认模板:mode=test + auto_renew=true 改为与单槽 PUT 一致的 400(去掉本 PR 引入的静默改写)。
  • 更新 docs/PANEL_API.md 中 test-schedule / sync 说明。

sync-all 与异类槽(Claude ↔ Codex)

与 开关、时间结构 相同:mode/auto_renew 会复制到所有目标槽;异类槽仍保留各自的模型与 Prompt(已有 _applyFullTest 行为)。理由:续热是槽级调度策略,不应因槽类型而不同步。

Release notes(≥ 1.4.237;1.4.236 已发布)

  • 面板 VM 定时测试可配置窗口续热与自动续热;同步到本槽/全部会正确写入模式字段。

Test plan

pnpm exec biome check src/lib/admin/vm-test-schedule.mjs test/unit/vm-test-schedule.test.mjs
pnpm -C web exec vitest run src/features/vm/vm-test-schedule.test.ts
node --test test/unit/vm-test-schedule.test.mjs test/unit/issue-1874.test.mjs

覆盖审查五类同步场景(见 test/unit/vm-test-schedule.test.mjs「sync scope=…」用例)。本地未跑完整 tip CI(先前 path-filtered 短跑不足以代表全量 CI)。

未做真实面板点击回归(Cloud Agent 无已登录面板环境);以上 node 测试代替。

Refs #1874

Open in Web Open in Cursor 

Note

Medium Risk
Changes scheduled job behavior and bulk sync semantics for operator-configured credentials usage (preheat/auto-renew), though scope is limited to the test-schedule admin path with added unit coverage.

Reviewed by Cursor Bugbot for commit 12207a2. Configure here.

Panel saves now send mode and auto_renew for per-slot PUT, sync, and global
default template round-trip; sync-all copies mode through normalizeSyncTest.

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

cursor Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: 0800aac7-04e4-4eb0-810f-fd4e628c2094)

Extract explicit mode fields before schedule normalization and apply them
on ids and full sync; align default-template validation with single-slot 400.

Co-authored-by: ted <kuhlmangarry24@gmail.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.

2 participants