Skip to content

Architecture

 
Both halves of a plugin talk to one daemon; the daemon owns the processes.

OpenCode runs the interface and the server in separate threads, so the two halves of a plugin cannot share memory — and neither survives a restart. Anything that must outlive a turn needs a third place to live, and that is cockpitd.

It is one process per machine, not per window. It starts on demand, accepts connections on a unix socket in a 0700 directory with 0600 permissions, and exits after ten idle minutes.

Each build has an id derived from the daemon’s own code. A plugin carrying newer code asks for the daemon to step aside — but only when nothing would be lost.

 
Only forwards, and never over running work.

One byte stream, three readers, each for a different audience.

 
The agent reads lines; you watch a screen; a late panel replays the bytes.

JSON-RPC 2.0 over NDJSON, with request and response schemas shared by client and daemon and a major.minor version. A bay contributes its own methods and events; other bays never see them. A major mismatch is refused with a clear message instead of failing halfway through a call.

Every spawned process group is written to a registry file with its start time. A daemon that starts after a crash reads it, checks which of those processes are still alive, and kills what it owned — so a crash never leaves a dev server running forever.