MoonshotAI / MoonshotAI/kimi-code
Improve tool-call error feedback for faster model self-correction
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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