Files
kilocode/.changeset/tool-invalid-args-actionable-error.md
T
Matt Van Horn fd60036e4a fix: make tool invalid-arguments errors clearly actionable to the model (#11961)
* fix: make tool invalid-arguments errors clearly actionable to the model

* fix: address kilo-code-bot review on schema error formatting

Return a jargon-free actionable message when the schema formatter yields no issues (instead of the raw SchemaError), and match Effect's missing-key message case-insensitively so it survives library wording changes.

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>

* Address review: cap rendered issues, isolate Kilo logic, harden the fallbacks

- Move formatter/format/path/reason out of the shared upstream tool.ts into
  packages/opencode/src/kilocode/tool/tool.ts.
- Cap output at 20 issues / 4 KiB with an '...and N more' suffix, since
  validation fails before the normal output truncation.
- Return a readable message when the formatter yields zero issues instead of
  falling back to SchemaError jargon.
- Match missing-key messages with a regex instead of an exact string compare.
- Rewrite the changeset around the user-visible outcome.

* chore: annotate the reformatted decode call with kilocode_change markers

The multi-line reformat left lines 122-125 unannotated in a shared upstream
file. Wrap the whole statement in a start/end block instead of per-line inline
markers, and drop the two now-redundant inline ones. Comments only.

---------

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Christiaan Arnoldus <christiaan.arnoldus@outlook.com>
2026-08-04 11:13:02 +02:00

122 B

@kilocode/cli
@kilocode/cli
patch

Help models recover from invalid tool calls with clear, field-specific validation errors.