fix(copilot): declare item schemas on table tool array params - #7458
Conversation
The catalog declared updates, rows, order, columnNames, and disabledTagIds
as arrays with no items schema. The provider-path sanitizer fills a missing
items with {type: "string"}, so the model was told batch_update_rows takes a
list of strings and sent [] or ["rowId", "data"]; the executor then crashed
on Object.entries(undefined) and masked it as a generic table failure.
Sync the catalog with item schemas so the router's Ajv validation rejects a
malformed call with an actionable error, validate element shape in the table
tool as a last line, and match operation verbs as tokens in tool-call titles.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Greptile SummaryThe PR strengthens Copilot table-tool contracts and executor validation so malformed array elements produce actionable input errors rather than downstream crashes.
Confidence Score: 5/5The PR appears safe to merge with no actionable correctness or security defects identified. The added schemas agree with the documented executor contracts, defensive validation prevents malformed elements from reaching table services, and every current catalog operation is classified correctly by the title logic.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/copilot/generated/tool-catalog-v1.ts | Adds catalog item definitions matching the documented array element contracts. |
| apps/sim/lib/copilot/generated/tool-schemas-v1.ts | Mirrors the item constraints into runtime Ajv schemas so malformed elements are rejected at routing. |
| apps/sim/lib/copilot/tools/server/table/user-table.ts | Adds defensive shape checks for batch row inserts and updates before table-service calls. |
| apps/sim/lib/copilot/tools/tool-display.ts | Matches operation verbs as underscore-delimited tokens, correctly covering existing compound operation IDs. |
| apps/sim/lib/copilot/tools/server/generated-schema.test.ts | Covers runtime schema rejection of malformed update, row, and sort-order array elements. |
| apps/sim/lib/copilot/tools/server/table/user-table.test.ts | Covers executor-level malformed batch payload handling and both supported update formats. |
| apps/sim/lib/copilot/tools/tool-display.test.ts | Covers title classification for representative compound table operations. |
Reviews (1): Last reviewed commit: "fix(copilot): declare item schemas on ta..." | Re-trigger Greptile
Summary
updates,rows,order,columnNames, anddisabledTagIdswere declared in the tool catalog as arrays with no item schema. The provider-path sanitizer fills a missingitemswith{type: "string"}, so the model was toldbatch_update_rowstakes a list of strings and sent[]or["rowId", "data"], which the executor then crashed on (Object.entries(undefined)) and masked as a generic table failureitemsadditions only; the description text Sim already carries is preservedupdates/rowselement shape in the table tool as a last line, with messages naming the bad index and the expected shapebatch_update_rowsrenders as "Updating rows" instead of the generic "Editing rows"Companion: simstudioai/mothership#473
Type of Change
Testing
bun run type-check,bun run lint,bun run check:audits,bun run docs-manifest:checkChecklist