Repository navigation
Native tools for DeepSeek and GLM, DSML calls, GLM business codes - #56
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.