From 4bda1dc66846f72dd7fe9eff92240fd602c97803 Mon Sep 17 00:00:00 2001 From: Jonathan Payne Date: Mon, 13 Apr 2026 23:29:12 -0400 Subject: [PATCH] OpenConceptLab/ocl_issues#2471 | Generalize bridge detection to support any bridge source The is_bridge check previously hardcoded CIEL as the only valid bridge source. Now it detects bridge mode whenever the search repo differs from the target_repo filter, making it source-agnostic. Algorithm label changes from 'ocl-ciel-bridge' to 'ocl-bridge'. Co-Authored-By: Claude Opus 4.6 (1M context) --- core/concepts/views.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/concepts/views.py b/core/concepts/views.py index c544d574..5f8fc0a9 100644 --- a/core/concepts/views.py +++ b/core/concepts/views.py @@ -838,10 +838,11 @@ def filter_queryset(self, _=None): # pylint: disable=too-many-locals,too-many-s reranker = self.request.GET.get('reranker', None) in get_truthy_values() score_to_sort = 'search_rerank_score' if reranker else 'search_normalized_score' cid = get_cid() - is_bridge = (repo_params.get('owner', None) == 'CIEL' and repo_params.get('source', None) == 'CIEL' and - filters.get('target_repo', None) and - drop_version(filters.get('target_repo', None)) != '/orgs/CIEL/sources/CIEL/') - algorithm = ('ocl-ciel-bridge' if is_bridge else 'ocl-semantic') if is_semantic else 'ocl-search' + target_repo_filter = filters.get('target_repo', None) + search_repo_url = f"/orgs/{repo_params.get('owner')}/sources/{repo_params.get('source')}/" + is_bridge = (is_semantic and target_repo_filter and + drop_version(target_repo_filter) != search_repo_url) + algorithm = ('ocl-bridge' if is_bridge else 'ocl-semantic') if is_semantic else 'ocl-search' results = [] for row in rows: start_time = time.time()