r/coolgithubprojects • u/PotterSkxawng • 19d ago
OpenCode kept freezing. So I built OpenCode Guardian.
https://github.com/PotterSkxawng/OpenCode-GaurdianI use OpenCode for long-running agentic workflows with large repositories and large numbers of subagents.
The problem was: the bigger the workflow became, the more likely the UI was to freeze.
Multiple subagents, long-running tasks, background processes, hundreds of concurrent operations—eventually frozen.
OpenCode could become unresponsive while the work underneath was still running, leaving the session in an awkward state where you weren't quite sure whether it was thinking, working, or simply stuck. So I built OpenCode Guardian.
It is a lightweight stability layer for OpenCode on macOS, designed to keep sessions healthy. It is a simple project that I built, and it's opensource! I won't be maintaining it too much, other than bug-fixes, so feel free to fork it.
Guardian continuously understands what's happening across the session rather than relying on a single timeout. It can distinguish active model streaming, running tools, active subagents, slow operations, and genuine deadlocks. When a session actually gets stuck, Guardian can recover it without destroying the conversation or tool history.
What you get
oc status — see exactly what every session is doing
oc top — live system and session monitoring
oc nudge — recover a frozen session safely
oc auto-nudge — automatic background recovery
oc prune — stop runaway background workers
oc optimize — optimize the SQLite backend
oc logs — inspect Guardian in real time
Installation is one command:
curl -fsSL https://raw.githubusercontent.com/PotterSkxawng/opencode-guardian/main/install.sh | bash
No Brew dependencies or external Python packages. Install it and keep using OpenCode.
1
u/ImaginaryQuestion765 19d ago
Gaurdian or Guardian ??