tool-cordis: cordis_define plugin param uses oneOf; some LLM providers stringify it, causing permanent validation failure #2376
long-safe-accont-4567-uvwxyz-9876
started this conversation in
General
Replies: 1 comment
|
Landed your fix as a cherry-pick-ready branch:
Good catch on the root cause — |
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.
Bug: cordis_define fails with oneOf on the plugin parameter
Summary
The cordis_define tool (packages/extensions/tool-cordis) defines its plugin parameter as a oneOf union of two object schemas. Some LLM providers (reproduced with the PI-AI provider) serialize the value of a parameter whose schema uses oneOf into a JSON string instead of a nested object. Because every oneOf branch expects an object, argument validation always fails:
"plugin" must match exactly one oneOf branch (matched 0)
This makes dynamic Cordis plugin registration impossible under those providers.
Evidence (from session log)
Every tool/call event for cordis_define showed plugin as a string, not an object:
Meanwhile other object parameters on the same tool (e.g. code) stayed objects. So the stringification is triggered specifically by the oneOf schema.
Affected code
packages/extensions/tool-cordis/src/index.ts (~line 160):
Suggested fix (verified locally)
Replace the oneOf union with a plain object schema plus an enum on kind, and validate the required branch fields in execute:
In execute, branch on args.plugin.kind and throw a clear error when the required idPrefix (new) or pluginId (existing) is missing. This compiles clean and, after restarting the host, lets cordis_define validate and register plugins successfully.
Environment
Happy to open a PR with the fix if useful.
All reactions