Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Copilot PR-state polling throws RangeError: Invalid array length while accumulating paginated results

未关闭
#9,023 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@alexr00 已经在做这个了。

开始于 2026年10月6日。

评估

这个 Issue 还没有评估数据。

描述

bug
  • Extension version: GitHub Pull Requests 0.166.1
  • VSCode Version: 1.141.0-insider; also observed after updating to d1f9096c3663d21e55cf448de012c620b960220a on 6 October 2026
  • OS: macOS 27.0.1, Apple Silicon
  • Repository Clone Configuration (single repository/fork of an upstream repository): Multiple repositories/worktrees and windows, including the Agents window
  • GitHub Product (GitHub.com/GitHub Enterprise version x.x.x): GitHub.com

Steps to Reproduce:

An exact minimal reproduction has not yet been isolated. This report comes from retained logs during normal multi-window/Agents-window use, not from a new controlled reproduction.

  1. Use the affected extension with PR/Copilot-state polling active across repositories/worktrees.
  2. Observe background polling failures in the extension-host log. A useful targeted reproduction is a query that has multiple pages, particularly after the Copilot state model has initialized.
Observed

Ten RangeError: Invalid array length exceptions were recorded during 4 October 2026 13:14 to 6 October 2026 13:14 CEST (UTC+02). Renderer copies of the same exceptions were not counted again. The failure persisted after the latest Insiders update, with examples at 6 October 12:49:17, 12:51:41, and 13:08:28 CEST.

2026-10-06 12:49:17.147 [error] RangeError: Invalid array length
    at Array.push (<anonymous>)
    at <extensions>/github.vscode-pull-request-github-0.166.1/dist/extension.js:4168:41690
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async O6._pollForChanges (<extensions>/github.vscode-pull-request-github-0.166.1/dist/extension.js:3794:58246)

Paths are redacted; the error, timestamps, and bundled source locations are preserved. The failure interrupts background Copilot/PR-state refresh and may involve a very large accumulated array; no heap measurement has been taken.

Likely cause to investigate

Inspection of the installed bundle maps the failing push to refreshCopilotStateChanges. It loops while hasMorePages and appends the result of getPullRequestsForQuery. The helper can return cached or cumulative results, while the argument used for fetchNextPage is derived from the model's initialization state rather than advancing explicitly with each loop iteration.

This suggests repeated accumulation of the same/cumulative page when hasMorePages stays true. This is a code-and-stack hypothesis, not yet a regression-tested diagnosis.

Expected / proposed direction

Polling should advance pagination, terminate, and accumulate each PR once without unbounded array growth. Please check cached versus incremental query-result semantics and add regression coverage for an initialized model with more than one page, including a non-advancing result.

Raw logs are not attached because they contain unrelated private workspace/session data.

主要语言
TypeScript
星标
2.6k
派生
800
平均合并
22 小时 52 分钟
30 天内合并 PR
39

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-pull-request-github 的其他 Issue

查看 microsoft/vscode-pull-request-github 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。