Skip to content

refactor(similar_issue): unify corpus collection across vector backends - #5193

Open
PeterDaveHello wants to merge 1 commit into
The-PR-Agent:mainfrom
PeterDaveHello:fix/similar-issue-shared-corpus
Open

PeterDaveHello wants to merge 1 commit into
The-PR-Agent:mainfrom
PeterDaveHello:fix/similar-issue-shared-corpus

Conversation

@PeterDaveHello

@PeterDaveHello PeterDaveHello commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

User description

Why

Pinecone, LanceDB, and Qdrant independently maintain the same issue and comment collection logic. Fixes to scan limits, lazy pagination, comment filtering, and embedding eligibility have repeatedly required changes in all three paths (e.g. #3549, #3565, #4169, #4437). Keeping these rules separate makes future fixes easier to miss in one backend.

Changes

  • Extract the existing collection loop into a shared _collect_issue_corpus() helper.
  • Preserve scan quotas, lazy iteration, record IDs and ordering, comment positions, metadata, and progress logging.
  • Keep completion markers, persistence, empty-corpus handling, and failure recovery specific to each backend.

Impact

Three independently maintained collection implementations become one, removing 91 net lines of production code. No public API, configuration, dependency, or indexing behavior changes are intended. Existing ingestion and embedding regression tests remain unchanged.


PR Type

Other


Description

  • Unify issue collection across three vector backends.

  • Preserve filtering, scan limits, and record metadata.

  • Keep persistence and completion markers backend-specific.


Diagram Walkthrough

flowchart LR
  source["Repository issues and comments"]
  collector["Shared corpus collector"]
  pinecone["Pinecone indexing"]
  lancedb["LanceDB indexing"]
  qdrant["Qdrant indexing"]
  source --> collector
  collector --> pinecone
  collector --> lancedb
  collector --> qdrant
Loading

File Walkthrough

Relevant files
Refactoring
pr_similar_issue.py
Centralize issue corpus collection across vector backends

pr_agent/commands/pr_similar_issue.py

  • Extract _collect_issue_corpus() from the existing Pinecone collection
    loop.
  • Reuse the collector in Pinecone, LanceDB, and Qdrant indexing paths.
  • Preserve lazy iteration, scan quotas, embedding eligibility, comment
    filtering, record identifiers, metadata, and progress logging.
  • Leave completion markers, persistence, empty-corpus handling, and
    failure recovery backend-specific.
+17/-108


⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 6,270 in / 280 out / 6,550 total
  • Time cost: 8.7s
  • AI calls: 1

Scan quotas, lazy pagination, and embedding eligibility have needed fixes
in all three indexing paths. Keep these rules in one collector to prevent
future changes from drifting between backends.

Leave completion markers, persistence, and failure recovery with each
backend to preserve their distinct write contracts.
Copilot AI balanced review requested due to automatic review settings November 28, 2026 13:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The shared corpus-collection refactor has no active review issues.

No open issues 🎉

What changed in this PR

This refactor centralizes /similar_issue corpus collection so ingestion fixes no longer need to be repeated across three vector backends, with no intended indexing behavior changes.

Changes:

  • Extracts _collect_issue_corpus() for Pinecone, LanceDB, and Qdrant.
  • Preserves lazy iteration, scan quotas, comment filtering, embedding eligibility, record metadata, and progress logging.
  • Keeps persistence, completion markers, empty-corpus handling, and failure recovery backend-specific.
File Description
pr_agent/​commands/​pr_similar_issue.py Replaces three duplicate collection loops with one shared helper.

Review effort: Balanced

@the-pr-agent-bot

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
⚠️ Risk level: Low
✅ Merge recommendation: No concerns found
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 14,320 in / 105 out / 14,425 total
  • Time cost: 5.8s
  • AI calls: 1

@the-pr-agent-bot

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.


⚙️ Agent run details
  • Model: openai/gpt-6.1-sol
  • Tokens: 6,342 in / 42 out / 6,384 total
  • Time cost: 2.3s
  • AI calls: 1

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants