sourcebot icon indicating copy to clipboard operation
sourcebot copied to clipboard

[FR] Remove search scope constraint from Ask

Open msukkari opened this issue 11 months ago • 3 comments

Enable Ask to automatically determine search scopes without user explicitly setting it

msukkari avatar Dec 05 '25 05:12 msukkari

Hi @msukkari , @brendan-kellam , I'd love to work on this issue.

Proposed Implementation:

  1. Make scope optional at boundaries - Remove validation in ChatBox that blocks submission when selectedSearchScopes.length === 0. Allow scope?: undefined in API.

  2. Resolve scope:

  • If user explicitly selected scopes -> use those
  • Else if user has exactly one indexed repo -> use that repo
  • Else -> use all indexed repos (with reasonable limit, e.g. 10)
  1. User selections always take precedence over auto-resolution.

Would appreciate your feedback on this approach before I start! Happy to discuss any concerns or alternative approaches.

Pallavikumarimdb avatar Jan 10 '26 17:01 Pallavikumarimdb

Hey @Pallavikumarimdb, thanks for your interest here. Unfortunately the scope of this task is much larger than simply allowing the user to use all search scopes in the UI. We added this limitation on purpose to reduce the likelihood of the context window of the LLMs from being maxed out. This task would require some intelligent way of managing this context

msukkari avatar Jan 13 '26 01:01 msukkari

Hi @msukkari , Thanks for the clarification - that makes sense. I understand that the core challenge is managing LLM context safely rather than simply expanding scope.

I propose starting with a deterministic, context-budgeted backend resolver that incrementally selects repos based on clear priority signals (e.g. current repo, recent usage), stopping once a predefined context limit is reached and showing to the user. This keeps behavior predictable, avoids unnecessary LLM calls, and directly addresses the risk of context overflow.

Once stable, we could explore optional enhancements like lightweight keyword-based ranking to further improvement.

Pallavikumarimdb avatar Jan 13 '26 17:01 Pallavikumarimdb