You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Plugin shutdown hook for graceful cleanup #10524
I use beads (https://github.com/anomalyco/beads) for issue tracking, which embeds a Dolt SQL server for its local database. Beads 0.59+ manages the Dolt server lifecycle automatically (auto-start on first bd command, stop via bd dolt stop).
When OpenCode exits — even a normal Ctrl+C or :q — I'd like to stop the dolt server.
This affects anyone using OpenCode with an embedded database (Dolt, SQLite WAL, etc.) that requires graceful shutdown for data integrity.
Running into this as well just building a small custom plugin to improve tmux integration. I need to be able to clear some tmux pane/window variables on exit. I'm resorting to a tragic hack at the moment (which only happens to work because cleanup activities can be done outside of opencode), so a proper shutdown hook would be very much appreciated.
Activity
github-actions commentedon Jan 25, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
feat(plugin): add shutdown hook
RKelln commentedon Mar 9, 2026
I use beads (https://github.com/anomalyco/beads) for issue tracking, which embeds a Dolt SQL server for its local database. Beads 0.59+ manages the Dolt server lifecycle automatically (auto-start on first bd command, stop via bd dolt stop).
When OpenCode exits — even a normal Ctrl+C or :q — I'd like to stop the dolt server.
This affects anyone using OpenCode with an embedded database (Dolt, SQLite WAL, etc.) that requires graceful shutdown for data integrity.
Added (Opus written) PR for this:
RKelln:feat/plugin-shutdown-hook
andrewstackme commentedon May 1, 2026
what is the timeline for resolution?
jtackaberry commentedon May 14, 2026
Running into this as well just building a small custom plugin to improve tmux integration. I need to be able to clear some tmux pane/window variables on exit. I'm resorting to a tragic hack at the moment (which only happens to work because cleanup activities can be done outside of opencode), so a proper shutdown hook would be very much appreciated.
rekram1-node commentedon Jun 8, 2026
There is an instance dispose hook now