Repository navigation
|
I am using Qwen 3.5 9B and I have noticed that for large files (the cutoff is around 500-1000 lines?) the How can i change this behavior? is the read function itself truncating the file contents? my model settings in |
Replies: 1 comment 1 reply
|
Yes, it is read_file itself truncating, and it is configurable. It is not related to your generationConfig or the model's context window. Cause: read_file applies two caps, both taken from the tools settings:
The char cap is the one you most likely hit at around 500 to 1000 lines, since 25k chars is only about 500 lines of typical code. When either cap trips, the output is cut and marked as truncated, and the model is supposed to continue with Defaults: qwen-code/packages/core/src/config/config.ts Lines 877 to 878 in 9f6138a Where they are applied in read_file: qwen-code/packages/core/src/utils/fileUtils.ts Lines 1512 to 1580 in 9f6138a A value of 0 or less means no limit (it is mapped to Infinity): qwen-code/packages/core/src/config/config.ts Lines 10757 to 10775 in 9f6138a Fix: raise them in {
"tools": {
"truncateToolOutputThreshold": 200000,
"truncateToolOutputLines": 5000
}
}Docs: qwen-code/docs/users/configuration/settings.md Lines 402 to 403 in 9f6138a Keep in mind these settings also apply to Shell, Grep, Glob and ReadManyFiles output, and a big file read eats context (a 262k window is fine for a few thousand lines, but not unlimited). Setting them to a moderate value rather than 0 is safer. |
Yes, it is read_file itself truncating, and it is configurable. It is not related to your generationConfig or the model's context window.
Cause: read_file applies two caps, both taken from the tools settings:
tools.truncateToolOutputLines, default 1000 lines (used when the model does not pass its ownlimit)tools.truncateToolOutputThreshold, default 25000 characters (always applied)The char cap is the one you most likely hit at around 500 to 1000 lines, since 25k chars is only about 500 lines of typical code. When either cap trips, the output is cut and marked as truncated, and the model is supposed to continue with
offsetandlimit. A 9B model often doesn't, so it re-reads the same fi…