Skip to content

Commit e332131

Browse files
paynejdclaude
andauthored
OpenConceptLab/ocl_issues#2471 | Generalize bridge detection to support any bridge source (#851)
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) <noreply@anthropic.com>
1 parent dbe6add commit e332131

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

core/concepts/views.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -838,10 +838,11 @@ def filter_queryset(self, _=None): # pylint: disable=too-many-locals,too-many-s
838838
reranker = self.request.GET.get('reranker', None) in get_truthy_values()
839839
score_to_sort = 'search_rerank_score' if reranker else 'search_normalized_score'
840840
cid = get_cid()
841-
is_bridge = (repo_params.get('owner', None) == 'CIEL' and repo_params.get('source', None) == 'CIEL' and
842-
filters.get('target_repo', None) and
843-
drop_version(filters.get('target_repo', None)) != '/orgs/CIEL/sources/CIEL/')
844-
algorithm = ('ocl-ciel-bridge' if is_bridge else 'ocl-semantic') if is_semantic else 'ocl-search'
841+
target_repo_filter = filters.get('target_repo', None)
842+
search_repo_url = f"/orgs/{repo_params.get('owner')}/sources/{repo_params.get('source')}/"
843+
is_bridge = (is_semantic and target_repo_filter and
844+
drop_version(target_repo_filter) != search_repo_url)
845+
algorithm = ('ocl-bridge' if is_bridge else 'ocl-semantic') if is_semantic else 'ocl-search'
845846
results = []
846847
for row in rows:
847848
start_time = time.time()

0 commit comments

Comments
 (0)