Replies: 1 comment
|
补充一个同一根因的另一症状变体(实测遇到,供参考): 除上述「嵌套 string 透传」外,当顶层 arguments 整体偶发不是合法 JSON(模型输出截断/格式瑕疵)时, 误导点:
这与 #5512 第 6 步同一行代码( (脱敏:无环境特定路径与个人数据) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Tool parameters whose schema uses
oneOf(no top-leveltype) reach the tool's validator as a string instead of an object, so they fail validation with… must match exactly one oneOf branch (matched 0)(ormust be an object). Explicittype: "object"parameters work fine. This breaks several built-in tools deterministically —cordis_define'spluginparameter (and the dynamic-Cordis probe it gates) has been unusable.Root-cause chain (paths/line numbers from the v29b22c5 install; re-check against the repo):
dsh-tool-cordis/lib/index.js:7189-7222—cordis_definedeclaresparameters.pluginasoneOf: [ {type:"object", …}, {type:"object", …} ]with no top-leveltype.dsh-tools/lib/types/schema.js:130-149—oneOfcompiles correctly to anode.oneOfnode (still no top-leveltype).dsh-tools/lib/types/index.js:664-675(schemaOf) — the compiled parameters are projected to the model as-is (no lowering).dsh-llm-deepseek/lib/index.js:226-234—parameters: tool.parametersis sent verbatim, so the wire schema forpluginis a bareoneOf.oneOfunion with no concretetype, emits the value as a JSON string — e.g. wire arguments become{"plugin":"{\"kind\":\"new\",\"idPrefix\":\"x\"}", …}.dsh-agent-loop/lib/index.js:145-152—parseArgumentsonly does a top-levelJSON.parse(raw ? JSON.parse(raw) : {}), soargs.pluginarrives as that nested string.dsh-tools/lib/types/json-schema.js:440-441(oneOf) /:472-475(object) — the string matches 0 object branches →matched 0; a concretetype:"object"node would instead reportmust be an object.Repro
Call
cordis_definewithplugin: { kind: "new", idPrefix: "test" }→ alwaysmatched 0. Changepluginto an explicittype: "object"declaration → succeeds.Suggested fixes (by cost/benefit)
oneOfin built-ins — use a singletype: "object"with akinddiscriminator (enum) and optionalidPrefix/pluginId, which the provider parses as an object unambiguously.oneOf-typed parameter, if the value is a string that parses to an object, parse it before validation.oneOf" into an explicit object hint at the schema-serialization boundary.Impact:
cordis_define/cordis_inspecttooling and any tool or MCP binding that uses aoneOf(ortype:"json"-only) parameter is non-functional on the DeepSeek provider.All reactions