GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Memory leak: ACP session event streams never aborted · Issue #9154 · anomalyco/opencode

Memory leak: ACP session event streams never aborted #9154

New issue
Copy link
New issue
Copy link
Closed
Closed
Memory leak: ACP session event streams never aborted#9154
Copy link
Assignees
rekram1-node
Labels
perfIndicates a performance issue or need for optimization

Description

@sauerdaniel
sauerdaniel
opened on Jan 17, 2026
Issue body actions

Problem

In the ACP (Agent Communication Protocol) module, sessions and their event streams are not properly cleaned up:

  1. Session Map Growth - Sessions are stored in a Map but never removed when completed
  2. Event Stream Leaks - Event streams created via session.stream() are never aborted when sessions end
  3. No Disposal Mechanism - No dispose() method exists to clean up session resources

Code Location

  • packages/opencode/src/acp/agent.ts
  • packages/opencode/src/acp/session.ts
  • packages/opencode/src/acp/types.ts

Impact

  • Memory grows with each session that completes
  • Event stream listeners accumulate
  • No way to explicitly clean up session resources

Relates to #5363

Expected Behavior

  • Sessions should be removed from Map when completed
  • Event streams should be aborted when session ends
  • A dispose() method should be available for explicit cleanup

Activity

  1. github-actions
    assigned
    rekram1-node
    on Jan 17, 2026
  2. github-actions
    added
    perfIndicates a performance issue or need for optimization
    on Jan 17, 2026
  3. github-actions commented on Jan 17, 2026

    @github-actions
    github-actionsBot
    on Jan 17, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue is part of a broader set of memory leak issues being tracked. While not direct duplicates, the following related issues address similar resource cleanup problems:

    • ACP event subscription architecture causes cross-session pollution and duplicate events #5627: ACP event subscription architecture causes cross-session pollution and duplicate events
    • Memory leak: Uncleaned timeouts, intervals, and subscriptions #9156: Memory leak: Uncleaned timeouts, intervals, and subscriptions
    • Memory leak: TUI and Slack bot event listeners not cleaned up #9155: Memory leak: TUI and Slack bot event listeners not cleaned up
    • Memory leak: MCP OAuth transports not closed on retry or cancellation #9153: Memory leak: MCP OAuth transports not closed on retry or cancellation
    • opencode eating 70gb of memory? #5363: opencode eating 70gb of memory (general memory consumption issue)

    These issues share the root cause of incomplete resource cleanup across different OpenCode modules. Consider reviewing all related memory leak issues together for a comprehensive cleanup strategy.

  4. github-actions commented on Mar 27, 2026

    @github-actions
    github-actionsBot
    on Mar 27, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  5. github-actions
    closed this as completedon Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @rekram1-node
    rekram1-node

Labels

perfIndicates a performance issue or need for optimization

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.