[Feature]: add opt-in conversation history for top-level /ask
Feature request
Add an opt-in conversation history capability for top-level /ask.
When enabled, a later top-level /ask should be able to refer to previous PR-Agent /ask answers from the same pull request. The history should be read through the existing GitProvider.get_issue_comments() interface, limited by a configurable token budget, and marked as untrusted context.
Proposed configuration:
[pr_questions]
use_ask_conversation_history = false
ask_conversation_history_max_tokens = 2000Acceptance criteria:
- With the option enabled, previous PR-Agent Ask/Answer comments are available to the model prompt.
- Unrelated human comments are excluded.
- Recent complete answers are retained within the configured token budget.
- With the option disabled, no issue-comment history request is made.
- Provider history failures fall back to the existing independent-question behavior.
- Existing
/ask_lineconversation history remains unchanged.
Motivation
When investigating a pull request, developers often ask related questions in sequence:
/ask "What does the cache store?"/ask "What happens on a cache miss?"
Currently, each top-level /ask request is independent. The second question requires the developer to repeat or paste the context from the first answer.
The current PRQuestions implementation builds its prompt from the current PR metadata, diff, and question only. The existing pr_questions.use_conversation_history setting applies to /ask_line on GitHub and does not provide conversation history for top-level /ask.
The feature should remain disabled by default so existing behavior is unchanged. It should not introduce a new database, cross-PR memory, or provider-specific API.
Local implementation evidence includes a baseline red test and fake provider/fake AI regression tests. No real provider, tenant, network, deployment, or production acceptance is claimed.
Source: The-PR-Agent/pr-agent