github / github/copilot-cli

Extension canvas.open emits malformed opened event and does not reliably focus

Offen
#4,112 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area:plugins
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

Problem

A user-scoped Copilot CLI extension can register and manually render a canvas, but calling the documented low-level session.rpc.canvas.open route on resume does not reliably make the canvas visible and emits a malformed event warning in the extension process.

Copilot CLI version: 1.0.71-0 on macOS arm64.

Reproduction

  1. Register a canvas through joinSession({ canvases: [...], requestCanvasRenderer: true }).
  2. After detecting a resumed session, resolve the canvas through session.rpc.canvas.list().
  3. Call session.rpc.canvas.open with the exact returned provider ID:
await session.rpc.canvas.open({
  extensionId: declared.extensionId,
  canvasId: declared.canvasId,
  instanceId: "stable-instance",
  input: { key: "example" },
});

A complete implementation and focused tests are available in the Session Briefing adapter and its test.

Actual behavior

  • The canvas.open promise resolves; the extension's bounded failure diagnostic does not run.
  • The extension process logs failed to deserialize session.canvas.opened payload.
  • The resumed CLI does not reliably show/focus the canvas.
  • The SDK rejects the event because the payload does not satisfy OpenCanvasInstance (provider identity, instance/canvas IDs, reopen, and availability).

Expected behavior

The returned/opened snapshot and session.canvas.opened event satisfy the bundled SDK schema, and reopening a stable instance visibly focuses the canvas.

Additional evidence

  • The same canvas renders successfully when opened through the host's open_canvas tool with the explicit provider ID.
  • Omitting extensionId and passing the exact ID returned by canvas.list() both produce the malformed-event warning.
  • The canvas ID is unique in the session.

A small diagnostic option to log or expose the rejected event shape would also make this class of failure much easier to debug without instrumenting the SDK.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit dem Session Briefing adapter und seiner adapter.test.mjs, verfolge dann die Route session.rpc.canvas.open und die Verarbeitung des Ereignisses session.canvas.opened. Vergleiche den zurückgegebenen Snapshot und das Ereignis mit dem gebündelten OpenCanvasInstance-Schema. Erledigt ist es, wenn das Ereignis erfolgreich deserialisiert wird und das erneute Öffnen einer stabilen Instanz den Canvas sichtbar fokussiert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
api, cli
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.