Repository navigation
Conversation
Resolve organization and cluster names to IDs in the client and send them as X-RawTree-Organization-Id and X-RawTree-Cluster-Id instead of query params. Commands pass a typed Scope, organization paths use IDs, and the saved defaults also store IDs so requests skip the name lookups.
…scope feedback by UUIDs
Replace the saved-ID side table with a Selector type: main resolves the organization and cluster from flags, environment and config, substituting saved IDs for config selections, and hands commands a scoped client. The client no longer knows where an ID came from.
The hint was added to any 403 or 404 after a command used saved IDs, so a missing table or a non-admin API key was reported as a stale ID. Server errors now carry their status, and on a refusal the CLI checks whether the credential can still see the saved organization and cluster before adding the hint.
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 875a308. 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.

The backend now selects the organization and cluster with headers and takes organization IDs in paths. The CLI still built name-based query params and paths.
X-RawTree-Organization-IdandX-RawTree-Cluster-Id.organization=/cluster=query params.Note
High Risk
This rewrites the HTTP client's routing, discovery, and credential handling for every command; regressions could mis-route requests, break API keys, or leave saved defaults out of sync with the server.
Overview
The CLI stops putting organization and cluster in URLs and instead carries them on
ApiClientscope, resolved toX-RawTree-Organization-IdandX-RawTree-Cluster-Id(and regional routing when needed).Selectortreats UUIDs as IDs and everything else as names; user sessions discover routes as before, while API keys resolve names only against their bound org/cluster.Config now stores
default_organization_id/default_cluster_idnext to the saved names (auth,use, create flows), so routine calls can skip lookups and stay valid across renames. Commands were trimmed to plain paths like/v1/databasesandorg::database_pathonly addsdatabase=—the shared scope helpers were removed.Supporting changes include a thread-safe,
Arc-shared routing cache, cluster discovery keyed by organization ID, organization admin routes using IDs in paths, a typedServerError, and broad test updates for header-based scope.Reviewed by Cursor Bugbot for commit 7a42606. Bugbot is set up for automated code reviews on this repo. Configure here.