Skip to content

fix(cad): agents can recover when a cad tool rejects their arguments - #203

Merged
AadiJo merged 1 commit into
mainfrom
cad-tool-arg-errors
Nov 3, 2026
Merged

AadiJo merged 1 commit into
mainfrom
cad-tool-arg-errors

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Agents in CAD chats kept hitting tool errors they could not recover from. Transcripts showed the same mistakes again and again:

  • cad_find_parts and cad_measure rejected bad input with a bare invalid-operation and no details. One agent sent {query:"transfer"} three times because nothing said the field is nameQuery.
  • The descriptions told agents to take expectedRevision from cad_context. Every cad_update_view bumps the revision, so later reads failed with a bare revision-conflict, and agents retried the stale revision. This was the most common failure after render timeouts.
  • cad_update_view said empty occurrenceIds clears ghosting, but the schema still required opacity, so {type:"ghost",occurrenceIds:[]} failed.
  • cad_update_view presets are isometric, front, and so on, but cad_featurescript_preview calls the same view iso. A camera-preset call failed with Expected "isometric" | "front" | ....

Fix

  • cad_find_parts and cad_measure decode input with the same decodeCadToolInput as the other tools, so field errors come back in details. A stale cad_find_parts cursor says why it no longer works.
  • revision-conflict errors from the view, read, and capture tools name the current revision and snapshot. The descriptions now say to use the latest revision.
  • ghost takes an optional opacity (default 0.2). Empty occurrenceIds clears ghosting.
  • camera-preset accepts iso as another name for isometric. The description lists every preset.

Testing

  • A replay script sends inputs copied from real agent transcripts through findCadParts, measureCad, and updateCadView. On main all 10 failing calls return bare errors or fail; iso reproduces the camera error exactly. On this branch each error now names the field or revision to fix, and the ghost and iso calls succeed.
  • vp check has 0 errors and typecheck is clean. The server cad, provider, mcp, and cadMcp tests pass (814 tests), and so do the web cad tests (238).

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cadsense Ready Ready Preview Nov 3, 2026 6:53pm UTC

@AadiJo
AadiJo merged commit f406723 into main Nov 3, 2026
8 checks passed
@AadiJo
AadiJo deleted the cad-tool-arg-errors branch November 26, 2026 19:49

This branch was successfully deployed

1 active deployment
Preview — d9b1e014 Deployed Nov 3, 2026 by vercel[bot]
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