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: TUI and Slack bot event listeners not cleaned up · Issue #9155 · anomalyco/opencode

Memory leak: TUI and Slack bot event listeners not cleaned up #9155

New issue
Copy link
New issue
Copy link
Closed
Closed
Memory leak: TUI and Slack bot event listeners not cleaned up#9155
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

Several event listeners in the TUI and Slack bot are never cleaned up:

TUI Sync Context (sync.tsx)

The sdk.event.listen() call returns an unsubscribe function that is never called:

// Listener never cleaned up
sdk.event.listen((e) => { ... })

Tooltip Component (tooltip.tsx)

Mouse event listeners (mouseenter, mouseleave) are added to elements but never removed on component unmount, causing accumulation.

Slack Bot (slack/index.ts)

  • Sessions Map grows unbounded (no cleanup of old sessions)
  • No graceful shutdown handling (SIGINT/SIGTERM)
  • No limit on maximum concurrent sessions

Impact

  • Event listeners accumulate over component lifecycles
  • Sessions accumulate in Slack bot
  • Memory grows continuously in long-running processes

Relates to #5363

Expected Behavior

  • TUI event listeners should be unsubscribed in onCleanup
  • Tooltip should remove event listeners on unmount
  • Slack bot should clean up old sessions and handle shutdown
Reacted by bnainar

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 appears to be part of a broader set of memory leak issues across the codebase. Please check these related issues for context:

    • Memory leak: ACP session event streams never aborted #9154: Memory leak: ACP session event streams never aborted (Sessions Map cleanup)
    • Memory leak: Uncleaned timeouts, intervals, and subscriptions #9156: Memory leak: Uncleaned timeouts, intervals, and subscriptions (General cleanup patterns)
    • Memory leak: SDK event listeners never unsubscribed in App component #8258: Memory leak: SDK event listeners never unsubscribed in App component (TUI App event listeners)
    • Memory leak: Footer component only clears last timeout in recursive chain #8259: Memory leak: Footer component only clears last timeout in recursive chain (TUI Footer timeouts)
    • Memory leak: MCP clients not closed before reassignment #8257: Memory leak: MCP clients not closed before reassignment (MCP resource cleanup)
    • Memory leak: MCP OAuth transports not closed on retry or cancellation #9153: Memory leak: MCP OAuth transports not closed on retry or cancellation (MCP OAuth cleanup)
    • opencode eating 70gb of memory? #5363: opencode eating 70gb of memory? (Original memory issue tracking)

    While this issue specifically addresses TUI sync context, tooltip components, and Slack bot sessions, the underlying patterns (missing cleanup, unsubscribe functions ignored, unbounded collections) are consistent across these related issues. Consider coordinating fixes across all these issues to establish consistent cleanup patterns throughout the codebase.

  4. sauerdaniel commented on Feb 16, 2026

    @sauerdaniel
    sauerdaniel
    on Feb 16, 2026
    ContributorAuthor
    More actions

    Status: fix is implemented in PR #9147. Remaining blocker is CI on e2e (windows) (NotFoundError), which cascades to the linux gate.

  5. thdxr commented on Apr 2, 2026

    @thdxr
    thdxr
    on Apr 2, 2026
    Member
    More actions

    Closing in favor of #20695 where we're collecting all memory-related problems. Please follow that issue for updates.

  6. thdxr
    closed this as completedon Apr 2, 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.