github / github/copilot-cli

Extension startup fails on large session histories

オープン
#4,717 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

area:plugins area:sessions
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

Describe the bug

Extensions fail to load in a long-running session when the serialized event history exceeds V8's maximum string length. Each affected extension imports successfully, but its joinSession() call fails:

[extension-bootstrap] importing extension: <path>
[extension-bootstrap] Failed to load extension: Error: Request session.resume failed with message: Invalid string length

The failure affects multiple locally configured extensions. In one session, two extensions failed identically. That session's events.jsonl was 1,664,072,585 bytes. Both extensions loaded successfully in smaller sessions using the same installation. The largest session log with a successful extension startup was 97,568,545 bytes. These file sizes do not establish the exact threshold on the serialized event array.

The packaged 1.0.82 bundle shows this call path:

  1. handleSessionResumeCore() handles the extension's session.resume request and calls initializeSession() with replayEvents: false.
  2. The host initialization path ignores that flag and passes session.getEvents() to seamHost.initializeSession().
  3. seamHost.initializeSession() calls JSON.stringify(events).
  4. V8 throws Invalid string length because the result would exceed its maximum string length of 536,870,888 code units.

handleSessionResumeCore() requests no historical replay. Respecting replayEvents: false throughout the initialization path would avoid serializing the event array during extension attachment.

Affected version

GitHub Copilot CLI 1.0.82

Steps to reproduce the behavior
  1. Configure an extension whose entry point calls joinSession().
  2. Open or resume a session whose serialized event history exceeds V8's maximum string length.
  3. Start or reload the extension.
  4. Inspect the extension log.

The session.resume request fails with Invalid string length. The extension process then exits before reporting ready.

Expected behavior

Extension startup should not depend on the total size of the session history. joinSession() should complete without materializing unrequested historical events as a single JavaScript string.

Additional context

Environment: Linux x86_64.

#4325 reported the same engine limit for CLI session resume and was closed as completed. Extension attachment still fails.

#4670 tracks stale registrations and hanging tool calls after a startup failure. Reproducing it surfaced this attachment failure, which #4670 records as a separate defect.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

handleSessionResumeCore() から開始し、replayEvents: false が initializeSession() を経由して seamHost.initializeSession() に渡される流れを追跡します。履歴のリプレイが要求されていない場合に、拡張機能のアタッチ処理でイベント履歴全体がシリアライズされなくなっていることを確認し、シリアライズされた履歴が V8 の文字列制限を超えるセッションで再現します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
70/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。