Theteia
The Discord ocbot
Theteia (ocbot) is a Rust Discord bot that puts a local opencode coding agent behind chat buttons. You work on your machine; the agent runs in a directory you choose; every run comes back to you as one report with an outcome — Completed, Errored, Aborted, or Empty — and a decision to make. The bot is built for a single operator: one allowlisted user per surface, a guard in front of every interaction, and no multi-tenant anything.
Under the hood it is deliberately boring machinery: at most one active action per directory (a per-directory lock), every state change is a compare-and-swap transition so duplicate button presses lose, and Accept, Park & redo, and Reset survive a SIGKILL at any point — boot reconcile recovers from database facts, not memory. Discord and Signal are both supported as surfaces.
# Install
Build from source — Linux host, Rust 1.98.1 (pinned via rust-toolchain.toml,
fetched automatically), and an opencode server v2 on loopback:
Clone and build
git clone https://github.com/lexbity/theteia-discord-ocbot.git
cd theteia-discord-ocbot
cargo build --release
Then follow the full setup guide (bot token, opencode server, first run) or the production install (systemd units, secrets, backups).
# Try it
-
Create the Discord bot
Create an application in the Discord developer portal, copy the token (DISCORD_TOKEN), enable the Message Content intent, and invite it to a private server you own. Copy your own user ID — that isALLOWED_USER_ID. -
Start the opencode server
opencode serveon loopback with a password — the bot refuses v1 servers and probes the pin at startup. -
Configure and run
cp config/config.toml.example config/config.toml, point it at your working directory, exportDISCORD_TOKENandALLOWED_USER_ID, then run from the repository root:cargo run --release. DM the bot a prompt and wait for the report.
The full walkthrough, including the Signal surface and troubleshooting, is in Getting started .