MoonshotAI / MoonshotAI/kimi-code

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

Open
#2,118 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Read call in a Kimi Code CLI session using line_offset 3, then inspect the Read tool schema and argument-validation path, including how Qwen3.8 Max Preview serializes numeric parameters. Done means an integer line_offset is accepted and Read returns content beginning at the requested line, with relevant validation coverage added if that path is tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
67/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.