Name only the actually-missing task fields in rejections - #536
Merged
TheGreatAxios merged 3 commits intoAug 23, 2026
Merged
Conversation
The task tool rejected a call missing prompt with "requires description (string) and prompt (string)" even when description was provided, so models could not tell which field was missing and retried the identical call. Rejections now name only the missing, invalid, or empty fields and echo the valid one back with a hint to keep it and add the other.
…red-fields-when-only Amp-Thread-ID: https://ampcode.com/threads/T-01a02c68-0d8d-777b-b717-81fb9a282023 Co-authored-by: Amp <amp@ampcode.com>
…red-fields-when-only
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Models call
taskwith a full typed brief but omitprompt. The validator rejected with "Error: task requires description (string) and prompt (string)." even though description WAS provided — the model cannot tell which field is missing and retries the identical call (observed 8x per session, 44 rejections in 3 days).Change
Both required-field rejections in
src/subagent/task-tool.tsnow name only the actually-missing, invalid, or empty field(s) and echo the valid field back:is missing X (string): <hint>has invalid X (must be a string): <hint>requires a non-empty X: <hint>intent) surface the arktype summary instead of blaming the required fields.No prompt synthesis; tool structure unchanged.
Tests
Updated the empty-field test to assert the specific field is named, and added missing-field cases: description present + prompt missing, prompt present + description missing, both missing.
typecheck, build, and all 5115 tests pass. Repo-wide
prettier --check/eslintfailures are pre-existing on main (CI lint job is non-blocking and fails there too); the changed files introduce no new lint errors and the added code is prettier-clean.Fixes CL-6901