Skip to content

fix: stop per-launch terminal listeners accumulating on the extension context (v0.2.10) - #13

Merged
TheStreamCode merged 3 commits into
mainfrom
chore/launch-disposable-cleanup-v0.2.10
Aug 2, 2026
Merged

TheStreamCode merged 3 commits into
mainfrom
chore/launch-disposable-cleanup-v0.2.10

Conversation

@TheStreamCode

@TheStreamCode TheStreamCode commented Aug 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes unbounded growth of per-launch terminal disposables, adds lifecycle regressions, hardens release-tool install-script approval, and prepares the backward-compatible v0.2.10 patch release.

Runtime fix

  • createDisposableRegistry() tracks launch-scoped listeners and timers outside context.subscriptions, dropping entries as soon as they are disposed while preserving aggregate shutdown cleanup.
  • Closing a launcher terminal before command dispatch now cancels its pending shell-integration wait, fallback timer, and missing-command listener.
  • The command remains single-send through either shell integration or fallback; Workspace Trust, user-level command resolution, bootstrapper warnings, endpoints, telemetry policy, settings, and command IDs are unchanged.

Tests and release safety

  • Six focused registry tests, including 100 launch/dispose cycles and idempotent cleanup.
  • Metadata regression guard keeps per-launch listeners out of the never-drained extension subscription array.
  • Release metadata regression guard keeps package.json, both lockfile version entries, CITATION.cff, the dated changelog section, and the Open VSX workflow default tag synchronized.
  • Reviewed and pinned the two npm release-tool install scripts to exact versions through allowScripts: @vscode/vsce-sign@2.0.9 and keytar@7.9.0. Any dependency update requires a new review.
  • Test count: 59 -> 67.

Documentation and versioning

  • Expanded AGENTS.md with project architecture, package manager/runtime, generated files, compatibility, asset protection, security boundaries, required checks, install-script policy, and release channels.
  • Updated docs/RELEASING.md and CHANGELOG.md with the real 0.2.10 process and changes.
  • Synchronized version 0.2.9 -> 0.2.10 across all tracked release references.

Validation

  • npm ci — 318 packages, zero vulnerabilities, no pending allowScripts warning
  • strict TypeScript compile from a clean out/
  • 67 unit/metadata tests, zero failed or skipped
  • VS Code 1.131.0 Extension Host integration smoke
  • npm audit --audit-level=moderate — zero vulnerabilities
  • vsce ls package-content validation
  • VSIX archive manifest/content/secret inspection
  • isolated VSIX install smoke on VS Code 1.131.0

Coverage for the pure command/lifecycle helpers is 98.27% lines, 91.30% branches, and 100% functions; no threshold is configured.

Artifact: vscode-copilot-cli-launcher-0.2.10.vsix

  • 13 files, 171,975 bytes (167.94 KB)
  • SHA-256: 79EC90C0DAB9872FA4EA894C700367E448751AAFAAF1994F87D69A553119BF52
  • Identity: mikesoft.vscode-copilot-cli-launcher@0.2.10
  • Contents: compiled runtime, media/icon.png, manifest, licence and public root documentation only; no source, tests, maps, lockfile, .env, credentials or local tooling
  • Install result: discovered as mikesoft.vscode-copilot-cli-launcher@0.2.10 in isolated user-data/extensions directories; temporary profile removed

Security and privacy

The extension remains local-only: no telemetry, installers, automatic downloads, filesystem scanning, secret storage, or background network behavior. The machine-scoped command continues to ignore workspace-controlled values, and untrusted workspaces cannot launch it. Current CodeQL, Dependabot and secret-scanning alert counts are zero.

Release boundary

The v0.2.10 tag, GitHub Release and registries intentionally follow protected-branch approval and merge. Visual Studio Marketplace and Open VSX are currently at 0.2.9. Marketplace/Open VSX publishing remains owner-controlled; VSCE_PAT and OVSX_PAT are absent from both the environment and repository Actions secrets, so no publication was attempted.

Risk

Low. The runtime change is confined to disposal bookkeeping and terminal-close cancellation, with focused and integration coverage. media/icon.png remains the dominant part of the VSIX but is within the documented 256 KiB budget and was deliberately left unchanged.

TheStreamCode and others added 3 commits August 1, 2026 22:19
… the context

Every launch registered its shell-integration listener, fallback timer, and
shell-execution listener on `context.subscriptions`, which VS Code drains only at
deactivate. Repeated toolbar clicks therefore appended entries that were never
removed, and each entry kept its launch's closure — including up to 64 KiB of
captured terminal output — reachable for the rest of the session.

Launch-scoped disposables now go through a registry that drops each entry as soon
as it is disposed, with a single aggregate disposable on `context.subscriptions`
guaranteeing cleanup at shutdown. Closing the launcher terminal before its command
is sent also cancels that launch's pending wait, timer, and listener instead of
letting them fire against a terminal that no longer exists.

The registry lives in `command-utils.ts` as a pure helper with focused unit tests,
per the repository guardrail for reusable decision logic.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Bump the patch version across package.json, package-lock.json, CITATION.cff, the
metadata test assertion, and the Publish Open VSX workflow default tag, and record
the release in CHANGELOG.md.

Add a metadata regression test asserting that `extension.ts` keeps exactly one
`context.subscriptions.push` call, so per-launch listeners cannot drift back onto
the array VS Code drains only at deactivate.

Expand AGENTS.md with the stack, runtime, package manager, generated files, asset
rules, compatibility contract, secret handling, branch protection, versioning and
publishing channels, and the mandatory validation gate. Correct the version
synchronization list in docs/RELEASING.md.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TheStreamCode
TheStreamCode merged commit 224fdb4 into main Aug 2, 2026
5 checks passed
@TheStreamCode
TheStreamCode deleted the chore/launch-disposable-cleanup-v0.2.10 branch August 2, 2026 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant