feat: add assistant mode, SSE streaming, and OpenCode server integration (#214)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-02 21:51:37 -04:00
1 parent 3cc24288a6
commit c3d6549f01
133 files changed
+7284 -6293

No files matched your search

+41 -1
View File
@@ -126,7 +126,6 @@ The container entrypoint (`scripts/docker-entrypoint.sh`) automatically:
2. **Verifies OpenCode** is installed (installed at build time, fallback install if missing)
3. **Upgrades OpenCode** if below minimum version (1.0.137)
4. **Validates AUTH_SECRET** is set (required for startup)
5. **Validates memory plugin** installation (installed from npm during Docker build)
## Port Configuration
@@ -387,3 +386,44 @@ docker exec -it opencode-manager vi /workspace/.config/opencode/AGENTS.md
### Precedence
Global instructions merge with repository-specific `AGENTS.md` files. Repository instructions take precedence.
## Exposing the OpenCode Server (Advanced)
By default, the OpenCode server binds to `127.0.0.1` inside the container and is **not reachable from outside the container**. This is the correct and safe default for nearly all users.
### When to Expose Externally
You only need to expose the OpenCode server on an external interface if you have a specific use case that requires other services or machines to connect directly to it.
### How to Expose Safely
To expose the OpenCode server on the host network:
1. **Set `OPENCODE_HOST=0.0.0.0`** in your environment
2. **Add port `5551:5551`** to the compose ports
3. **Set `OPENCODE_SERVER_PASSWORD`** — this is **required**; the managed OpenCode server will refuse to start without it
Example compose override:
```yaml
services:
app:
ports:
- "5551:5551"
environment:
- OPENCODE_HOST=0.0.0.0
- OPENCODE_SERVER_PASSWORD=${OPENCODE_SERVER_PASSWORD:?Set OPENCODE_SERVER_PASSWORD before exposing OpenCode on port 5551}
```
### Password Configuration
The password can be configured in two ways:
1. **Environment variable:** Set `OPENCODE_SERVER_PASSWORD` in your `.env` file or compose environment
2. **Via UI:** Use Settings → OpenCode → Server Auth to set a password at runtime
**DB-stored passwords take precedence over the environment variable.** If you set a password via the UI, it will override the env var.
### Startup Guard
If you set `OPENCODE_HOST=0.0.0.0` (or any non-localhost host) without configuring a password (either via env var or UI), the managed OpenCode server will refuse to start with an error message explaining how to fix it. The OpenCode Manager UI/API may remain available so you can configure a password and restart the managed server.
+2
View File
@@ -94,6 +94,8 @@ When configured, users can enable push notifications in Settings → Notificatio
|----------|-------------|---------|
| `OPENCODE_SERVER_PORT` | Port for the OpenCode CLI server | `5551` |
| `OPENCODE_HOST` | OpenCode server bind address | `127.0.0.1` |
| `OPENCODE_SERVER_PASSWORD` | Basic Auth password required when binding OpenCode to a non-loopback host. Can also be set via UI (Settings → OpenCode → Server Auth). DB-stored passwords override this env var. | - |
| `OPENCODE_SERVER_USERNAME` | Basic Auth username | `opencode` |
## Timeouts