Release v1.11.0 — Lenient Bulk Input Coercion #44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "release/1.11.0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Release v1.11.0 — Lenient Bulk Input Coercion
Changes
Summary
When AIs call bulk tools with the wrong input shape (e.g., flat
work_package_ids+ shared fields instead ofitemsarray), the server now auto-reshapes the input and succeeds. When reshaping isn't possible, it returns a coaching error with a concrete example of the correct format.All 5 bulk tools gained lenient input handling:
{ work_package_ids: [1,2], status: "Closed" }shorthand{ items: [{ id: N }] }formatChecklist
References
Version: 1.11.0 (Gravity PM)
Accept both { items: [{id, ...fields}] } (canonical) and { work_package_ids: [id, ...], field: value } (flat shorthand) as input. The flat shorthand fans shared fields across all IDs into a canonical items array. Returns a coaching error with examples when neither pattern matches. Closes OP#2494 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Accept both { items: [...] } (canonical) and a single object with project_id + subject (auto-wrapped into items array). Returns coaching error with correct format example on unrecognized input. Closes OP#2496 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>Accept both { items: [...] } (canonical) and a single object with from_id + to_id + type (auto-wrapped). Returns coaching error with correct format example on unrecognized input. Closes OP#2497 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>bulk_transition_work_packages and bulk_delete_work_packages now accept { items: [{ id: N }] } in addition to { work_package_ids: [N] }. IDs are extracted automatically. Shared idArrayPreprocess helper replaces duplicated coercion logic. resolveWpIds provides coaching errors when neither pattern matches. Closes OP#2495 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>PR Review — Release v1.11.0 — Lenient Bulk Input Coercion
Verdict: Acceptable
303/303 tests passing. Lint clean. No security concerns.
Findings
🟡 Important (1)
1. Inline preprocess in
bulk_updatediverges from sharedidArrayPreprocessFile: index.js, ~line 1763
The
work_package_idspreprocess insidebulk_update_work_packagesis written inline with slightly different behavior than the sharedidArrayPreprocesshelper used bybulk_transitionandbulk_delete:Invalid ID at position N)The fix is straightforward — replace the inline preprocess with
idArrayPreprocess:This deduplicates the code and ensures consistent error handling across all bulk tools.
:blue_circle: Minor (2)
2.
resolveWpIdssilently filters invalid IDs from items arrayFile: index.js, ~line 1930
When extracting IDs from
items: [{ id: N }], invalid IDs are silently filtered:If an AI sends
[{ id: "abc" }, { id: 2 }], only ID 2 would be processed with no warning about the dropped item. Consider logging or returning a warning for filtered IDs so the caller knows items were skipped.3.
CREATE_FIELDSconstant defined inside function bodyFile: index.js,
resolveBulkCreateItemsThe
CREATE_FIELDSarray is defined inside the function, meaning it's recreated on every call. This matches the pattern used forBULK_UPDATE_SHARED_FIELDS(hoisted outside), so hoistingCREATE_FIELDSto module scope would be consistent. Not a performance concern — just style consistency.⚪ Nitpick (1)
4. CHANGELOG gap: 1.8.0 → 1.11.0
The CHANGELOG jumps from 1.8.0 to 1.11.0. Versions 1.9.0, 1.10.0-alpha, and 1.10.1 have no entries. Pre-existing, not introduced by this PR, but worth addressing in a future housekeeping pass.
Summary
Well-executed feature. The approach of accepting both canonical and shorthand formats at the schema level (rather than fighting the MCP SDK with
z.preprocessat the object level) is a pragmatic solution that works within SDK constraints. The resolver-per-tool pattern is clean and easy to follow.Test coverage is thorough — 16 new tests covering all coercion paths (canonical passthrough, shorthand reshaping, coaching errors) for all 5 bulk tools. The
err(e.message)→err(e)bugfix is a good catch.The only item worth fixing before merge is finding #1 (inline preprocess inconsistency) — it's a one-line change to use the shared helper.
Reviewed by Gravity Bot — advisory only, does not approve or reject
PR Followup — Review Findings Addressed
Fixed (v1.11.0 — this branch)
idArrayPreprocess74bf906— replaced inline preprocess with shared helper, hoisted declaration before first usageDeferred (backlog)
resolveWpIdssilently filters invalid IDsCREATE_FIELDSinside function bodyVerification
release/1.11.0@74bf906All important+ findings resolved. PR is ready for merge.
Followup by Gravity Bot