Semantic Code Search does not include Premium plans
Context
A customer that should be eligible for Semantic Code Search is getting the following error when invoking it:
Error: Tool execution failed: Unable to perform semantic search, Project <project_path> has no embeddings - pluse use another tool or context source
Findings
From @arturoherrero on slack thread:
The Semantic Code Search is documented as supporting Premium + Ultimate tiers, but the code only enables it for Ultimate customers. Premium customers are incorrectly filtered out?
namespace = Project.find_by_full_path(project_path).root_namespace
✅ Premium subscription: true
✅ Not expired: true
✅ Duo features enabled: true
✅ Experiment features enabled: truewith_ai_supported_plan
puts "Current check (ai_features): #{Namespace.with_ai_supported_plan(:ai_features).where(id: namespace.id).exists?}"
❌ Has AI plan (ai_features): false # ai_features is Ultimate-only
puts "Proposed fix (mcp_server): #{Namespace.with_ai_supported_plan(:mcp_server).where(id: namespace.id).exists?}"
✅ Has AI plan (mcp_server): true # mcp_server is Premium+def self.valid_saas_namespaces Namespace .group_namespaces .top_level .with_ai_supported_plan # ❌ Defaults to :ai_features (Ultimate-only) https://gitlab.com/gitlab-org/gitlab/-/blob/a6531098b721c826b7b4be84edaef41827e3a5d6/ee/app/models/gitlab_subscriptions/features.rb#L224 .merge(GitlabSubscription.not_expired) end
Proposal
From @arturoherrero on slack thread
A possible fix?
def self.valid_saas_namespaces Namespace .group_namespaces .top_level .with_ai_supported_plan(:mcp_server) # ✅ Premium + Ultimate .merge(GitlabSubscription.not_expired) end
From @partiaga on slack thread
I think it's time to introduce a feature specific to
semantic_code_search, and have that be eligible for PREMIUM and ULTIMATE.