Skip to content

fix: declare find_dsh_plugins parameters as standard JSON Schema - #1

Open
245769051-tech wants to merge 1 commit into
ChengxiuCDP:mainfrom
245769051-tech:fix/tool-parameters-schema
Open

fix: declare find_dsh_plugins parameters as standard JSON Schema#1
245769051-tech wants to merge 1 commit into
ChengxiuCDP:mainfrom
245769051-tech:fix/tool-parameters-schema

Conversation

@245769051-tech

Copy link
Copy Markdown

What & Why

\ ind_dsh_plugins\ registers through \ctx.tools.register(), which stores the definition verbatim and projects \parameters\ straight to the model API without compiling the shorthand DSL (only the official \defineTool()\ compiles it).

The shorthand object:

\\js
parameters: {
query: { type: 'string', required: true, ... },
limit: { type: 'number', ... },
}
\\

...has **no top-level \ ype: "object"**, so every model call fails with:

\
INVALID_REQUEST: Invalid schema for function 'find_dsh_plugins':
schema must be a JSON Schema of 'type: object', got 'type: null'
\\

The session drops on the first tool call — effectively disconnecting the agent. Reproduced on dsh 0.1.0-rc.6 (DSH Desktop 2.0.0), headless profile.

Fix

Declare a standard JSON Schema root instead:

\\js
parameters: {
type: 'object',
additionalProperties: false,
properties: { query: {...}, limit: {...}, installable_only: {...} },
required: ['query'],
}
\\

Verification

  • Before: isolated headless profile with this plugin crashes with the INVALID_REQUEST above.
  • After: same profile boots and answers normally (\Hello! 👋).
  • Tool shape check: \parameters.type === 'object',
    equired: ['query'], execute/render intact.

….tools.register projects parameters verbatim; the shorthand DSL lacks top-level type object, causing INVALID_REQUEST on every model call)
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.

1 participant