github / github/copilot-cli

Extension startup fails on large session histories

Aperta
#4,717 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

area:plugins area:sessions
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia da handleSessionResumeCore() e traccia il passaggio di replayEvents: false attraverso initializeSession() fino a seamHost.initializeSession(). Verifica che il percorso di collegamento dell’estensione non serializzi più l’intera cronologia degli eventi quando non è richiesta la riproduzione storica, quindi riproduci il problema con una sessione la cui cronologia serializzata supera il limite per le stringhe di V8.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript
Ambito
cli
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
70/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.