Agent threads
The desktop agent can start its own threads — background jobs and visible side-conversations — with ob-thread (seed skill thread). The control-plane route is POST /api/threads (apps/control/src/threads.ts).
Usage
ob-thread start [--title TEXT] [--display] [--message TEXT]
ob-thread liststartcreates the OpenCode session directly (reusing cron'screateSession).--message TEXTposts the text viaprompt_asyncas the first prompt.- Without
--displaythe title gets the reservedworker:prefix: the dashboard thread list and the media vault skip it — a hidden background-job thread. listreturns the hidden threads (GET /api/threads).
Title rules
- Titles cannot start with
worker:orcron-run:(reserved prefixes). - Visible threads appear on the next thread-list refresh — opencode's
session.createdevent already triggers it.
Cron uses the same machinery
Cron jobs create a delivery thread per job, then a child run session titled cron-run: <job name>:
- The scheduler sweeps every 30 s for due jobs (
everyseconds / 5-field cron / one-shotat). - The job optionally runs a script (timeout 120 s), then the prompt runs in the
cron-run:session on a thread screen. - The result is published to the delivery thread as
[cron-result: <name>](noReply) and the run session is deleted.
ob-cron add --name "inbox check" --message "Summarize my mail" --every 3600
ob-cron list | set ID ... | run ID | remove ID--every minimum is 60 seconds; prompts cap at 4000 chars.
Hidden threads are perfect for multi-step work you do not want cluttering the dashboard — the agent uses them for plugin hooks and long jobs.