Make capability validation errors agent-readable - #1376
Conversation
📝 WalkthroughWalkthroughMCP capabilities now wrap Zod input failures as ChangesMCP capability validation
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 738080e. Configure here.
|
🔎 Preview deployed: https://kody-pr-1376.kody-a99.workers.dev Worker: Mocks:
|

Intent
Make Zod-backed capability input validation failures actionable for agents instead of exposing raw serialized issue arrays, while keeping invalid capability outputs reportable as server defects.
Summary
McpCallerErrorwith the capability name, prettified field-level issues, and asearchrepair hint.parse_inputandparse_outputobservability phases.Testing
npx vitest run packages/worker/src/mcp/capabilities/define-capability.node.test.ts --project node-unit— 1 file / 1 test passed after reviewer fixes.npm run validatepassed before the reviewer adjustment. Two post-adjustment attempts were blocked by the Cloud VM'sworkerdDNS failure forartifacts-mock.test; the focused changed test and the equivalent split CI gates passed.System changes
System recap — extends an existing primitive (medium risk)
Mode: recap · Base:
main@be5e29d5· Head:6d5f86a2Classification: extends — changes the capability registry's runtime validation error contract without adding a primitive.
Primitives touched
capability-registrySystem map
Capability execution enters the registry, where this change formats schema failures before they cross back to the MCP caller while preserving server-error reporting for invalid outputs.
Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Before / after
Conductor report
Status: DONE — squash-merged and deployed.
Evidence: merged commit
eee75d1fc75b09020b4b685b1335c8d13991eca9; both valid Bugbot findings fixed in6d5f86a2; focused regression test passed; PR CI, post-merge main validation, and production deploy all passed. Production healthcheck, execute smoke, Sentry source-map upload, and capability-vector reindex succeeded. Discord summary message1536452436217303100was posted to channel1491568683737157683.Remains: nothing. The required
createRunreport returned Cursor API 409 both initially and after the mandated one-minute retry, so this full report is recorded here and in Discord per fallback policy.Summary by CodeRabbit