Skip to content

DeepSeek tool calls can use malformed argument JSON #26498

@HNGM-HP

Description

@HNGM-HP

Description

DeepSeek models can produce malformed tool-call arguments in some cases, for example optional placeholders (null, "", {}, []), arrays encoded as strings, decorated paths, or partial paired parameters.

This is related to DeepSeek tool-call formatting, but narrower than #24566. That issue is about raw DSML/XML-style tool calls not being parsed by a provider. This issue is about prompt-level mitigation for argument JSON shape when OpenCode is already using normal tool calls.

OpenCode already has provider-specific prompt sections for some models. A small DeepSeek-specific prompt section can make the expected tool-call JSON shape explicit without changing behavior for other providers.

Plugins

None

OpenCode version

Current dev branch

Steps to reproduce

  1. Use a DeepSeek model with tools enabled.
  2. Ask it to call tools with array, object, path, or optional parameters.
  3. Observe that some calls may use invalid argument shapes, such as arrays as strings, decorated paths, placeholder optional values, or only one side of a paired parameter.

Screenshot and/or share link

No screenshot. This is a tool-call argument formatting issue.

Operating System

Ubuntu 24.04

Terminal

Not terminal-specific

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions