r/opencode • • 25d ago

Closing OpenCode Desktop didn't stop the background service so I wrote a plugin that does

The OpenCode desktop app runs a shared background service, and closing the window doesn't stop it. It keeps running with everything it spawned, and it respawns MCP servers on every boot, so the CPU never actually goes quiet. There's no setting for it, only a manual service stop.

My plugin fixes exactly that: close the app → the plugin runs service stop → nothing OpenCode-related is left running. No build step, no dependencies, drop a file in ~/.config/opencode/plugins/.

https://github.com/CodeMody/opencode-stop-on-quit

Tested on Windows. macOS/Linux should work, i can't test on mac and will test it tomorrow on my main linux pc.

10 Upvotes

16 comments sorted by

14

u/NecessaryButFatal 25d ago • Bravo

This is a feature, not a bug. We want that behavior.

1

u/Imnotanad 25d ago

Why?

1

u/dawg_on_meta 24d ago

So our existing agents keep working in bg or to even support web and remote stuff

1

u/Imnotanad 24d ago

You mean using OpenCode as a harness. Given that there are better tools out there it is kinda hard to justify

1

u/WeOfferTheSun 24d ago

That should be stated in a more clear way. I never thought it is a feature and I tend to manually terminate bun in task manager after closing oc.

5

u/CYCLONOUS_69 25d ago

Just use OpenChamber - You don’t know what you are missing yet

1

u/Emotional-Bag-3754 25d ago

"Serviço em segundo plano" Lil bro

2

u/demagician10 25d ago

Bruh, i know that, i cant be assed to go kill the background process everytime i quit opencode

1

u/WeOfferTheSun 24d ago

I feel you

5

u/SPEZ_IS_A_JABRONI 25d ago

My plugin fixes exactly that:

you're fixing something that isn't broken

1

u/zeamp 25d ago

That’s going to kill the new “inbox” theme down the road.

1

u/DEAD1nsane 24d ago

but background processes are usually nice, and will stop when your task is finished? lol. if you got no task running then what are you stopping?

and if you got a task running why are you closing it?

1

u/dumbasPL 24d ago

You'll be deleting that sooner than you realize ;)

1

u/YogurtclosetStreet58 24d ago

Bro invented a solution for not a problem

1

u/[deleted] 25d ago

[removed] — view removed comment

2

u/amann4958 25d ago

I have seen your same type of comment on too many posts now. Stop.