feat(chat): add slack bridge with account linking and compose stack#103
Open
alexinthesky wants to merge 1 commit into
Open
feat(chat): add slack bridge with account linking and compose stack#103alexinthesky wants to merge 1 commit into
alexinthesky wants to merge 1 commit into
Conversation
alexinthesky
force-pushed
the
feat/slack-integration
branch
3 times, most recently
from
March 27, 2026 16:55
4acf6d6 to
d9cc45f
Compare
alexinthesky
force-pushed
the
feat/slack-integration
branch
2 times, most recently
from
March 31, 2026 13:52
e1db304 to
37a31e2
Compare
alexinthesky
force-pushed
the
feat/slack-integration
branch
from
March 31, 2026 14:08
37a31e2 to
ae41f0c
Compare
alexinthesky
force-pushed
the
feat/slack-integration
branch
from
April 2, 2026 09:02
ae41f0c to
4f43138
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
…port - Slack Socket Mode bridge (Node.js/Bolt) with account linking via HMAC-signed nonces - AI assistant view: routes messages to Grafana agent loop via SSE streaming - Account linking: email-based role mapping from Grafana, 24h stale-role warning - Multi-org support: basic auth (GRAFANA_USERNAME/GRAFANA_PASSWORD) replaces SA token so a single bot works across all Grafana orgs - RBAC: live role lookup per request; Viewers get read-only tool access - Security: constant-time secret comparison, single-use nonces, rate limiting (20/hr) - Session continuity: thread→session mapping with bounded LRU eviction (512 entries) - Redis-backed link store with reverse index and stale cleanup on re-link - docker-compose-full.yaml: adds slack-bridge service with basic auth credentials - Home.tsx: fix orgHint race — capture before URL params are cleared - slack-bridge userMessage: run agent for linked users, prompt unlinked to setup - Accurate Slack app manifest (assistant_view schema) and simplified setup docs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
alexinthesky
force-pushed
the
feat/slack-integration
branch
from
April 2, 2026 13:10
cebf615 to
e465baf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a Slack ↔ Ask O11y path: users DM the bot
setupto get a one-time Grafana link (account linking), and@mentionthe bot in channels to run the same detached agent flow as the web UI. A Bolt + Socket Mode worker (slack-bridge/) talks to new plugin HTTP routes;docker-compose-fullcan run the bridge locally with automated Grafana service-account token creation.What changed
Backend (Go plugin)
/api/slack-bridge/*(pending nonce, lookup, agent run + SSE) and/api/slack-link/confirmfor browser confirmation, with HMAC-signed short-lived bridge tokens and sharedexecuteDetachedAgentRunfor agent execution.slacklink_store.go).slackBridgeSecretread from secure JSON; compose passesSLACK_BRIDGE_SECRETinto Grafana so provisioning can match the bridge.Slack bridge (Node / Bolt)
slack-bridge/package: Socket Mode +Assistanthandler for Agents UI and classic DMsetup,app_mentionfor channel Q&A, calls to Grafana with Bearer SA token + bridge headers.@slack/web-apiforauth.testpreflight.Frontend
?slack_link=handling onHomewithslackLink.tsservice calling confirm API.Dev / ops
scripts/server-full.sh(vianpm run server:full): provisioning swap, optionalnpm run build,SLACK_BRIDGE_SECRETgeneration, compose up withoutslack-bridgefirst, SA token script +/api/usercheck, then--force-recreate slack-bridge.scripts/create-slack-bridge-grafana-token.shwith--write-env;scripts/lib/upsert-env.shshared upsert;scripts/verify-slack-bridge-tokens.sh.npm run server:full:cleanfor stale Docker networks.docker-compose-full.yaml:slack-bridgeservice;GRAFANA_TOKENfromGRAFANA_SERVICE_ACCOUNT_TOKENorGRAFANA_TOKEN..env.example, eslint ignore forslack-bridge/node_modules, CLAUDE.md updates.Provisioning (this branch)
provisioning/plugins/follows multi-orgfull.yaml+app.yaml_(as used by the full stack script).Why
setup) and channel questions without duplicating agent logic client-side.slack-bridgeonly after a valid Grafana SA token exists avoids 401 / invalid API key on/pendingfrom an empty or stale env.server:full:cleanreduce Docker/network friction.Notes for reviewers
slack-bridge/README.md.Note
High Risk
Adds new externally callable Slack-bridge endpoints plus HMAC/secret-based authentication and user↔Slack identity binding, which is security-sensitive and impacts how agent runs are authorized. Also introduces a new runnable service and compose/workflow automation that could break local/prod deployments if misconfigured.
Overview
Enables a new Slack bridge integration: users can DM
setupto generate a one-time linking nonce and then run Ask O11y agent conversations via Slack@mentions, reusing the same detached agent execution path as the web UI.On the backend, adds
/api/slack-bridge/*and/api/slack-link/*routes (pending nonce, lookup, confirm/unlink/status, Slack-authenticated agent run + SSE) protected by a sharedslackBridgeSecret, short-lived HMAC-signedX-Slack-Bridge-Token, and per-user rate limiting; includes Redis/in-memory storage for link state and updatesopenapi.json+ tests.Adds a new
slack-bridge/Node service (Bolt Socket Mode) with a Docker image and GHCR publishing workflow, plus updates todocker-compose-full.yaml, provisioning (slackBridgeSecret), frontendHomeURL handling +slackLinkservice, and new helper scripts to bootstrap the full stack and manage required.envvalues and Grafana service-account tokens.Written by Cursor Bugbot for commit e465baf. This will update automatically on new commits. Configure here.