fix: Memory leaks in OAuth transport and missing process cleanup on exit #9428

Closed
opened 2026-02-16 18:12:26 -05:00 by yindo · 2 comments
Owner

Originally created by @sauerdaniel on GitHub (Feb 15, 2026).

Originally assigned to: @rekram1-node on GitHub.

  1. OAuth transport creates HTTP clients that are never closed
  2. On SIGINT/SIGTERM, spawned MCP server processes are not terminated, leaving orphan processes

Expected: OAuth transports are properly disposed; all child processes are terminated on exit.
Actual: Resources and processes leak.

Originally created by @sauerdaniel on GitHub (Feb 15, 2026). Originally assigned to: @rekram1-node on GitHub. 1. OAuth transport creates HTTP clients that are never closed 2. On SIGINT/SIGTERM, spawned MCP server processes are not terminated, leaving orphan processes **Expected:** OAuth transports are properly disposed; all child processes are terminated on exit. **Actual:** Resources and processes leak.
yindo added the perfneeds:compliance labels 2026-02-16 18:12:26 -05:00
yindo closed this issue 2026-02-16 18:12:26 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 15, 2026):

This issue doesn't fully meet our contributing guidelines.

What needs to be fixed:

  • This issue should use the Bug Report template. While it has good technical content, it needs to be formatted with the required template fields (specifically the "Description" field label and structured template format).
  • Please include details like: What version of OpenCode are you using? What OS and terminal are you running?

Please edit this issue to use the proper Bug Report template within 2 hours, or it will be automatically closed.


Additionally, this issue appears to be a duplicate of existing issues:

  • #9153: Memory leak: MCP OAuth transports not closed on retry or cancellation
  • #12913: Opencode processes survive terminal disconnect, become orphans, and leak memory
  • #10563: Memory Leak: Orphaned processes when terminal closes without explicit exit

Please review these existing issues and consider consolidating your report with one of them, or providing new information that distinguishes this issue.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions[bot] commented on GitHub (Feb 15, 2026): <!-- issue-compliance --> This issue doesn't fully meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md). **What needs to be fixed:** - This issue should use the **Bug Report** template. While it has good technical content, it needs to be formatted with the required template fields (specifically the "Description" field label and structured template format). - Please include details like: What version of OpenCode are you using? What OS and terminal are you running? Please edit this issue to use the proper Bug Report template within **2 hours**, or it will be automatically closed. --- **Additionally, this issue appears to be a duplicate of existing issues:** - #9153: Memory leak: MCP OAuth transports not closed on retry or cancellation - #12913: Opencode processes survive terminal disconnect, become orphans, and leak memory - #10563: Memory Leak: Orphaned processes when terminal closes without explicit exit Please review these existing issues and consider consolidating your report with one of them, or providing new information that distinguishes this issue. If you believe this was flagged incorrectly, please let a maintainer know.
Author
Owner

@sauerdaniel commented on GitHub (Feb 15, 2026):

Duplicate — closing in favor of the original issue.

@sauerdaniel commented on GitHub (Feb 15, 2026): Duplicate — closing in favor of the original issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9428