Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix(ci): paginate sticky PR-comment lookups; make research comment sticky (#4333)

LearningCircuit112836790e21
diff --git a/.github/workflows/docker-tests.yml b/.github/workflows/docker-tests.yml
index 8ffabd31fb..1ca509d96b 100644
--- a/.github/workflows/docker-tests.yml
+++ b/.github/workflows/docker-tests.yml
@@ -397,11 +397,14 @@ jobs:
</details>`;
- // Find existing comment
- const { data: comments } = await github.rest.issues.listComments({
+ // Find existing comment. Paginate — on a long-lived PR the coverage
+ // comment may be past the first page (listComments defaults to 30),
+ // which would otherwise create a new comment every run.
+ const comments = await github.paginate(github.rest.issues.listComments, {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
+ per_page: 100,
});
const botComment = comments.find(c =>
diff --git a/.github/workflows/e2e-research-test.yml b/.github/workflows/e2e-research-test.yml
index 8c265afd16..1ddad67cfa 100644
--- a/.github/workflows/e2e-research-test.yml
+++ b/.github/workflows/e2e-research-test.yml
@@ -152,10 +152,48 @@ jobs:
with:
name: ${{ needs.research.outputs.comment-artifact-name }}
- - name: Post comment
+ - name: Post or update comment
if: needs.research.outputs.success == 'true'
- run: |
- gh pr comment "$PR_NUMBER" --repo "${{ github.repository }}" -F comment.md
+ continue-on-error: true # a GitHub API hiccup shouldn't fail the job
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
+ with:
+ retries: 3
+ script: |
+ const fs = require('fs');
+ const issue_number = Number(process.env.PR_NUMBER);
+ // Key the marker by label so re-running the same label edits its
+ // comment in place, while the other label keeps a separate comment.
+ const marker = `<!-- ldr-research-results:${process.env.LABEL_NAME} -->`;
+ const body = marker + '\n' + fs.readFileSync('comment.md', 'utf8');
+
+ // Paginate — on a long-lived PR the existing comment may be past the
+ // first page (listComments defaults to 30), which would otherwise
+ // create a new comment every run instead of editing in place.
+ const comments = await github.paginate(github.rest.issues.listComments, {
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number,
+ per_page: 100,
+ });
+ const existing = comments.find(
+ (c) => c.user.type === 'Bot' && c.body.includes(marker)
+ );
+
+ if (existing) {
+ await github.rest.issues.updateComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ comment_id: existing.id,
+ body,
+ });
+ } else {
+ await github.rest.issues.createComment({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number,
+ body,
+ });
+ }
- name: Remove label for re-triggering
if: always()