Repository navigation
Conversation
drakosha
requested review from
aarnphm,
bbrowning,
chaunceyjiang and
sfeng33
as code owners
July 20, 2026 22:15
5 of 6 tasks
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
drakosha
force-pushed
the
fix-glm47-missing-arg-value-tag
branch
from
September 17, 2026 12:39
389e86c to
a0a57e2
Compare
drakosha
force-pushed
the
fix-glm47-missing-arg-value-tag
branch
from
September 19, 2026 18:24
a0a57e2 to
42e1589
Compare
Under concurrent load, GLM-4.7-family models occasionally skip the
opening <arg_value> tag when emitting tool calls, producing
<arg_key>key</arg_key>value</arg_value> with the value fully intact.
The argument regexes required the opening tag, so such calls were
silently parsed as empty arguments ({}), failing downstream tool
validation. Make the opening tag optional in both the full and
partial argument regexes; the closing </arg_value> still delimits
the value. Streaming is unaffected for well-formed output: the
incremental lexer buffers ambiguous tag prefixes, so a partially
streamed <arg_value> tag never leaks into the value.
Signed-off-by: Mikhail Kostryukov <mike@triptrack.net>
…med arguments With the open tag optional, a value counted as open right after </arg_key>, and since vllm-project#61253 open values are streamed verbatim, so the tag itself landed in the arguments and the JSON never closed. Text that can still become the tag is not a value yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Mikhail Kostryukov <mike@triptrack.net>
drakosha
force-pushed
the
fix-glm47-missing-arg-value-tag
branch
from
November 4, 2026 21:40
42e1589 to
b524627
Compare
This was referenced Nov 15, 2026
This branch has not been deployed
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.
Purpose
FIX #49248
Under concurrent load, GLM-4.7-family models sporadically skip the opening
<arg_value>tag when emitting tool calls, producingwith the argument value fully intact (raw sampled tokens captured via
logprobs: true; reproduces attemperature: 0too, ~5–17% of calls at concurrency 6 on our production trace family, 0 sequentially)._ARG_RE/_PARTIAL_ARG_REinvllm/parser/glm47_moe.pyrequire the opening tag, so such calls silently parse toarguments: "{}", which then fails the client's tool schema validation and degrades agent loops (the broken{}call gets rendered back into history, so retries tend to fail the same way).This PR makes the opening
<arg_value>optional in both regexes. The closing</arg_value>still delimits the value, so well-formed output parses as before.Since #61253 an open value is streamed verbatim instead of being re-parsed per chunk, so an optional tag alone would count the value as open right after
</arg_key>and send the tag itself into the arguments ({"city": "<arg_value>Saint Petersburg). The second commit keeps the value closed while its text can still turn out to be<arg_value>.Not a duplicate
gh pr list --search "49248 in:body"finds only this PR. Other open glm47 parser PRs fix different malformations: a duplicated<arg_key>tag (#54971), a missing opening<arg_key>(#47190), an unclosed final</arg_value>(#58418), a stray<tool_call>(#60842). #61253 and #64535 (merged) change how arguments are streamed and do not handle the missing tag.Test Plan
tests/tool_parsers/test_glm47_moe_tool_parser.py: non-streaming cases (single arg with missing opening tag; mixed malformed + well-formed args in one call), a streaming case with the malformed sequence split across chunks, andtest_open_tag_stays_out_of_arguments(tag in its own chunk with two args, tag split across chunks, a value that starts like the tag but is not).--tool-call-parser glm47), replaying the production request that triggers the malformation at concurrency 6 withlogprobs: true:arguments: "{}";Test Result
pytest tests/tool_parsers/test_glm47_moe_tool_parser.pyon nightlydd4e40142a: 19 passed with the second commit; without ittest_with_argsand two of the new cases fail. Run with the GLM-5.3-Flash tokenizer because the host has nozai-org/GLM-4.7copy.AI assistance (Claude Code) was used for this PR. I reviewed the change and ran the tests above.
🤖 Generated with Claude Code