- Drawn by
- Lex
- Date
- 2026-10
- Scale
- 1 : 1
- Sheet
- 04 OF 05
- Built specifically for a local opencode server, with Discord and Signal as the remote interfaces.
- Finished sessions offer three decisions: Accept, Follow up, or Park & redo.
- Permission requests reach the operator before the blocked session can continue.
- State checks, per-directory locking, and restart recovery coordinate repeated or competing requests.
Scroll across the drawing to see the detail.
Theteia, also called ocbot, is for the moment a coding agent finishes while you’re away from the desk. You can send work to a local opencode server and review its outcome through Discord or Signal.
The bot is a controller written in Rust. The opencode server runs the agent; Theteia handles messages, permissions, decisions, and the git operations that follow. Git is the version-control tool that records changes to the code. Theteia is designed for a single operator, with an allowlisted user on each messaging service.
A small set of meaningful decisions§
A completed session reports its outcome and offers three choices:
- Accept: save the work as a git commit, a recorded point in the code’s history.
- Follow up: continue the session.
- Park & redo: preserve the attempt on a branch, reset, and try again.
Permission requests are sent to the operator as Discord buttons or Signal reactions. The session waits for an answer.
Handling interruptions and repeated requests§
Messaging interfaces can deliver repeated actions, and a decision can arrive from more than one place. Theteia checks that the recorded state still matches what an action expects before changing it. This is called compare-and-swap: a competing action cannot silently apply the same transition twice.
Per-directory locks coordinate work on a codebase. Git records the code history, while SQLite, a small database, records controller decisions. Recovery after an interrupted operation uses those persistent records to work out what happened. The repository describes the recovery procedures and tests.
The interesting work here is the coordination around an agent: keeping operator choices, durable records, and execution aligned when messages repeat or a process stops unexpectedly.