fix(update-doc): accept plain string insert in delta_format schema#342
Merged
LinoyMargan merged 3 commits intoMay 12, 2026
Merged
Conversation
The LLM generates standard Quill delta ops with plain string inserts
(e.g. {"insert": "Hello"}) but the schema only accepted the object form
({"insert": {"text": "Hello"}}), causing schema validation to reject
valid tool calls before execution.
Added z.string().transform() as the first union member so plain strings
are automatically coerced to the object form. Existing object-form inputs
are unaffected.
Monday: https://monday.monday.com/boards/3713040192/pulses/11745156520
Co-Authored-By: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
73dc287 to
058a061
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
RoniLandau
approved these changes
May 12, 2026
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
update_doctool'sDeltaOperationSchemaonly acceptedinsertas an object ({text: "..."}) but the LLM naturally generates standard Quill format with plain string inserts ({"insert": "Hello"}), causing schema validation to reject valid tool calls before executionz.string().transform((s) => ({ text: s }))as the first union member — plain strings are coerced to the object form automatically; existing object-form inputs are unaffectedMonday Item
https://monday.monday.com/boards/3713040192/pulses/11745156520
Test Plan
yarn test --testPathPattern="update-doc-tool"(56 tests)tsc --noEmitupdate_docwith plain string inserts (e.g.{"insert": "Hello world"}) without schema validation error🤖 Generated with Claude Code