Conversation
Two input shapes an agent naturally sends, one rejected outright and one
silently dropped. Both surfaced while running every tool against a live
portal.
`b24_task_create` declared `priority` as `z.enum(['0','1','2'])`, so
`priority: 2` — the obvious thing to write next to `responsibleId: 9` and
`groupId: 1`, both numbers — failed validation with
`Invalid option: expected one of "0"|"1"|"2"`. It now takes a number or
the string and normalises to the string Bitrix24 wants on the wire.
`b24_task_elapsed_time_list` returns the note as `commentText`
(Bitrix24's COMMENT_TEXT), while add / update call the same field
`comment`. Zod drops unknown keys, so an agent that lists entries and
reuses the name it just read gets no error and no note:
b24_task_elapsed_time_add { taskId: 4193, seconds: 3600,
commentText: "QA: час работы" }
→ {"added": true, ...}
b24_task_elapsed_time_list { taskId: 4193 }
→ entries[0].commentText === "" ← the note is gone
On update the same mix-up hit the "no changes" refusal instead, which at
least fails loudly but still blames the operator for something the
schema did. Both write tools now accept `commentText` as an alias of
`comment`, preferring `comment` when both are supplied.
Neither change alters the wire payload for input that already worked.
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.
Summary
Two input shapes an agent naturally sends:
priority: 2onb24_task_create(rejected by a string-only enum) andcommentTexton the elapsed-time write tools (silently dropped, because the read tool returns that name and Zod ignores unknown keys). Both accepted now; the wire payload for input that already worked is unchanged.Type of change
Linked issue
Checklist
pnpm lintpassespnpm typecheckpassespnpm testpassesdocs/andskills/(tool descriptions updated in place; no convention change, so the authoring docs need no edit)Screenshots / logs
priorityas a number, before:After:
{"created": true, "id": "4195", …}, withPRIORITY: "2"on the wire.commentText, before — no error, and the note is gone:After:
Notes for reviewers
Both are small, but they share a shape worth naming: the schema was stricter than the agent's natural guess, and in one case the strictness was silent.
On
priority— the enum was presumably chosen because Bitrix24 wants a string. That's still what goes on the wire; the union just stops the tool from being the only place in the task API where a number isn't a number. If you'd rather keep one canonical form,z.coerce.string().pipe(z.enum([...]))would also work, but it accepts"true"-ish junk more readily than an explicit union, so I went with the union.On the alias — the asymmetry is inherited from Bitrix24 (
COMMENT_TEXTon the wire,commentin the tool schema), and I did not rename anything:commentstays the documented field,commentTextis an accepted alias with a.describe()that says so. The alternative would be renaming the read-side projection tocomment, which is a breaking change for anyone parsing the list output, so an alias seemed like the cheaper direction. Happy to flip it if you'd rather converge on one name.There is a third instance of the same class I did not touch, since it's arguably intended:
b24_task_updatetakes UPPERCASEfieldskeys whileb24_task_listaccepts camelCase filters. Worth a decision at some point, but not in a bug-fix PR.