Skip to content

Native tools for DeepSeek and GLM, DSML calls, GLM business codes - #56

Merged
yogthos merged 1 commit into
mainfrom
dsml-tool-calls
Sep 25, 2026
Merged

yogthos merged 1 commit into
mainfrom
dsml-tool-calls

Conversation

@yogthos

@yogthos yogthos commented Sep 25, 2026

Copy link
Copy Markdown
Owner

deepseek-v4-flash's DSML tool calls were read as no-calls and shown raw; the parser now handles DSML and the string= attribute. Tools are sent natively on every DeepSeek/GLM request (derived from the tool signatures in the branch's system prompt), as both vendors' own harnesses do, except beside a prefill, which DeepSeek rejects. Native calls fold back into fences with prose kept; measured live, both providers return tool_calls.

GLM business codes are classified by code: retryable ones retry under any status, 3008-3010/1304 are caps, errors in 200 bodies and mid-stream SSE error frames are classified instead of lost.

The Anthropic-compatible endpoints were measured: they work but bring nothing over chat-completions with native tools while history is text, so no adapter.

deepseek-v4-flash wrote its DSML call markup into the content, and every
such turn was a no-call shown raw in the agent log. The parser now rewrites
DSML tags (fullwidth or ASCII bars, doubled, spaced) to the XML call form it
already reads, and honours string="true"/"false" on parameters.

The likely cause was that tools only travelled natively when a gate forced
one; DeepSeek's and Zhipu's own harnesses send them on every request. The
tool surface is now derived from the signatures in the branch's system
prompt and sent as `tools` wherever the endpoint has :native-tools (DeepSeek,
GLM), except beside a prefill, which DeepSeek rejects. Native calls fold
back into fences with the prose around them kept. Measured live on both
providers: replies come back as tool_calls.

GLM business codes are classified by code, not only by status: the
retryable ones (from ZCode's table) retry under a 400 or inside a 200,
3008-3010 and 1304 are now caps, errors in 200 bodies go through the same
path, and an error frame mid-stream is returned instead of reading as an
empty reply.

The Anthropic-compatible endpoints were evaluated live and bring nothing
over chat-completions with native tools while history is text.
@yogthos
yogthos merged commit 6f668dc into main Sep 25, 2026
7 checks passed
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