Stop prefixing vector_search_endpoints names#5209
Merged
janniklasrose merged 6 commits intomainfrom May 8, 2026
Merged
Conversation
The vector search endpoint name is the resource's primary key — it's how GET, UPDATE, and DELETE address it. Prefixing it (via dev-mode or presets.name_prefix) changes the resource's identity rather than just its display name, which is the wrong semantic. Co-authored-by: Isaac
Capture the rule the previous commit relies on: prefixing only applies to display-name fields, never to fields the API treats as the primary key / object id. Also point future maintainers at TestAllNonUcResourcesAreRenamed as the enforcement mechanism. Co-authored-by: Isaac
…enamed The carve-out list now includes VectorSearchEndpoint, which isn't a UC resource, so the old name no longer matches what the test does. Also refactor the long OR chain that listed resource types to skip into a slices.Contains over a named slice, hoisted to the outer loop so the skip happens once per resource type instead of once per instance. Update the agent rule that referenced the old test name. Co-authored-by: Isaac
Co-authored-by: Isaac
Co-authored-by: Isaac
denik
approved these changes
May 8, 2026
denik
reviewed
May 8, 2026
| To check whether a field is identity-bearing, look at the matching `bundle/direct/dresources/<resource>.go`: | ||
|
|
||
| - If `DoCreate` returns the name as the deployment id (e.g. `id := config.Name`) and `DoRead`/`DoUpdate`/`DoDelete` look the resource up by that name, the name is the primary key — do not prefix it. | ||
| - If the name is purely cosmetic and the API addresses the resource by a separate id (numeric, UUID, etc.), prefixing is fine. |
Contributor
There was a problem hiding this comment.
I think we can shorten this without any loss of signal or even drop this.
The agents are going to read apply_presets.go anyway and should be able figure out from the comments and existing resources what to do for a new one.
Contributor
Author
There was a problem hiding this comment.
Agreed and dropped in 6d240dc — checked with both Claude and Cursor (GPT) for a second opinion on whether a rule like this would actually change agent behavior, and both said they would read apply_presets.go and the test first and that the in-code comment + notRenamedFields list with its primary-key rationale is sufficient evidence. The rule was a restatement that got in the way more than it helped.
Per review feedback: the in-code comment in apply_presets.go plus TestAppropriateResourcesAreRenamed (with its notRenamedFields list and the "primary key / object id" rationale in the doc comment) carry the load. The agent rule was largely a restatement and gets in the way more than it helps. Also remove the dead reference to the file from the test doc comment. Co-authored-by: Isaac
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.
Changes
presets.name_prefix(and the dev-mode[dev <user>]rename) tovector_search_endpointsinbundle/config/mutator/resourcemutator/apply_presets.go..agent/rules/name-prefix.mdcapturing the principle (only prefix display-name fields; never primary-key / object-id Names), scoped via globs toapply_presets.go,apply_target_mode*.go, andbundle/direct/dresources/*.go. Mirror as.cursor/rules/name-prefix.mdc.TestAllNonUcResourcesAreRenamed→TestAppropriateResourcesAreRenamed(the carve-out list now includes a non-UC resource), and refactor the longresourceType ==OR chain into aslices.Containsover a named slice hoisted to the outer loop.NEXT_CHANGELOG.mdentry under Bundles.Why
The vector search endpoint name is the API primary key — it's how GET, UPDATE, and DELETE address the resource (
bundle/direct/dresources/vector_search_endpoint.go:id := config.Name;recreate_on_changesfor the resource doesn't listnameonly because there's no rename API at all, so a name change would silently drift). Prefixing it changed which remote endpoint the bundle pointed at, not just the label the user saw. The rule we want to encode is broader (display-name fields can be prefixed; identity-bearing Names cannot), but this PR only fixes the vector_search_endpoints case to keep the change focused; mlflow Models, ModelServingEndpoints, etc. have the same issue and are tracked for follow-up.Tests
go test ./bundle/config/mutator/resourcemutator/passes;TestProcessTargetModeDevelopmentnow assertsvs_endpoint1(notdev_lennart_vs_endpoint1), andTestAppropriateResourcesAreRenamedincludes*resources.VectorSearchEndpointin the carve-out list and verifies the Name doesn't pick up adevprefix.apply_presets.gocauses both the explicit assertion and the reflective sweep to fail with clear diffs../task fmt,./task checks,./task lint,./task testclean.This PR was written by Claude Code.