Skip to content

Name only the actually-missing task fields in rejections - #536

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-6901-task-tool-rejection-names-both-required-fields-when-only
Aug 23, 2026
Merged

Name only the actually-missing task fields in rejections#536
TheGreatAxios merged 3 commits into
mainfrom
cl-6901-task-tool-rejection-names-both-required-fields-when-only

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Problem

Models call task with a full typed brief but omit prompt. 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.ts now name only the actually-missing, invalid, or empty field(s) and echo the valid field back:

Error: task is missing prompt (string): the actionable goal for the worker. Received description "Add GET /health route" — keep it and add prompt.

  • Missing field → is missing X (string): <hint>
  • Present but non-string → has invalid X (must be a string): <hint>
  • Whitespace-only → requires a non-empty X: <hint>
  • Arktype failures on optional fields (e.g. bad intent) surface the arktype summary instead of blaming the required fields.
  • Echoed values are truncated at 80 chars.

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/eslint failures 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

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.
@linear-code

linear-code Bot commented Aug 23, 2026

Copy link
Copy Markdown

CL-6901

@TheGreatAxios
TheGreatAxios merged commit c0c8abe into main Aug 23, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant