Repository navigation
Conversation
drakosha
requested review from
aarnphm,
bbrowning,
chaunceyjiang and
sfeng33
as code owners
July 20, 2026 22:15
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
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>
drakosha
force-pushed
the
fix-glm47-missing-arg-value-tag
branch
from
September 19, 2026 18:24
a0a57e2 to
42e1589
Compare
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:<arg_value>never leaks into a value snapshot.Test Plan
tests/tool_parsers/test_glm47_moe_tool_parser.py: new non-streaming cases (single arg with missing opening tag; mixed malformed + well-formed args in one call) and a streaming case with the malformed sequence split across chunks; all pre-existing cases unchanged.--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.py— 16 passed.