fix(scheduler): append actionable hint to MCP utility-model errors - #3327
Conversation
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>
|
| 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
left a comment
There was a problem hiding this comment.
格式门未通过(P1)
.github/PULL_REQUEST_TEMPLATE.md: Description 缺段落「这次改了什么」「怎么验证的」「风险」。请按仓库 PR 模板补齐后再推一次。
本次只拦模板完整性,未进入代码审查。
MagicLizi
left a comment
There was a problem hiding this comment.
Reviewed. Utility-model errors now carry an actionable script bypass hint; tests cover the four codes; no P0/P1.
|
合了。工具模型挂掉时不再只丢一行诊断,调用方能直接看见可以用 |
这次改了什么
当
schedule_set_pre_run_hook因为所有 utility-model 候选全部失败时,原始错误信息直接返回给 MCP 调用方,没有任何操作指引。Agent 无法知道可以通过直接传script参数绕过失败的生成链。本修复为 4 种 utility-model 错误码追加可操作提示,明确建议传
script绕过生成,解决 #3317。变更类型
范围
packages/lizi-mcps/src/scheduler/errors.ts:为 4 种 utility-model 错误码追加可操作提示packages/lizi-mcps/src/scheduler/errors.test.ts:更新已有测试 + 新增提示验证测试怎么验证的
npx vitest run packages/lizi-mcps/src/scheduler/errors.test.ts,8/8 测试通过ALL_CANDIDATES_FAILED、NO_CANDIDATE、TIMEOUT、EMPTY_RESPONSE)的错误消息都包含 "passing thescriptparameter" 提示风险
风险极低——仅向现有错误消息追加文本,无控制流变更,无 breaking change。