Skip to content

Fix glm47 tool parser stripping whitespace from string arguments - #2107

Open
Adish90k wants to merge 1 commit into
ml-explore:mainfrom
Adish90k:fix/glm47-tool-parser-strips-whitespace
Open

Adish90k wants to merge 1 commit into
ml-explore:mainfrom
Adish90k:fix/glm47-tool-parser-strips-whitespace

Conversation

@Adish90k

Copy link
Copy Markdown

Bug: glm47 tool parser strips whitespace from string argument values, so code/text sent via a tool call loses first-line indentation and trailing newlines

Cause: the value is stripped before the type check (arg_val = match.group(2).strip())

Fix: only strip/deserialize non-string args; string values are preserved as-is (matching how qwen3_coder already handles it)

Test: added test_glm47_string_arg_keeps_whitespace, verified it fails without the fix and passes with it; all existing tool-parsing tests still pass

Closes #2064

  • Note: longcat.py has the same strip-before-typecheck pattern — offer to fix it here or in a follow-up

This branch has not been deployed

No deployments
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.

glm47 tool parser strips whitespace from argument values (first-line indentation and trailing newline are lost)

1 participant