Skip to content

sdk: server.close() does not terminate underlying opencode process when run via wrappers (e.g., Deno) #21628

Closed as not planned

Description

@sigmaSd

Description

Currently, calling server.close() in the SDK only terminates the immediate process wrapper (like deno) but leaves the actual opencode binary running as an orphaned process. This results in the network port remaining occupied and requiring manual cleanup (e.g., fuser -k).

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 9, 2026
  2. github-actions commented on Apr 9, 2026

    @github-actions
    Contributor

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

    If your issue is specifically about the SDK's server.close() not propagating a termination signal to the spawned opencode binary (rather than the web command or desktop wrapper), it may be worth keeping open as a distinct SDK-specific tracking issue. Otherwise, consider commenting on one of the above.

  3. rekram1-node commented on Apr 10, 2026

    @rekram1-node
    Collaborator

    Yeah i think ik the cause, it's the node wrapper isnt forwarding signals to the child correctly. Ez to fix.

  4. rekram1-node commented on Apr 10, 2026

    @rekram1-node
    Collaborator

    just need to update bin/opencode.

    Looking to see if we can kill the node wrapper tho.

  5. removed
    bugSomething isn't working
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  6. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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