Skip to content

fix(coderd/x/chatd): shorten tool input validation errors - #32078

Merged
hugodutka merged 3 commits into
mainfrom
codex/concise-tool-validation-errors
Nov 12, 2026
Merged

hugodutka merged 3 commits into
mainfrom
codex/concise-tool-validation-errors

Conversation

@hugodutka

@hugodutka hugodutka commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Nested builtin tool input errors repeat an absolute schema path at every recursion level. Unwrap the validator's error chain to retain only the innermost path wrapper and its cause, with a comment explaining the dependency's wrapping behavior. Also remove the redundant sentence about exact property names and duplicate keys from the retry guidance.

Existing schema-validation tests now assert complete tool error messages for root failures, nested properties, arrays, and maps. Validation behavior and diagnostics embedded in the cause are preserved.

Refs #31541.

@hugodutka
hugodutka temporarily deployed to main November 12, 2026 09:36 — with GitHub Actions Inactive
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 09:36 — with GitHub Actions Inactive
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 09:43 — with GitHub Actions Inactive
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 09:43 — with GitHub Actions Inactive
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 09:44 — with GitHub Actions Inactive
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 10:33 — with GitHub Actions Inactive
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 10:34 — with GitHub Actions Inactive
@hugodutka
hugodutka marked this pull request as ready for review November 12, 2026 10:44
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 10:44 — with GitHub Actions Inactive
@hugodutka
hugodutka requested a review from mafredri November 12, 2026 10:44
return compiled.Validate(value)
// jsonschema-go wraps each recursive error with an absolute schema path.
// Keep the innermost wrapper so the location and cause are reported once,
// without repeating every ancestor path.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the validator error out on the first error, or list multiple errors? Just wondering if we notify of both missing fields if there are two, or just the one with this unwrapping.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The validator generally stops at the first failing check. My agent told me there are some exceptions

a single required check lists all missing properties of that object. If both fields are missing, it reports:

required: missing properties: ["old_text" "new_text"]

anyOf failures can include errors from multiple branches, embedded in the cause’s message. Those are also preserved.

@hugodutka
hugodutka merged commit decaf6e into main Nov 12, 2026
38 of 39 checks passed
@hugodutka
hugodutka deleted the codex/concise-tool-validation-errors branch November 12, 2026 10:50
@hugodutka
hugodutka temporarily deployed to main November 12, 2026 10:50 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026

This branch was previously deployed

1 inactive deployment
main — 16ab5fa6 Deployed Nov 12, 2026 by hugodutka via cla #254865
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants