-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(serve): allow preinstall skill batch toggles #9139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -959,10 +959,12 @@ export function createDaemonWorkspaceService( | |
| for (const requestedName of requestedSkillNames) { | ||
| const normalizedName = requestedName.trim().toLowerCase(); | ||
| const skill = skillsByName.get(normalizedName); | ||
| let domainError: unknown; | ||
| if (!skill) { | ||
| domainError = new WorkspaceSkillNotFoundError(requestedName); | ||
| } else if (skill.userInvocable === false) { | ||
| targets.push({ requestedName, skillName: requestedName }); | ||
| continue; | ||
| } | ||
|
Comment on lines
962
to
+965
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] Batch and single-Skill toggle endpoints now diverge for unknown names — Failure scenario: a client toggling an uninstalled skill 中文说明本 diff 让批量端点接受未安装名称,而单数端点仍对未知名称返回 404 — DeepSeek/deepseek-v4-flash via Qwen Code /review (v0.21.11) |
||
| let domainError: unknown; | ||
| if (skill.userInvocable === false) { | ||
| domainError = new WorkspaceSkillNotToggleableError( | ||
| skill.name, | ||
| 'not_user_invocable', | ||
|
|
@@ -990,7 +992,7 @@ export function createDaemonWorkspaceService( | |
| if (!error) throw domainError; | ||
| targets.push({ requestedName, error }); | ||
| } else { | ||
| targets.push({ requestedName, skillName: skill!.name }); | ||
| targets.push({ requestedName, skillName: skill.name }); | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The batch contract changed but the canonical protocol reference and the SDK batch error union were not updated — Failure scenario: a client/SDK implementer working from
docs/developers/qwen-serve-protocol.md§POST /workspace/skills/enablewrites a handler forerrors[].code === 'skill_not_found'in batch responses to detect typos; it never fires after this PR, while a misspelled name sent withenabled: falseis silently persisted into workspaceskills.disabledwithchanged: trueand HTTP 200. The protocol doc's example response (missing→skill_not_foundinerrors) describes a shape the endpoint no longer produces. Suggested fix: update the protocol doc's batch section to the new semantics (unknown names are valid targets; disable writesskills.disabled, enable is a no-op that removes a matching entry), including the example response, dropskill_not_foundfrom the batch target-error sentence, and trim'skill_not_found'fromDaemonSkillBatchToggleErrorCodeinpackages/sdk-typescript/src/daemon/types.ts— it is unreachable for the batch endpoint (the single-skill 404 is a separate HTTP surface).中文说明
批量端点契约已变更,但规范文档与 SDK 类型未同步:
docs/developers/qwen-serve-protocol.md的POST /workspace/skills/enable章节仍记录未知名称返回skill_not_found(示例响应仍展示missing→errors),DaemonSkillBatchToggleErrorCode也仍包含该错误码。按文档实现的客户端将永远收不到该错误,而拼错的名称会在enabled: false时被静默写入skills.disabled(changed: true, HTTP 200)。建议同步更新协议文档(未知名称是合法目标、禁用写skills.disabled、启用是移除匹配项的 no-op),并从 SDK 批量错误联合类型中移除'skill_not_found'。— DeepSeek/deepseek-v4-flash via Qwen Code /review (v0.21.11)