Skip to content

fix(scheduler): append actionable hint to MCP utility-model errors - #3327

Merged
MagicLizi merged 1 commit into
makecindy:mainfrom
Battleplus:fix/mcp-utility-model-error-hint
Aug 24, 2026
Merged

fix(scheduler): append actionable hint to MCP utility-model errors#3327
MagicLizi merged 1 commit into
makecindy:mainfrom
Battleplus:fix/mcp-utility-model-error-hint

Conversation

@Battleplus

@Battleplus Battleplus commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

这次改了什么

schedule_set_pre_run_hook 因为所有 utility-model 候选全部失败时,原始错误信息直接返回给 MCP 调用方,没有任何操作指引。Agent 无法知道可以通过直接传 script 参数绕过失败的生成链。

本修复为 4 种 utility-model 错误码追加可操作提示,明确建议传 script 绕过生成,解决 #3317

变更类型

  • feat 新功能
  • fix 缺陷修复
  • refactor / perf 重构或性能优化
  • docs / test / chore 文档、测试或工程维护
  • 其他:

范围

怎么验证的

  1. 运行 npx vitest run packages/lizi-mcps/src/scheduler/errors.test.ts,8/8 测试通过
  2. 验证每种错误码(ALL_CANDIDATES_FAILEDNO_CANDIDATETIMEOUTEMPTY_RESPONSE)的错误消息都包含 "passing the script parameter" 提示
  3. 验证原始错误信息仍然保留在提示之后

风险

风险极低——仅向现有错误消息追加文本,无控制流变更,无 breaking change。

When schedule_set_pre_run_hook fails because all utility-model candidates
are exhausted, the raw error message was returned to the MCP caller without
any guidance. Agents (and users) had no way to know that passing the
"script" parameter directly would bypass the failing generation chain.

Append a per-error-code hint that explicitly suggests passing "script" to
bypass generation. This addresses makecindy#3317.

Also update the existing test to verify the hint is present in the
returned message.

Signed-off-by: Battleplus <3559424769@qq.com>
@Battleplus
Battleplus requested a review from a team as a code owner August 24, 2026 06:59
@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown

Greptile Summary

This PR improves scheduler MCP diagnostics by appending an actionable direct-script workaround to all utility-model generation errors.

  • Preserves the existing structured utility-model error codes and original diagnostics.
  • Adds code-specific hints explaining that the caller can bypass generation through the script parameter.
  • Updates parameterized tests to cover all four utility-model error codes and verify the recovery guidance.

Confidence Score: 5/5

The PR appears safe to merge because the new guidance matches the exposed MCP parameter and direct script input bypasses utility-model generation.

The change only extends utility-model error messages with fixed recovery text, preserves structured codes and original diagnostics, and covers every affected code with focused tests.

Important Files Changed

Filename Overview
packages/lizi-mcps/src/scheduler/errors.ts Appends accurate direct-script recovery guidance while preserving existing error classification and diagnostic text.
packages/lizi-mcps/src/scheduler/errors.test.ts Verifies code preservation, original diagnostic retention, and recovery hints for all four utility-model error variants.

Reviews (1): Last reviewed commit: "fix(scheduler): append actionable hint t..." | Re-trigger Greptile

@MagicLizi MagicLizi added the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 24, 2026

@MagicLizi MagicLizi 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.

格式门未通过(P1)

  • .github/PULL_REQUEST_TEMPLATE.md: Description 缺段落「这次改了什么」「怎么验证的」「风险」。请按仓库 PR 模板补齐后再推一次。

本次只拦模板完整性,未进入代码审查。

@MagicLizi MagicLizi removed the status:awaiting-author 等作者修改(review-pr 自动维护,仅展示) label Aug 24, 2026

@MagicLizi MagicLizi 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.

Reviewed. Utility-model errors now carry an actionable script bypass hint; tests cover the four codes; no P0/P1.

@MagicLizi
MagicLizi merged commit 2cb2859 into makecindy:main Aug 24, 2026
12 checks passed
@MagicLizi

Copy link
Copy Markdown
Contributor

合了。工具模型挂掉时不再只丢一行诊断,调用方能直接看见可以用 script 绕开生成——这种小提示能少绕不少圈子。

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