Skip to content

Commit a5864bb

Browse files
committed
docs: add serve mode warmup instructions for eager plugin loading
opencode serve uses lazy instance loading — plugins only initialize when the first HTTP request arrives. Document how to send a warmup curl request to trigger Slack Socket Mode connection immediately after server startup. Signed-off-by: xuezhaojun <xuezhaokeepgoing@gmail.com>
1 parent 7e6b485 commit a5864bb

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

opencode-slack-plugin/README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,28 @@ export SLACK_APP_TOKEN=xapp-your-app-token
8989

9090
### 4. Run OpenCode
9191

92+
**TUI mode** (interactive terminal — plugin loads automatically):
93+
9294
```bash
93-
opencode serve
94-
# or just
9595
opencode
9696
```
9797

98+
**Serve mode** (headless server — plugin loads on first request):
99+
100+
```bash
101+
# Start the server
102+
opencode serve &
103+
104+
# Send a warmup request to trigger plugin loading.
105+
# opencode serve uses lazy instance loading — plugins only initialize
106+
# when the first request arrives for a project directory.
107+
# This curl triggers that initialization so Slack Socket Mode connects.
108+
sleep 1 && curl -s http://127.0.0.1:4096/session?directory=$(pwd) > /dev/null
109+
110+
# The server is now running with Slack connected.
111+
# Look for "[slack-plugin] Slack Socket Mode connected" in the output.
112+
```
113+
98114
The plugin activates automatically when both `SLACK_BOT_TOKEN` and `SLACK_APP_TOKEN` are set. If either is missing, the plugin silently skips initialization.
99115

100116
## Usage

0 commit comments

Comments
 (0)