Skip to content

feat: add multi-platform chat bot with Discord adapter#1095

Open
jomcgi wants to merge 20 commits intomainfrom
feat/chat-bot-design
Open

feat: add multi-platform chat bot with Discord adapter#1095
jomcgi wants to merge 20 commits intomainfrom
feat/chat-bot-design

Conversation

@jomcgi
Copy link
Owner

@jomcgi jomcgi commented Mar 13, 2026

Summary

  • Add a new chat bot service (projects/agent_platform/chat_bot/) using Chat SDK (TypeScript) with Discord as the first platform adapter
  • Tiered access model: owner mentions route through the orchestrator for research jobs (Claude/Goose), everyone else gets immediate responses from llama-cpp
  • Outbound notifications via NATS pub/sub — cluster-agents and recipes can publish to Discord channels
  • Add NotificationPublisher to cluster-agents for NATS-based Discord notifications
  • Deployed as a standalone ArgoCD Application (like cluster-agents) in its own namespace

What's included

Area Files
TypeScript app chat_bot/src/ — config, orchestrator client, llm client, gist client, NATS client, handlers, entry point
Container image chat_bot/image/apko.yaml — Node.js 20, non-root, dual-arch
Helm chart chat_bot/deploy/ — deployment, service, 1Password secrets, ArgoCD Application
Bazel build chat_bot/BUILD + deploy/BUILD — image + chart publishing
Cluster-agents notification.go + NATS env var wiring (v0.4.0)
Design docs docs/plans/2026-03-12-chat-bot-design.md + implementation plan

Before deploying

Manual steps required (Task 15 in the plan):

  1. Create Discord Application at Developer Portal
  2. Store credentials in 1Password vault k8s-homelab as discord-bot-credentials
  3. Update application.yaml valuesObject with ownerDiscordUserId and notificationChannelMap

Test plan

  • CI passes (Bazel build, format check, semgrep)
  • helm template renders cleanly for chat-bot chart
  • Cluster-agents chart version bump to 0.4.0 deploys cleanly
  • Discord bot connects after manual secret setup
  • Owner mention triggers orchestrator job + gist reply
  • Non-owner mention gets llama-cpp response
  • NATS notification publishes to Discord channel

🤖 Generated with Claude Code

jomcgi and others added 16 commits March 12, 2026 20:55
Multi-platform chat bot using Chat SDK (TypeScript) with Discord as the
first adapter. Tiered access model routes owner requests through the
orchestrator and everyone else through llama-cpp. Outbound notifications
from cluster-agents via NATS pub/sub.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15-task implementation plan covering project scaffolding, Chat SDK
integration, orchestrator/llama-cpp clients, NATS notifications,
Helm chart, ArgoCD deployment, and cluster-agents notification publisher.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add NotificationPublisher that publishes notification messages to NATS
subjects for Discord channel delivery. NATS connection is optional —
if NATS_URL is not configured, the publisher is disabled with a warning.
The publisher is created but not yet wired into agents (future task).

Also fix pre-existing hardcoded K8s service URLs in envOr defaults to
use empty strings instead (URLs are injected via values.yaml).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jomcgi jomcgi force-pushed the feat/chat-bot-design branch from 7855fe7 to 4d84fcf Compare March 13, 2026 03:55
jomcgi and others added 4 commits March 12, 2026 21:01
…esolution

The apko.translate_lock references //projects/agent_platform/chat_bot/image:apko.lock.json
which requires the image/ directory to be a Bazel package.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant