What happened?
I was trying out openrouter:xiaomi/mimo-v2.6-flash, which seemingly likes to generate offset and limit values for the read tool as strings. The TUI then incorrectly concatenates strings instead of adding numbers when rendering the result.
The model requested lines 25-37, corresponding to offset: 25 and limit: 13, but the rendered tool call shows dummy.txt:25-2512.
The issue is in packages/coding-agent/src/core/tools/read.ts:
const startLine = args.offset ?? 1;
const endLine = args.limit !== undefined ? startLine + args.limit - 1 : "";
With offset: 25 and limit: "13", this becomes 25 + "13" - 1 → "2513" - 1 → 2512.
Steps to reproduce
Use openrouter:xiaomi/mimo-v2.6-flash and ask it to read a certain line range in a file. Read tool renders string-concatenated numbers.
Expected behavior
Performs addition, i see 25:37 instead of 25:2512.
Version
v0.87.0
What happened?
I was trying out
openrouter:xiaomi/mimo-v2.6-flash, which seemingly likes to generateoffsetandlimitvalues for thereadtool as strings. The TUI then incorrectly concatenates strings instead of adding numbers when rendering the result.The model requested lines 25-37, corresponding to
offset: 25andlimit: 13, but the rendered tool call showsdummy.txt:25-2512.The issue is in
packages/coding-agent/src/core/tools/read.ts:With
offset: 25andlimit: "13", this becomes25 + "13" - 1→"2513" - 1→2512.Steps to reproduce
Use
openrouter:xiaomi/mimo-v2.6-flashand ask it to read a certain line range in a file. Read tool renders string-concatenated numbers.Expected behavior
Performs addition, i see
25:37instead of25:2512.Version
v0.87.0