Skip to content

Auto reconcile all magic mcp resources#613

Open
herber wants to merge 1 commit into
devfrom
chore/auto-reconcile-all-magic-mcp-resources
Open

Auto reconcile all magic mcp resources#613
herber wants to merge 1 commit into
devfrom
chore/auto-reconcile-all-magic-mcp-resources

Conversation

@herber

@herber herber commented May 21, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Adds a new every-minute cron plus batch/single reconciliation queues that can trigger frequent DB scans and backing upserts, increasing load and potential rate-limit/consistency issues if misconfigured.

Overview
Introduces automatic reconciliation for Magic MCP servers and endpoints that are active but missing Subspace backing/session IDs, driven by a new * * * * * cron that enqueues batched work and fans out into rate-limited per-resource jobs calling ensureMagicMcpServerBacking/ensureMagicMcpEndpointBacking.

Wires the new reconciliation processors into magicQueues and exports them, and updates provider-template reconciliation fan-out to use addManyWithOps with deterministic job IDs to avoid duplicate enqueues.

Reviewed by Cursor Bugbot for commit 3d1a60e. Bugbot is set up for automated code reviews on this repo. Configure here.

@herber herber self-assigned this May 21, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3d1a60e. Configure here.

magicMcpServer: true
}
}
} satisfies Prisma.MagicMcpEndpointInclude;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated magicMcpEndpointBackingInclude risks divergence from source

Low Severity

magicMcpEndpointBackingInclude is defined identically in both reconcileMagicMcpBacking.ts and backing.ts. The copy in backing.ts is the authoritative one (it drives the MagicMcpEndpointWithBackingRelations type used by ensureMagicMcpEndpointBacking). If the include structure changes in backing.ts, this duplicate could silently drift. Exporting the constant from backing.ts and reusing it here would eliminate the maintenance risk.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3d1a60e. Configure here.

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