Skip to content

[Bug] VS Code 1.138 新带进来的两个「无 schema 工具」导致请求报错 #280

Description

@Ritchie1108

What happened?

VS Code 1.138 新带进来的两个「无 schema 工具」

{ "type": "function", "function": { "name": "terminal_last_command", "description": "Get the last command run in the active terminal." } }
{ "type": "function", "function": { "name": "terminal_selection",    "description": "Get the current selection in the active terminal." } }

会导致请求里 inputSchema 的序列化有问题

这个时候会出现报错

[error] DeepSeek request failed: kind=http status=400 baseUrl="https://crs.*****.net/v1" model="deepseek-v4.1-flash" stream=true thinking="enabled" reasoningEffort="max" toolChoice="auto" toolCount=54 messageCount=7 messageChars=11409 imageParts=0 statusText="Bad Request" serverMessage="tools[50].***.parameters must be valid JSON (line 1, column 1). Request id: ********" body="{\"error\":{\"message\":\"tools[50].***.parameters must be valid JSON (line 1, column 1). Request id: *******\",\"type\":\"BadRequest\",\"param\":\"\",\"code\":\"InvalidParameter\"}}"
DeepSeekRequestError: DeepSeek API request failed with HTTP 400
	at createHttpError (\.vscode\extensions\vizards.deepseek-v4-for-copilot-0.9.2\out\client\error\index.js:51:12)
	at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
	at async DeepSeekClient.streamChatCompletion (\.vscode\extensions\vizards.deepseek-v4-for-copilot-0.9.2\out\client\core.js:52:23)

在tools列表中去掉这两个工具就正常

How can we reproduce it?

增加兼容处理让扩展在 inputSchema 缺失时补一个合法空 schema({ type: 'object', properties: {} }),而不是丢掉 parameters

Extension version

0.9.2

Editor build

1.138

Additional context, if relevant

No response

Confirmations

  • I searched existing Issues and did not find the same problem.
  • I confirmed that the public content contains no API keys, authorization headers, private prompts, private code, or unreviewed sensitive dumps.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions