Skip to content

fix(pool): give license_invalid and crag_prompt_replace_empty_unsupported a schedule-state row - #2449

Merged
dofastted merged 1 commit into
devfrom
fix/schedule-state-missing-reasons
Dec 1, 2026
Merged

dofastted merged 1 commit into
devfrom
fix/schedule-state-missing-reasons

Conversation

@dofastted

@dofastted dofastted commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

变更摘要

  • 改前:src/lib/pool/upstream-error-policy.mjs 会发出两个调度原因 license_invalid(单槽 resync + 退避重试后仍答 license_invalid、尚未提交,换槽重试且不冷却)和 crag_prompt_replace_empty_unsupported(旧 CRAG 不支持空 prompt replace,换槽重试且不冷却),但 src/lib/pool/schedule-state.mjs 的原因表里没有这两行。test/unit/schedule-state.test.mjs 的“every emitted reason has exactly one row in the table”因此在 origin/dev 基线上一直失败(add these reasons to schedule-state.mjs: crag_prompt_replace_empty_unsupported, license_invalid)。该文件不在 test:ci 固定集合里,平时没人发现;任何改到它的 PR(例如 feat(quota): add Anthropic daily VM session creation gate #2441)CI 都会因它变红。
  • 改后:两个原因归入 STATELESS(“不改变槽位状态”:它们都经 continueWithoutCooldown 发出,语义是换槽重试而不是冷却或摘除),并加进测试里已有的“不改变槽位状态”断言列表。
  • 未改 / 延后:不改 upstream-error-policy.mjs 的发出逻辑,不改任何其它原因的归类,不动面板文案。

验收记录(Run)

  • 本机(Node 24)schedule-state 12/12(修复前 11/12);Node 22.23.5 容器 + 真实 kin-scheduler 跑引用 schedule-state 的 5 个测试文件(schedule-state、codex-slot-pool、crag-zombie-guard、organization-disabled-probe、scheduler-fastpath)76/76。biome format 无需修改。

回退与手破验证(Broken by hand)

  • 3 处手破(唯一锚点,还原后 sha256 一致):整行去掉、只去掉 license_invalid、只去掉 crag_prompt_replace_empty_unsupported,各让 schedule-state 变红。

真实使用(Real use)

  • 不适用:只补原因表的归类,没有真实槽位或流量;没有 ph24。

未运行项(Not run)

  • 面板上这两个原因的展示文案没有看(它们归入“不改变槽位状态”,面板不为它们显示状态);npm run test:ci 由 GitHub ci 检查覆盖。

Note

Low Risk
Table-only mapping fix for two already-emitted reason codes; no scheduler or error-policy behavior changes.

Overview
Registers license_invalid and crag_prompt_replace_empty_unsupported in the pool schedule-state reason table as STATELESS (slot stays on), matching their existing continueWithoutCooldown behavior in upstream error policy—retry on another slot without cooling the current one.

Adds both codes to the unit test list that asserts request-level / worker handoff reasons never change slot state, fixing “every emitted reason has exactly one row in the table” (previously missing rows broke CI when this file was exercised).

Reviewed by Cursor Bugbot for commit a81f6f6. Configure here.

…rted a schedule-state row

## 变更摘要
- 改前:`src/lib/pool/upstream-error-policy.mjs` 会发出两个调度原因 `license_invalid`(单槽 resync + 退避重试后仍答 `license_invalid`、尚未提交,换槽重试且不冷却)和 `crag_prompt_replace_empty_unsupported`(旧 CRAG 不支持空 prompt replace,换槽重试且不冷却),但 `src/lib/pool/schedule-state.mjs` 的原因表里没有这两行。`test/unit/schedule-state.test.mjs` 的“every emitted reason has exactly one row in the table”因此在 `origin/dev` 基线上一直失败(`add these reasons to schedule-state.mjs: crag_prompt_replace_empty_unsupported, license_invalid`)。该文件不在 `test:ci` 固定集合里,平时没人发现;任何改到它的 PR(例如 #2441)CI 都会因它变红。
- 改后:两个原因归入 `STATELESS`(“不改变槽位状态”:它们都经 `continueWithoutCooldown` 发出,语义是换槽重试而不是冷却或摘除),并加进测试里已有的“不改变槽位状态”断言列表。
- 未改 / 延后:不改 `upstream-error-policy.mjs` 的发出逻辑,不改任何其它原因的归类,不动面板文案。

## 验收记录(Run)
- 本机(Node 24)`schedule-state` 12/12(修复前 11/12);Node 22.23.5 容器 + 真实 `kin-scheduler` 跑引用 `schedule-state` 的 5 个测试文件(`schedule-state`、`codex-slot-pool`、`crag-zombie-guard`、`organization-disabled-probe`、`scheduler-fastpath`)76/76。`biome format` 无需修改。

## 回退与手破验证(Broken by hand)
- 3 处手破(唯一锚点,还原后 sha256 一致):整行去掉、只去掉 `license_invalid`、只去掉 `crag_prompt_replace_empty_unsupported`,各让 `schedule-state` 变红。

## 真实使用(Real use)
- 不适用:只补原因表的归类,没有真实槽位或流量;没有 `ph24`。

## 未运行项(Not run)
- 面板上这两个原因的展示文案没有看(它们归入“不改变槽位状态”,面板不为它们显示状态);`npm run test:ci` 由 GitHub `ci` 检查覆盖。
@cursor

cursor Bot commented Dec 1, 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: 2fb41b9d-8292-402e-9b95-dcee1f326148)

@dofastted

Copy link
Copy Markdown
Owner Author

验收评论(head a81f6f6779ac55f03293c58c50087a1106661be2,已合入最新 origin/dev 052dd07caf2484a509c999749db82af304844d3b)

结论:可以合并。补上 license_invalid、crag_prompt_replace_empty_unsupported 两个调度原因在 schedule-state 里的归类(不改变槽位状态),消除 origin/dev 基线上一直红着的 schedule-state 用例,让改到该文件的 PR(如 #2441)的 ci 不再被它拖红。

验收记录(Run)

  • 合并前核对:mergeStateStatus=CLEAN,ci、Cursor Approval、Cursor Security 通过。
  • schedule-state 12/12,关联 5 个文件 76/76。详见提交信息。

回退与手破验证(Broken by hand)

  • 3 处手破各被拦下。

真实使用(Real use)

  • 不适用:只补归类表;没有真实槽位与 ph24。

未运行项(Not run)

  • 面板展示文案没有看。

@dofastted dofastted changed the title fix(pool): give license_invalid and crag_prompt_replace_empty_unsupported a schedule-state row (takes over #2441) fix(pool): give license_invalid and crag_prompt_replace_empty_unsupported a schedule-state row Dec 1, 2026
@dofastted
dofastted merged commit 3564984 into dev Dec 1, 2026
7 checks passed
@dofastted
dofastted deleted the fix/schedule-state-missing-reasons branch December 1, 2026 12:44
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