Skip to content

fix(core): remove spaces between Chinese characters and numbers in tool args#2043

Closed
echoVic wants to merge 2 commits intoQwenLM:mainfrom
echoVic:fix/chinese-number-spacing
Closed

fix(core): remove spaces between Chinese characters and numbers in tool args#2043
echoVic wants to merge 2 commits intoQwenLM:mainfrom
echoVic:fix/chinese-number-spacing

Conversation

@echoVic
Copy link
Copy Markdown
Contributor

@echoVic echoVic commented Mar 2, 2026

Fixes #2032

The model sometimes adds spaces between Chinese characters and numbers in file paths,
causing file read failures (e.g., '测试 1 文件.txt' instead of '测试1文件.txt').

This fix sanitizes tool arguments by removing such spaces before processing.

Changes

  • Added sanitizeToolArgs() function in turn.ts and subagent.ts
  • Applied sanitization to all tool arguments before creating ToolCallRequestInfo
  • Fixes file reading errors for files with Chinese+number names

Testing

  • Verified that spaces between Chinese chars and numbers are removed
  • File paths like '测试1文件.txt' now work correctly

…ol args

Fixes QwenLM#2032

The model sometimes adds spaces between Chinese characters and numbers in file paths,
causing file read failures (e.g., '测试 1 文件.txt' instead of '测试1文件.txt').

This fix sanitizes tool arguments by removing such spaces before processing.

Changes:
- Added sanitizeToolArgs() function in turn.ts and subagent.ts
- Applied sanitization to all tool arguments before creating ToolCallRequestInfo
Fixes QwenLM#2004

When users type '@' in large projects, the file crawler scans the entire
project directory which can cause OOM crashes if there are too many files.

This fix adds a maxFiles limit (default 100,000) to the crawler to prevent
memory issues. When the limit is exceeded, a warning is shown and only
the first N files are used.

Changes:
- Added maxFiles option to CrawlOptions interface
- Added file count check and limit in crawl() function
- Shows warning when project has too many files
@tanzhenxin
Copy link
Copy Markdown
Collaborator

Similar issue as #2027 , no workaround is in consideration.

@tanzhenxin tanzhenxin closed this Mar 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants