MoonshotAI / MoonshotAI/kimi-code

Improve tool-call error feedback for faster model self-correction

Open
#819 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What feature would you like to see?

Problem

When a model sends a tool call with wrong arguments (e.g. typo in property name), the error message it gets back is too terse to self-correct efficiently. The model burns a full round-trip per attempt, often repeating the same mistake multiple times before converging on the right argument names or giving up.

In a sample session the LLM model repeatedly sent offset/limit to Read (which expects line_offset/n_lines) because the error (e.g. must NOT have additional property 'offset') didn't hint at what the valid properties are.

Proposed changes

For each category of JSON Schema validation error, include actionable hints:

  • Unknown property — currently reports the offending property name only.
    Should also list the valid property names declared in the schema, e.g.:
    must NOT have additional property 'offset'; valid properties: path, line_offset, n_lines

  • Missing required property — currently reports which property is missing.
    Should also include the expected type if the schema declares it, e.g.:
    must have required property 'path' (expected string)

Additional information

No response

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 locating the JSON Schema validation handling for tool-call errors and compare the unknown-property and missing-required cases. Done means errors include valid property names or expected types where available, with tests covering both examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.