Skip to content

Read tool rejects an integer line_offset with "must be integer" validation error #2118

Description

@KevinShen620

What version of Kimi Code is running?

0.29.0

Which open platform/subscription were you using?

Kimi Code (OAuth)

Which model were you using?

Qwen3.8 Max Preview

What platform is your computer?

Linux 6.18.33.2-microsoft-standard-WSL2 x86_64 x86_64

What issue are you seeing?

 The `Read` tool rejects a valid integer `line_offset` argument. The agent called `Read` with `{"path": "main.go", "line_offset": 3}` and got:

 Invalid args for tool "Read": /line_offset must be integer; /line_offset must be integer; /line_offset must match a schema in anyOf

What steps can reproduce the bug?

  1. Start a Kimi Code CLI session on Linux with the model set to Qwen3.8 Max Preview.
  2. Ask the agent: "read *** starting from line 3".
  3. The agent issues a Read tool call with arguments: {"path": "main.go", "line_offset": 3}
  4. The call is rejected by argument validation before execution.

What is the expected behavior?

line_offset: 3 is a JSON integer and matches the tool schema (anyOf two integer branches: 1..2^53-1 and -1000..-1), so the call should be accepted and return the file content starting from line 3.

Additional information

 - Model: Qwen3.8 Max Preview
 - Kimi Code CLI version:  0.29.0
 - OS: Linux
 - The duplicated "must be integer" messages suggest the value fails both anyOf branches — possibly the value reaches the validator as a non-integer (e.g. string "3" or float 3.0) even though the model emitted an integer literal, or the anyOf

branch errors are reported misleadingly.
- Possibly related to the known issue where Qwen3.8 Max Preview serializes numeric tool parameters as strings.
- Workaround: use Bash tail -n +3 <file> instead of Read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions