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 — Bug: Shared OpenCode host keeps per-directory MCP child processes alive on Windows after switching routed directories/worktrees · Issue #21557 · anomalyco/opencode

Bug: Shared OpenCode host keeps per-directory MCP child processes alive on Windows after switching routed directories/worktrees #21557

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Bug: Shared OpenCode host keeps per-directory MCP child processes alive on Windows after switching routed directories/worktrees#21557
Copy link
Assignees
jlongster

Description

@VooDisss
VooDisss
opened on Apr 8, 2026
Issue body actions

Description

On Windows, a shared OpenCode host does not clean up old MCP child processes when switching between routed directories/worktrees.

After using MCP in directory A and then directory B, I still see both mcp-server.exe processes alive under one opencode.exe, even after mcp.disconnect(...) or instance.dispose() for the previous directory. This keeps the executable locked and blocks rebuilds.

Steps to reproduce

  1. Start one shared OpenCode host.
  2. Use MCP in directory A.
  3. Switch to directory B and use MCP there.
  4. Dispose or disconnect the previous directory instance.
  5. Check running processes.

Expected behavior

The old MCP child exits.

Actual behavior

The old MCP child stays alive.

Notes

The host itself is not exiting here. I attached a markdown file with more detailed investigation.

opencode-shared-host-mcp-lifecycle-issue.md - more context for your agents inside.

Activity

  1. VooDisss
    added
    bugSomething isn't working
    on Apr 8, 2026
  2. github-actions
    assigned
    rekram1-node
    on Apr 8, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    windows
    on Apr 8, 2026
  4. github-actions commented on Apr 8, 2026

    @github-actions
    github-actionsBot
    on Apr 8, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The description appears to be AI-generated — it is an extremely long wall of text with extensive structured sections (lifecycle sketches, upstream evidence lists, root cause hypotheses, risk/caution sections, test plans, etc.). AI-generated walls of text are not acceptable per our contributing guidelines. Please rewrite the issue in your own words, concisely describing the bug, how to reproduce it, and what you observed.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    • TUI: signal exits leak child processes #14237: TUI signal exits leak child processes — related issue about child processes not being cleaned up on exit
    • [FEATURE]: opencode serve should propagate SIGTERM to its child processes #20899: opencode serve should propagate SIGTERM to its child processes — related issue about orphaned child processes accumulating under the opencode host

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

  5. github-actions
    added
    needs:complianceThis means the issue will auto-close after 2 hours.
    and removed
    needs:complianceThis means the issue will auto-close after 2 hours.
    on Apr 8, 2026
  6. github-actions commented on Apr 8, 2026

    @github-actions
    github-actionsBot
    on Apr 8, 2026 – with GitHub Actions
    Contributor
    More actions

    Thanks for updating the issue! It now follows the contributing guidelines and includes all the necessary information. We appreciate the detailed reproduction steps and the additional context. Your report has been reviewed and the compliance flag has been removed.

  7. VooDisss commented on Apr 8, 2026

    @VooDisss
    VooDisss
    on Apr 8, 2026
    Author
    More actions

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The description appears to be AI-generated — it is an extremely long wall of text with extensive structured sections (lifecycle sketches, upstream evidence lists, root cause hypotheses, risk/caution sections, test plans, etc.). AI-generated walls of text are not acceptable per our contributing guidelines. Please rewrite the issue in your own words, concisely describing the bug, how to reproduce it, and what you observed.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.

    This issue might be a duplicate of existing issues. Please check:

    • TUI: signal exits leak child processes #14237: TUI signal exits leak child processes — related issue about child processes not being cleaned up on exit
    • [FEATURE]: opencode serve should propagate SIGTERM to its child processes #20899: opencode serve should propagate SIGTERM to its child processes — related issue about orphaned child processes accumulating under the opencode host

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

    The linked issues are related because they are all child-process cleanup/lifecycle problems, but they do not appear to be duplicates. Those issues are about cleanup on host/process exit, while this issue is about per-directory MCP cleanup failing inside a still-running shared host on Windows.

  8. thdxr
    removed
    bugSomething isn't working
    windows
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  9. thdxr
    assigned
    jlongster
    and unassigned
    rekram1-node
    on May 3, 2026
  10. github-actions commented on Jul 4, 2026

    @github-actions
    github-actionsBot
    on Jul 4, 2026 – with GitHub Actions
    Contributor
    More actions

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

  11. github-actions
    closed this as not plannedon Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jlongster
    jlongster

Labels

No labels
No labels

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.