You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handle session.canvas.closed by removing from open_canvases snapshot (#1604)
The runtime now emits a symmetric `session.canvas.closed` ephemeral event
(payload `{ instanceId, extensionId, canvasId }`) when a canvas is genuinely
removed, mirroring the existing `session.canvas.opened`
(copilot-agent-runtime #9489, shipped in CLI 1.0.60). The generated event types
already landed via codegen, but the hand-written handlers only ever upserted on
open, so the in-memory `open_canvases` snapshot was append-only and never shrank
on close.
This adds the symmetric removal handler in every SDK that maintains the
open-canvases snapshot: Rust, Node, Python, Go, and .NET. Each:
- removes the matching instanceId from the snapshot on `session.canvas.closed`,
acquiring the same lock the upsert path uses;
- warns and no-ops on an empty/missing instanceId;
- is idempotent (closing an absent instanceId is a no-op);
- leaves the resume path untouched and does not treat opened/stale events as
removals (only the explicit closed event removes).
Java is intentionally excluded: it has no open-canvases snapshot feature at all
(only the generated event types exist), so there is nothing symmetric to add.
The consumer is github-app's "sticky terminal canvas" fix, which needs the SDK
snapshot to shrink on close so warm session-reselect stops resurrecting closed
canvases.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments