OpenCode Slack Gateway - Deployment Status

Date: 2026-02-02 Status: ✅ FULLY OPERATIONAL - End-to-End Flow Working!

What’s Deployed

1. Gateway Service (ai-dev namespace)

  • Pod: gateway-656d6ff49-fbfhw - Running (1/1)
  • Image: ghcr.io/craigedmunds/ai-dev-gateway:0.1.1-dev
  • Service: gateway.ai-dev.svc.cluster.local:8000
  • Health: ✅ Responding on /api/health
  • Slack Connection: ✅ Socket Mode connected

2. Bridge Plugin (codev pod)

  • Location: /home/coder/src/.builders/0012-slack-gateway/repos/ai-dev/plugins/opencode-bridge/
  • Symlink: ~/.config/opencode/node_modules/@opencode/bridge-plugin → plugin source
  • NPM Link: ✅ Globally linked
  • Status: 📦 Installed but not yet loaded by OpenCode

3. GitHub Actions

  • Workflow: .github/workflows/build-gateway.yml
  • Build Strategy: Uses Taskfile (task build) - matches codev pattern
  • Version: Auto-increments on main branch builds
  • Dev Builds: VERSION-dev suffix (e.g., 0.1.1-dev)

Configuration

Gateway Connection

The plugin expects these environment variables (with defaults):

GATEWAY_URL=http://gateway.ai-dev.svc.cluster.local:8000
GATEWAY_WS=ws://gateway.ai-dev.svc.cluster.local:8000/ws/bridge

Default values work within the cluster:

  • http://gateway:8000 (needs to be gateway.ai-dev.svc.cluster.local for cross-namespace)
  • ws://gateway:8000/ws/bridge

Kubernetes Secrets

  • Slack Credentials: slack-opencode-credentials (synced via ClusterExternalSecret)
    • SLACK_BOT_TOKEN
    • SLACK_APP_TOKEN
    • SLACK_CHANNEL_ID
  • Docker Registry: gh-docker-registry-creds (for pulling private images)

Testing Needed

  1. Plugin Loading: Restart OpenCode or start a new session to verify plugin loads

    • Check for logs: cat /tmp/slack-bridge-plugin.log
    • Should see: “Plugin initialized” and “Gateway WebSocket: ws://…”
  2. WebSocket Connection: Plugin should connect to Gateway on load

    • Gateway logs should show: “WebSocket client connected”
  3. Permission Flow: Trigger a permission request in OpenCode

    • Should flow through Gateway to Slack
    • Slack message should appear with approval buttons

Files Changed

ai-dev repo (branch: epic1-story-1.5-state-persistence)

  • services/gateway/VERSION - Version tracking (current: 0.1.1)
  • services/gateway/Taskfile.yaml - Build automation with version increment
  • services/gateway/Dockerfile - Multi-stage build with uv
  • .github/workflows/build-gateway.yml - CI/CD pipeline
  • infrastructure/kustomize/components/gateway/ - K8s manifests
    • deployment.yaml - With imagePullSecrets and Slack env vars
    • kustomization.yaml - Image tag: 0.1.1-dev
  • pyproject.toml - With slack-bolt, aiohttp, websockets
  • uv.lock - Regenerated with all dependencies

codev pod

  • Installed uv (0.9.28) at ~/.local/bin/uv
  • Linked Bridge plugin to OpenCode

✅ Testing Complete

End-to-End Flow Verified (2026-02-02 16:46 UTC)

  1. ✅ OpenCode permission request triggered
  2. ✅ Bridge Plugin captured and forwarded to Gateway
  3. ✅ Gateway posted message to Slack
  4. ✅ User clicked “Allow” in Slack
  5. ✅ Gateway received decision and returned to Plugin
  6. ✅ Permission granted in OpenCode

Gateway Logs:

2026-02-02 16:46:10 [info] permission_request_received session_id=ses_3e19f99a7ffeohhvG0q0Pw1d37
2026-02-02 16:46:34 [info] permission_request_answered decision=allow
INFO: POST /api/opencode/permission HTTP/1.1" 200 OK

Configuration Notes

Environment Variables (Required)

These are set in codev pod environment and /home/coder/src/.opencode-env.sh:

  • GATEWAY_URL=http://gateway.ai-dev.svc.cluster.local:8000
  • GATEWAY_WS=ws://gateway.ai-dev.svc.cluster.local:8000/ws/bridge

Plugin Configuration

  • Location: /home/coder/src/.opencode/config.json (on PVC)
  • Symlinked to: ~/.config/opencode/config.json
  • Content: {"plugin": ["@opencode/bridge-plugin"]}

Completed Improvements

  • Add uv to codev Dockerfile (commit b3d8ad9)
  • Plugin loads automatically from PVC symlink
  • Config persists on PVC across pod restarts
  • Cross-namespace DNS working (gateway.ai-dev.svc.cluster.local)

PR Status

PR #7: [Epic 1] Gateway Deployment: Docker Build + K8s Integration

  • Branch: epic1-story-1.5-state-persistence
  • Status: Ready to merge after successful test
  • All CI checks passing ✅