fix(mcp): keep integration_save create-field gaps off Sentry - #1203
Conversation
Missing required fields when creating an integration (e.g. accessTokenSecretName) are agent-fixable; throw McpCallerError so they stay off Sentry (KODY-CLOUDFLARE-3N).
📝 WalkthroughWalkthroughIntegration creation validation now throws ChangesIntegration validation
Estimated code review effort: 2 (Simple) | ~10 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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@packages/worker/src/mcp/capabilities/integrations/integration-save.node.test.ts`:
- Around line 168-187: The test for the missing accessTokenSecretName must
continue validating the existing error message, not only the error type. Update
the earlier rejection assertion around integrationSaveCapability.handler to
retain the message-matching check alongside the McpCallerError assertion, while
preserving the current validation scenario.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e5be8be5-e1ff-4736-9766-355c45518397
📒 Files selected for processing (2)
packages/worker/src/mcp/capabilities/integrations/integration-save.node.test.tspackages/worker/src/mcp/capabilities/integrations/integration-save.ts
|
🔎 Preview deployed: https://kody-pr-1203.kody-a99.workers.dev Worker: Mocks:
|
Address CodeRabbit feedback so create-field gap tests still pin the caller-facing message alongside McpCallerError.
Intent
Stop Sentry triage noise from agent mistakes when creating OAuth integrations without required secret field names (KODY-CLOUDFLARE-3N).
Summary
integration_savecreate-time Zod failures (missingaccessTokenSecretName, etc.) now throwMcpCallerErrorinstead of a plainError.mcp-eventlogs and out of Sentry.Testing
integration-save.node.test.ts(includes Slack-shaped missingaccessTokenSecretNamecase; pins message + type)System changes
System recap — composes existing primitives (low risk)
Mode: recap · Base:
main@a3ea47af· Head:783c5479Classification: composes — wires the existing
McpCallerError/ MCP observability skip path into create-time validation; no new primitives or schema changes.Primitives touched
integrationsMcpCallerErrorfor create-field gapsSystem map
Agent calls
integration_savewith incomplete create args; the capability rejects with a caller error that observability keeps off Sentry.Legend: green = composes (wiring only) · amber = extended by this PR · red = new primitive · gray = context (unchanged, included only when an edge crosses it).
Summary by CodeRabbit