jt-oz-bridge
English

v0.1.2 development preview

Self-hosted end to end: chat, bridge, agent, model

Hand work to your on-premises AI agent, even from your phone

jt-oz-bridge connects a topic on your self-hosted Zulip to an OpenCode session that already exists on your own server. No laptop and no VPN into a terminal: from your phone you can give it a task, see what it is doing, approve the commands it wants to run and read its answer. Back at your desk, the same session is open in OpenCode with all of it in place.

  • OpenCode
  • Zulip
  • Python 3.13
  • systemd
  • GPL-3.0

Made-up example. The wording follows what the bridge posts; the buttons appear in Zulip on a computer.

Everything self-hosted, on premises

Chat, bridge, agent and model all run on machines you own. The bridge talks only to your Zulip and to OpenCode on the same host, and uses no outside cloud service.

  1. Zulip on phone or desktopAsk directly when you are out or on call
  2. Your own ZulipA chat platform your organization owns
  3. jt-oz-bridgePasses tasks on, reports progress and results
  4. OpenCode agentCarries on in the original session and picks its own MCP tools
  5. Local model + MCPModel and tools stay inside your server room

Development preview. Routing, storage and the security checks have a large automated test suite, and the bridge runs daily against one real OpenCode server and Zulip organization. Use by other people end to end and the official iOS and Android apps are not verified yet. Try it on a project you can throw away first.

What you do from a topic

Plain text goes to the session. Commands start with ! and are one word.

Give it work

Type the task. If you add something while it is busy, the message goes into the running turn or waits for it to finish.

See what it is doing

One progress message is edited in place as tools run. After a few minutes you also get a note saying whether it waits on a tool or on the model.

Answer permission requests

!ok 4821 allows a request once, !no 4821 refuses it. Zulip on a computer shows buttons for the same choices.

Fetch files

!files searches the project, !file path sends the file as is. HTML is only a download, never rendered.

Change model or agent

!model and !agent list what OpenCode itself offers, with your existing provider and MCP settings.

Stop, resume, start over

!stop stops the work in this topic, !go continues it, !new opens a new conversation in an enrolled project.

!status shows where things stand and !help lists the rest. All chat commands

When it fits, and when it does not

It fits if

  • You want chat, agent and model to stay on premises, with no outside cloud service in between.
  • OpenCode already runs as a server on a Linux host you control, and the bridge can run on the same host.
  • You run your own Zulip server, or are willing to.
  • Everyone in a private channel may see the work done in it: you alone, or a small team.
  • You want one session that you can pick up from your desk and from your phone.

Look elsewhere if

  • You need a hosted service, or Slack, Teams or Telegram. Zulip is the only chat supported today.
  • You expect the bridge to contain the agent. What OpenCode may do on the host is decided by OpenCode's own permissions; the bridge checks who may ask.
  • People who must not see each other's work would share one channel.
  • You need a finished release with support behind it.

How it is put together

The bridge talks to Zulip through a bot account and to OpenCode through its API on loopback. It never opens OpenCode's database and never restarts it.

Architecture Zulip mobile and desktop clients talk to a self-hosted Zulip server. jt-oz-bridge uses the Zulip Bot API and the private loopback API of the OpenCode server, which also serves the TUI at your desk and calls your model providers. The bridge keeps its own encrypted database. Your server room (all self-hosted) HTTPS HTTPS Bot API API Zulip mobile app iOS / Android Zulip desktop / web buttons for choices Your Zulip server private channels, topics jt-oz-bridge checks, routes, delivers Bridge database encrypted payloads OpenCode server your sessions, loopback OpenCode TUI / app at your desk Local model e.g. Ollama, or others

Scroll the diagram sideways.

What gets installed

  • jt-oz-bridge serve, the service itself. It listens on loopback only.
  • Its own SQLite database, with message payloads encrypted by the application.
  • Small read-only helpers, run as the OpenCode account, that confirm which OpenCode process and project directory are the real ones.
  • Optional: a read-only observer for jt-oz-bridge sessions and doctor, and a unit that posts to Zulip when the bridge stops and when it is back.

One topic, one session

private channel "project-a"
├── login fix   → OpenCode session A
└── API tests   → OpenCode session B

Open a topic, pick a session you are allowed to use, and type. Each topic stays bound to that session until you disconnect it; the session itself stays in OpenCode.

Install, upgrade, uninstall

Linux with systemd, next to OpenCode, as its own non-root user. Each release goes into a directory named after the wheel's SHA-256, with hash-pinned dependencies and a CycloneDX SBOM, so going back is switching to the previous directory.

Install

  1. Get the wheel, the hashed requirements.txt and the SBOM, or an offline bundle.
  2. Check SHA256SUMS and install into a new venv with --require-hashes.
  3. Write the config, create the key, run migrate, start the unit, check /readyz.
  4. Add a Zulip bot and a private channel, then enroll one OpenCode project.
Install guide

Upgrade

  1. Install the new release next to the running one.
  2. Stop the bridge, back up, run migrate.
  3. Point the unit at the new release, wait for /readyz, run the smoke checks.
  4. To go back, point at the previous release. After a schema change, restore the backup instead.
Upgrade guide

Uninstall

  1. Take a last backup if you want one, and keep the key apart from it.
  2. Remove the units, releases, state, config and the service user.
  3. Zulip and OpenCode keep their own data. Deactivate the bot in Zulip.
Uninstall guide

Offline install, in short

# on a machine with internet access
uv build --wheel --out-dir "$OUT"
uv export --frozen --no-dev --no-emit-project --no-header --format requirements-txt -o "$OUT/requirements.txt"
pip download --require-hashes --only-binary=:all: --python-version 3.13 --platform manylinux_2_28_x86_64 \
  -r "$OUT/requirements.txt" -d "$OUT/wheels"      # plus SBOM and SHA256SUMS

# on the air-gapped host
sha256sum -c SHA256SUMS
uv venv --offline --python "$PY" "$R/venv"
uv pip install --offline --no-index --find-links ./wheels --require-hashes -r requirements.txt --python "$R/venv/bin/python"
uv pip install --offline --no-index --no-deps jt_oz_bridge-*.whl --python "$R/venv/bin/python"

The install guide has the full commands, including the platform tags, bringing Python and uv along, and checking the SBOM.

Security

  • Nothing is allowed until configured. Only listed Zulip users, private channels and per-project grants reach a session. Messages from bots are ignored, and nothing the model writes can grant a permission.
  • Checked again before every action. The sender, the channel members, the grant, the binding and the exact session are checked each time. If the result of an action is unknown, it is held for you instead of being sent again.
  • OpenCode decides what the agent may do. Its own tool, MCP and system permissions still apply. Approving a request in chat does not sandbox anything.
  • Secrets stay in files only the owner can read. The config refers to them by path, and the encryption key is kept apart from backups.
  • Hardened service. A dedicated user, no capabilities, strict filesystem protection, pinned dependencies and an SBOM for every release.

Security policy and how to report a vulnerability

Documentation and related projects

  • jt-doc-tools: self-hosted PDF and Office document processing
  • jt-ipam: IP address management with infrastructure and monitoring integrations
  • jt-live-whisper: local speech transcription, translation and meeting tools