Repository navigation
Route MCP requests across regional deployments and isolate outages - #36
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4cc4c01. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

User-authenticated MCP requests previously discovered clusters only through the default deployment. Discover clusters across enabled deployments, resolve routing through each cluster’s region ID, and send requests to deployment-specific public API hosts while retaining routing headers. Authoritative regional records take precedence over gateway duplicates in either response order.
Match the UI’s regional-outage handling: each deployment lookup has a five-second deadline; successful deployments return healthy clusters with
unavailable_regionscontaining failed region IDs and names. Authentication failures and total outages remain errors. Requests for clusters absent from a partial catalog, or gateway stubs lacking both a region reference and valid routing metadata, refresh discovery and fail safely if the cluster is still undiscovered, preventing default-gateway fallback and allowing immediate recovery. The list-clusters tool description and README explain partial results.Supports current 8-character and legacy 32-character deployment IDs. Custom API origins and API-key routing retain their existing behavior. Merged current main to preserve the newer workflow and query-tool fixes; release notes are under Unreleased.
Validation: all 275 tests passed; pnpm lint, pnpm build, and git diff --check passed. Coverage includes direct EU requests, duplicate deployments and gateway records, custom endpoints, API keys, legacy IDs, partial/total outages, DNS failures, timeouts, authorization errors, empty healthy catalogs, recovery, cluster-ID mutations, and gateway stubs during outages in both catalog orders. An in-memory MCP tool check using the compiled server and a simulated stalled regional transport returned partial results after 5.02 seconds using the real deadline, then routed to the recovered region. Final structured autoreview reported no actionable findings.
Related Platform changes: https://github.com/rawtreedb/rawtree-platform/pull/1566, https://github.com/rawtreedb/rawtree-platform/pull/1575, and https://github.com/rawtreedb/rawtree-platform/pull/1637.
Companion CLI change: rawtreedb/rawtree-cli#85.
Note
Medium Risk
Changes core request routing and cluster discovery for OAuth/session users; mis-routing or stale cache could send operations to the wrong deployment, though extensive tests cover outages and recovery.
Overview
User-authenticated clients no longer list clusters only through the default API gateway.
listClustersfans out to each enabled regional deployment (deduped by routing headers), merges catalogs with authoritativeregion_idmetadata over gateway duplicates, and attachesunavailable_regionswhen some deployments fail within a 5s per-target deadline.rt_API keys keep the single-gateway behavior.Scoped cluster operations gain
deploymentApiUrl, rewritingapi.rawtree.com/api.rawtree.devto deployment-specific public hosts while still sendingX-RawTree-Deployment-Id/X-RawTree-Region. Custom API origins are unchanged.ClusterRoutingrefuses gateway-only stubs during partial discovery, invalidates cache for retry after recovery, and errors safely when a cluster is missing from a partial catalog. Legacy 32-character deployment IDs are accepted alongside 8-character IDs.Docs and the
list-clustersMCP tool description explain partial results and retry expectations.Reviewed by Cursor Bugbot for commit a2ccc5e. Bugbot is set up for automated code reviews on this repo. Configure here.