feat: unify MCP slug availability across toolsets and mcp_endpoints - #5917
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCzhsvUYz5VMieXYaQUC2Z
🦋 Changeset detectedLatest commit: a5c0993 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Running ultrareview automatically — This change unifies MCP slug availability across two tables with a complex cross-table SQL query and owner-exclusion logic; a subtle bug could silently break runtime address resolution or block legitimate operations, warranting deep review.. I'll post findings when complete. |
There was a problem hiding this comment.
Ultrareview completed in 7m 47s
All reported issues were addressed across 9 files
Tip: instead of fixing issues one by one fix them all with cubic
Re-trigger cubic
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCzhsvUYz5VMieXYaQUC2Z
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCzhsvUYz5VMieXYaQUC2Z
End-to-end verification (this PR's changes)Context: all three Phase-1 branches (#5917, #5918, #5919) were merged into a scratch tree (zero conflicts), the full server suite ran on the merged tree — 14,334 tests, 1 failure: a pre-existing skills-subsystem clock flake, passes in isolation, unrelated to these PRs — and a local stack was booted from the merged tree with simulated backfill rows (a toolset-backed Scenarios exercising this PR:
No panics or unexpected errors in server logs. All test rows and flag changes were reverted after the run (verified by query). 🤖 Generated with Claude Code |
…nify-mcp-slug-availability
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TCzhsvUYz5VMieXYaQUC2Z
AIM-22
Summary
mcpendpoints.CheckSlugAvailable, backed by a newCheckUnifiedSlugAvailabilityquery that answers "is(custom_domain_id, slug)taken" against bothmcp_endpoints.slugandtoolsets.mcp_slugin the same address scope (platform vs custom domain). The endpoint-onlyCheckSlugAvailabilityquery is deleted.updateToolset, the toolsets availability handler (now platform-scoped rather than a cross-namespace globalEXISTS; wire contract unchanged), andmcpendpointscreate/update/check. Create checks inside the transaction after locks; update only re-checks when the(slug, domain)address actually changes.useMcpEndpointSlugValidationdrops its second RPC totoolsets.checkMCPSlugAvailability.Motivation
toolsets.mcp_slugandmcp_endpoints.slugeach had their own partial unique indexes and their own availability query, and neither saw the other table — while every public entry point resolvesmcp_endpointsfirst and falls back totoolsets.mcp_slug. An endpoint created with a live hosted server's slug would silently take over that address. This makes availability a single namespace per scope for as long as the two representations coexist, and is the first step of the toolsets-under-mcp_servers migration (the toolset-side query is removed later with the runtime fallback).🤖 Generated with Claude Code
https://claude.ai/code/session_01TCzhsvUYz5VMieXYaQUC2Z
Summary by cubic
Unifies MCP slug availability across
toolsets.mcp_slugandmcp_endpoints.sluginto one namespace per address scope (AIM-22). Previously each table checked only itself, so an endpoint could take over a slug a live hosted server still resolved under; now a slug held by either table blocks the other.Refactors
CheckSlugAvailabilityquery withCheckUnifiedSlugAvailability, probing both tables in the same address scope, and adds apg_advisory_xact_lockon write paths that serializes competing claims the per-table unique indexes can't catch.updateToolsetre-probes on any effective(slug, domain)change and skips the domain-liveness guard so a rename under a soft-deleted domain still works.mcpEndpointscreate/update,SetRootMcpEndpoint, and toolset create/clone now take the lock and shared check; generated toolset slugs regenerate on collision. The dashboard drops its second RPC, whiletoolsets.checkMCPSlugAvailabilitystays for the inline editor — now deprecated, auth-gated, and faulting on endpoint slugs too.Written for commit a5c0993. Summary will update on new commits.