From d10588ab4559c928843d59b13ac15c6eb69b7972 Mon Sep 17 00:00:00 2001 From: Khaliq Date: Mon, 16 Nov 2026 16:15:03 -0800 Subject: [PATCH 1/2] feat(slack-relay): router reacts :eyes: to each message it routes As soon as the router takes a message (an @mention, a reply in a thread it holds, an allowed DM) it calls reactions.add with slack.ackReaction (default eyes; empty turns it off), fire-and-forget: routing never waits on it or fails with it. Ignored messages get no reaction. already_reacted is ignored; other failures log Slack's error code only, never message text. A token without reactions:write (missing_scope) is reported once and not asked again until the router restarts. The manifest requests reactions:write; existing installs add it, reinstall the app and restart the router. slack-relay 0.3.11, agent-relay 0.7.50 (0.7.48 is #441's, 0.7.49 #442's). Co-Authored-By: Claude Opus 5.5 --- charts/agent-relay/Chart.lock | 6 +- charts/agent-relay/Chart.yaml | 4 +- charts/slack-relay/Chart.yaml | 2 +- charts/slack-relay/templates/router.yaml | 2 + charts/slack-relay/values.yaml | 4 + .../manifest/slack-app-manifest.json | 3 +- components/slack-relay/src/main.ts | 1 + components/slack-relay/src/router.ts | 40 ++++- components/slack-relay/src/slack.ts | 18 ++- components/slack-relay/test/ack.test.ts | 149 ++++++++++++++++++ docs/self-hosted-requirements.md | 16 +- docs/self-hosted-slack-relay.md | 21 ++- self-hosted/requirements.yaml | 34 +++- 13 files changed, 273 insertions(+), 27 deletions(-) create mode 100644 components/slack-relay/test/ack.test.ts diff --git a/charts/agent-relay/Chart.lock b/charts/agent-relay/Chart.lock index 211049d3..ff700a0d 100644 --- a/charts/agent-relay/Chart.lock +++ b/charts/agent-relay/Chart.lock @@ -31,9 +31,9 @@ dependencies: version: 0.1.0 - name: slack-relay repository: file://../slack-relay - version: 0.3.10 + version: 0.3.11 - name: relaygate repository: file://../relaygate version: 0.1.9 -digest: sha256:2528e3b23ca1d452cc6b2ecce93297ac5ee65e3098099c92296f44a47b1841fa -generated: "2026-11-16T15:44:15.784767-08:00" +digest: sha256:f484c40e77de41f944978a171396ee52401fbc8df386d2304bad28cb6f3e2572 +generated: "2026-11-16T16:13:09.672934-08:00" diff --git a/charts/agent-relay/Chart.yaml b/charts/agent-relay/Chart.yaml index a1986c6c..762385ba 100644 --- a/charts/agent-relay/Chart.yaml +++ b/charts/agent-relay/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: agent-relay description: Self-hosted Agent Relay messaging and sessions suite type: application -version: 0.7.48 +version: 0.7.50 appVersion: "0.1.0" kubeVersion: ">=1.28.0-0" annotations: @@ -59,7 +59,7 @@ dependencies: repository: file://../relay-chief condition: components.relayChief - name: slack-relay - version: 0.3.10 + version: 0.3.11 repository: file://../slack-relay condition: components.slackRelay - name: relaygate diff --git a/charts/slack-relay/Chart.yaml b/charts/slack-relay/Chart.yaml index 936a582b..41f1c4cb 100644 --- a/charts/slack-relay/Chart.yaml +++ b/charts/slack-relay/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: slack-relay type: application -version: 0.3.10 +version: 0.3.11 appVersion: "0.1.0" kubeVersion: ">=1.27.0-0" description: >- diff --git a/charts/slack-relay/templates/router.yaml b/charts/slack-relay/templates/router.yaml index c1ad8c8e..4a96de59 100644 --- a/charts/slack-relay/templates/router.yaml +++ b/charts/slack-relay/templates/router.yaml @@ -68,6 +68,8 @@ spec: value: {{ join "," .Values.slack.allowedChannels | quote }} - name: SLACK_ALLOW_DMS value: {{ .Values.slack.allowDms | quote }} + - name: SLACK_ACK_REACTION + value: {{ .Values.slack.ackReaction | default "" | quote }} {{- include "slack-relay.secretEnv" (dict "env" "SLACK_BOT_TOKEN" "ref" .Values.secrets.slackBotToken) | nindent 12 }} {{- if eq .Values.slack.mode "socket" }} {{- include "slack-relay.secretEnv" (dict "env" "SLACK_APP_TOKEN" "ref" .Values.secrets.slackAppToken) | nindent 12 }} diff --git a/charts/slack-relay/values.yaml b/charts/slack-relay/values.yaml index 777476d3..58d1d1c5 100644 --- a/charts/slack-relay/values.yaml +++ b/charts/slack-relay/values.yaml @@ -98,6 +98,10 @@ slack: # Refuse channels shared outside the workspace (Slack Connect), for answers # and ingest. Unknown sharing state counts as shared. refuseSharedChannels: true + # Reaction the router adds to each message it routes to an agent, as soon as + # it takes it (before the agent starts). Needs the bot scope reactions:write; + # without it the router logs once and carries on. Empty turns it off. + ackReaction: eyes # Remote MCP servers behind OAuth client credentials, e.g. a gbrain company # brain. Agents get the ones listed in host.mcpServers as tools (add diff --git a/components/slack-relay/manifest/slack-app-manifest.json b/components/slack-relay/manifest/slack-app-manifest.json index 0f48d664..5d664ba1 100644 --- a/components/slack-relay/manifest/slack-app-manifest.json +++ b/components/slack-relay/manifest/slack-app-manifest.json @@ -25,7 +25,8 @@ "chat:write", "groups:history", "groups:read", - "im:history" + "im:history", + "reactions:write" ] } }, diff --git a/components/slack-relay/src/main.ts b/components/slack-relay/src/main.ts index ec466f95..314659b1 100644 --- a/components/slack-relay/src/main.ts +++ b/components/slack-relay/src/main.ts @@ -116,6 +116,7 @@ async function runRouter(): Promise { channel, selfName: routerName, log, + ackReaction: env.SLACK_ACK_REACTION ?? "eyes", // Slack posts don't pass through relaygate, so each one is asked about first. egress: gate ? (ref, text) => checkWithRetry(gate, routerToken, { op: "w", resource: { kind: "stream", id: slackStreamId(ref) }, content: text }) : undefined, }); diff --git a/components/slack-relay/src/router.ts b/components/slack-relay/src/router.ts index 142bd404..ec635955 100644 --- a/components/slack-relay/src/router.ts +++ b/components/slack-relay/src/router.ts @@ -7,6 +7,8 @@ // is written to the ledger and never asked again // 4. deliver post to the relay thread for that Slack thread, addressed to // the owning agent, with its session and the roster +// 0. ack an :eyes: reaction on the human's message as soon as the +// router takes it, fire-and-forget (never delays routing) // 5. return an agent's reply in that relay thread goes back to the Slack // thread the ledger maps it to // @@ -16,7 +18,7 @@ import { sessionIdFor } from "./session-id.ts"; import type { Ledger, ThreadKey } from "./ledger.ts"; import type { Orchestrator } from "./orchestrator.ts"; import { dataOf, replyOf, type InboundData, type RelayEventLike, type RelayMessageLike, type RosterEntry } from "./protocol.ts"; -import type { SlackInbound, SlackWebLike } from "./slack.ts"; +import { SlackApiError, type SlackInbound, type SlackWebLike } from "./slack.ts"; export interface RouterRelay { message?(id: string): Promise; @@ -36,6 +38,8 @@ export class Router { readonly #chains = new Map>(); readonly #retryDelaysMs: number[]; readonly #egress: ((ref: { team: string; channel: string; thread_ts: string }, text: string) => Promise) | undefined; + /** Reaction name for step 0; empty when off (or after Slack said the token lacks reactions:write). */ + #ackReaction: string; constructor(opts: { ledger: Ledger; @@ -52,6 +56,8 @@ export class Router { * rejects to withhold. Absent: posts go straight out. */ egress?: (ref: { team: string; channel: string; thread_ts: string }, text: string) => Promise; + /** Reaction added to each message the router takes (default "eyes"); "" turns it off. */ + ackReaction?: string; }) { this.#ledger = opts.ledger; this.#relay = opts.relay; @@ -62,6 +68,7 @@ export class Router { this.#log = opts.log ?? (() => {}); this.#retryDelaysMs = opts.retryDelaysMs ?? [500, 2000, 5000]; this.#egress = opts.egress; + this.#ackReaction = (opts.ackReaction ?? "eyes").trim().replace(/^:|:$/g, ""); } /** @@ -74,6 +81,10 @@ export class Router { /** Steps 1-4 for one Slack message. Serialized per Slack thread. */ fromSlack(m: SlackInbound & { team: string }): Promise { + // Every message reaching here is one the router routes (the caller has + // already dropped ignored ones), so acknowledge it now, before it waits + // behind earlier messages in its thread or for the orchestrator. + this.#ack(m.channel, m.ts); const key: ThreadKey = { team: m.team, channel: m.channel, threadTs: m.threadTs }; const chainKey = `${key.team}/${key.channel}/${key.threadTs}`; const prior = this.#chains.get(chainKey) ?? Promise.resolve(); @@ -151,6 +162,33 @@ export class Router { return relayId; } + /** + * Step 0: react to the human's message. Fire-and-forget: routing never waits + * on it or fails with it. Only Slack's error code is logged, never the text. + * A token without reactions:write is reported once and not asked again. + */ + #ack(channel: string, ts: string): void { + const name = this.#ackReaction; + if (!name || !this.#slack.addReaction) return; + let pending: Promise; + try { + pending = this.#slack.addReaction({ channel, timestamp: ts, name }); + } catch (err) { + pending = Promise.reject(err); + } + pending.catch((err: unknown) => { + const code = err instanceof SlackApiError ? err.code : "request_failed"; + if (code === "already_reacted") return; + if (code === "missing_scope") { + if (!this.#ackReaction) return; + this.#ackReaction = ""; + this.#log(`ack reaction off: the bot token lacks reactions:write (add reactions:write and reinstall the app)`); + return; + } + this.#log(`ack reaction failed for ${channel}:${ts} (${code})`); + }); + } + /** Step 5: an agent's reply in a relay thread goes back to its Slack thread. */ async fromRelay(ev: RelayEventLike): Promise { if (ev.type !== "thread.reply" || !ev.parentId) return false; diff --git a/components/slack-relay/src/slack.ts b/components/slack-relay/src/slack.ts index 58a9eabf..a34c7127 100644 --- a/components/slack-relay/src/slack.ts +++ b/components/slack-relay/src/slack.ts @@ -142,6 +142,18 @@ export class ChannelDirectory { export interface SlackWebLike { postMessage(args: { channel: string; text: string; threadTs?: string }): Promise<{ ts?: string }>; + /** reactions.add; rejects with a SlackApiError carrying Slack's error code. */ + addReaction?(args: { channel: string; timestamp: string; name: string }): Promise; +} + +/** A Web API call Slack answered with ok:false (or a non-2xx status). `code` is Slack's error code only. */ +export class SlackApiError extends Error { + readonly code: string; + constructor(method: string, status: number, code: string) { + super(`slack ${method} failed: ${status} ${code}`); + this.name = "SlackApiError"; + this.code = code; + } } /** Slack form arguments: strings as-is, everything else JSON (Slack's convention for blocks etc.). */ @@ -180,7 +192,7 @@ export class SlackWeb implements SlackWebLike { } const json = (await res.json().catch(() => ({}))) as Record; if (!res.ok || json.ok !== true) { - throw new Error(`slack ${method} failed: ${res.status} ${String(json.error ?? "unknown_error")}`); + throw new SlackApiError(method, res.status, String(json.error ?? "unknown_error")); } return json; } @@ -201,6 +213,10 @@ export class SlackWeb implements SlackWebLike { return { ts: typeof r.ts === "string" ? r.ts : undefined }; } + async addReaction(args: { channel: string; timestamp: string; name: string }): Promise { + await this.call("reactions.add", { channel: args.channel, timestamp: args.timestamp, name: args.name }); + } + async openSocketUrl(appToken: string): Promise { const r = await this.call("apps.connections.open", {}, appToken); if (typeof r.url !== "string") throw new Error("slack apps.connections.open returned no url"); diff --git a/components/slack-relay/test/ack.test.ts b/components/slack-relay/test/ack.test.ts new file mode 100644 index 00000000..ea65c767 --- /dev/null +++ b/components/slack-relay/test/ack.test.ts @@ -0,0 +1,149 @@ +// Step 0 of the router: an :eyes: reaction on each message it takes. +import assert from "node:assert/strict"; +import { createServer } from "node:http"; +import type { AddressInfo } from "node:net"; +import { test } from "node:test"; +import { Ledger } from "../src/ledger.ts"; +import { DeterministicOrchestrator } from "../src/orchestrator.ts"; +import { Router } from "../src/router.ts"; +import { normalizeSlackEvent, SlackApiError, SlackWeb, type SlackWebLike } from "../src/slack.ts"; + +type Reaction = { channel: string; timestamp: string; name: string }; + +function setup(opts: { addReaction?: SlackWebLike["addReaction"]; ackReaction?: string } = {}) { + const ledger = new Ledger(":memory:"); + const reactions: Reaction[] = []; + const logs: string[] = []; + let n = 0; + const slack: SlackWebLike = { + postMessage: async () => ({}), + addReaction: opts.addReaction ?? (async (a) => void reactions.push(a)), + }; + const router = new Router({ + ledger, + relay: { send: async () => ({ id: `r${++n}` }), reply: async () => ({ id: `r${++n}` }) }, + slack, + orchestrator: new DeterministicOrchestrator(), + channel: "slack", + selfName: "router", + log: (m) => logs.push(m), + retryDelaysMs: [1], + ...(opts.ackReaction !== undefined ? { ackReaction: opts.ackReaction } : {}), + }); + // What the router's Slack handler does: normalize, then route what isn't ignored. + const onEvent = async (event: Record) => { + const m = normalizeSlackEvent(event, { botUserId: "UBOT", teamId: "T1", isTrackedThread: (ch, ts) => router.isTrackedThread("T1", ch, ts) }); + return m ? router.fromSlack({ ...m, team: "T1" }) : null; + }; + return { ledger, router, reactions, logs, onEvent }; +} + +const tick = () => new Promise((r) => setImmediate(r)); + +test("a routed mention and a reply in its thread each get :eyes:", async () => { + const { reactions, onEvent } = setup(); + assert.ok(await onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> help" })); + assert.ok(await onEvent({ type: "message", channel: "C1", ts: "1.2", thread_ts: "1.1", user: "U1", text: "more detail" })); + assert.ok(await onEvent({ type: "message", channel_type: "im", channel: "D1", ts: "2.1", user: "U1", text: "a dm" })); + await tick(); + assert.deepEqual(reactions, [ + { channel: "C1", timestamp: "1.1", name: "eyes" }, + { channel: "C1", timestamp: "1.2", name: "eyes" }, + { channel: "D1", timestamp: "2.1", name: "eyes" }, + ]); +}); + +test("ignored messages get no reaction", async () => { + const { reactions, onEvent } = setup(); + // Plain channel message, reply in a thread the router doesn't hold, bot message, edit. + assert.equal(await onEvent({ type: "message", channel: "C1", ts: "1.1", user: "U1", text: "chatter" }), null); + assert.equal(await onEvent({ type: "message", channel: "C1", ts: "1.3", thread_ts: "1.2", user: "U1", text: "elsewhere" }), null); + assert.equal(await onEvent({ type: "message", channel: "C1", ts: "1.4", user: "U2", bot_id: "B1", text: "bot" }), null); + assert.equal(await onEvent({ type: "message", subtype: "message_changed", channel: "C1", ts: "1.5", user: "U1", text: "edit" }), null); + await tick(); + assert.deepEqual(reactions, []); +}); + +test("ackReaction '' turns the reaction off; a custom name is used as given", async () => { + const off = setup({ ackReaction: "" }); + await off.onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> hi" }); + await tick(); + assert.deepEqual(off.reactions, []); + const custom = setup({ ackReaction: ":robot_face:" }); + await custom.onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> hi" }); + await tick(); + assert.equal(custom.reactions[0]?.name, "robot_face"); +}); + +test("missing_scope is logged once and the router stops trying; routing goes on", async () => { + let calls = 0; + const { onEvent, logs } = setup({ + addReaction: async () => { + calls++; + throw new SlackApiError("reactions.add", 200, "missing_scope"); + }, + }); + assert.ok(await onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> one secret" })); + await tick(); + assert.ok(await onEvent({ type: "app_mention", channel: "C1", ts: "2.1", user: "U1", text: "<@UBOT> two" })); + await tick(); + assert.equal(calls, 1, "not asked again after missing_scope"); + const scopeLogs = logs.filter((l) => l.includes("reactions:write")); + assert.equal(scopeLogs.length, 1); + assert.match(scopeLogs[0]!, /add reactions:write and reinstall the app/); + assert.ok(!logs.some((l) => l.includes("secret")), "message text is never logged"); +}); + +test("already_reacted is ignored; other failures log the code only", async () => { + const codes = ["already_reacted", "ratelimited"]; + const { onEvent, logs } = setup({ + addReaction: async () => { + throw new SlackApiError("reactions.add", 200, codes.shift()!); + }, + }); + await onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> private words" }); + await onEvent({ type: "app_mention", channel: "C1", ts: "2.1", user: "U1", text: "<@UBOT> private words" }); + await tick(); + const ack = logs.filter((l) => l.startsWith("ack reaction")); + assert.deepEqual(ack, ["ack reaction failed for C1:2.1 (ratelimited)"]); + assert.ok(!logs.some((l) => l.includes("private words"))); +}); + +test("a slow or failing reaction never blocks or fails routing", async () => { + // Never settles. + const slow = setup({ addReaction: () => new Promise(() => {}) }); + const routed = await Promise.race([ + slow.onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> hi" }), + new Promise((r) => setTimeout(() => r("timeout"), 1000)), + ]); + assert.match(String(routed), /^r\d+$/, "routed while the reaction is still pending"); + // Throws synchronously, and rejects with a non-Slack error. + const sync = setup({ addReaction: () => { throw new Error("boom"); } }); + assert.ok(await sync.onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> hi" })); + const net = setup({ addReaction: async () => { throw new TypeError("fetch failed"); } }); + assert.ok(await net.onEvent({ type: "app_mention", channel: "C1", ts: "1.1", user: "U1", text: "<@UBOT> hi" })); + await tick(); + assert.deepEqual(net.logs.filter((l) => l.startsWith("ack")), ["ack reaction failed for C1:1.1 (request_failed)"]); +}); + +test("SlackWeb.addReaction posts reactions.add and surfaces Slack's error code", async () => { + const seen: string[] = []; + const server = createServer((req, res) => { + let body = ""; + req.on("data", (c) => (body += c)); + req.on("end", () => { + seen.push(`${req.url} ${body}`); + const ok = !body.includes("timestamp=2.2"); + res.writeHead(200, { "content-type": "application/json" }).end(JSON.stringify(ok ? { ok: true } : { ok: false, error: "missing_scope" })); + }); + }); + await new Promise((r) => server.listen(0, "127.0.0.1", r)); + try { + const web = new SlackWeb("xoxb-test", `http://127.0.0.1:${(server.address() as AddressInfo).port}`); + await web.addReaction({ channel: "C1", timestamp: "1.1", name: "eyes" }); + assert.deepEqual(seen, ["/reactions.add channel=C1×tamp=1.1&name=eyes"]); + await assert.rejects(web.addReaction({ channel: "C1", timestamp: "2.2", name: "eyes" }), (err: unknown) => err instanceof SlackApiError && err.code === "missing_scope"); + } finally { + server.close(); + } +}); diff --git a/docs/self-hosted-requirements.md b/docs/self-hosted-requirements.md index ccca74c2..b7feaf7c 100644 --- a/docs/self-hosted-requirements.md +++ b/docs/self-hosted-requirements.md @@ -161,7 +161,8 @@ Services image (sessions-pipeline-worker, alleyoop and the privileged SQL Jobs): | relayauth-0.1.2 | shipped | relayauth 0.1.2 | relayauth: `ghcr.io/agentworkforce/relayauth@sha256:c23c92d25fdf…` | | | License-annotation patch bump of 0.1.1. Superseded by 0.1.3. | | relayauth-0.1.1 | shipped | relayauth 0.1.1 | relayauth: `ghcr.io/agentworkforce/relayauth@sha256:c23c92d25fdf…` | | | relayauth 784582ef (machine-bound History assertion contract, relayauth #113). Superseded by 0.1.2. | | relayauth-0.1.0 | shipped | relayauth 0.1.0 | relayauth: `ghcr.io/agentworkforce/relayauth@sha256:eb71daa28e30…` | | | superseded by 0.1.1. | -| agent-relay-0.7.48 | unreleased | agent-relay 0.7.48
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.43, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.10, relaygate 0.1.9) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.47 and slack-relay 0.3.10, relaygate 0.1.9: behind relaygate the Slack thread agents see every agent on the relay that the policy shows them (mcp__relay_agents list_agents and get_agent, read-only, as each agent), and the default policy shows the pit every agent (relaycast:agent/ r for gid 22; visibility only, needs relaygate with the agent directory). Still default-off (components.slackRelay, components.relaygate). Default renders gain RELAY_AGENTS_MCP and the relaycast:agent/ policy default, plus the helm.sh/chart labels. | +| agent-relay-0.7.50 | unreleased | agent-relay 0.7.50
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.43, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.9) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.48 and slack-relay 0.3.11: the Slack router reacts :eyes: to each message it routes as soon as it takes it (slack.ackReaction, needs the bot scope reactions:write), still default-off (components.slackRelay). Default renders differ only in the helm.sh/chart labels. | +| agent-relay-0.7.48 | **planned** | agent-relay 0.7.48
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.43, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.10, relaygate 0.1.9) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.47 and slack-relay 0.3.10, relaygate 0.1.9: behind relaygate the Slack thread agents see every agent on the relay that the policy shows them (mcp__relay_agents list_agents and get_agent, read-only, as each agent), and the default policy shows the pit every agent (relaycast:agent/ r for gid 22; visibility only, needs relaygate with the agent directory). Still default-off (components.slackRelay, components.relaygate). Default renders gain RELAY_AGENTS_MCP and the relaycast:agent/ policy default, plus the helm.sh/chart labels. | | agent-relay-0.7.47 | **planned** | agent-relay 0.7.47
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.43, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.9, relaygate 0.1.8) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.46 and slack-relay 0.3.9: sessions.mcp paging fix (no items dropped to fit the output cap) and the built-in sessions MCP name kept, still default-off (components.slackRelay). Default renders differ only in the helm.sh/chart labels. | | agent-relay-0.7.46 | **planned** | agent-relay 0.7.46
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.43, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.8, relaygate 0.1.8) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.45 and slack-relay 0.3.8: behind relaygate a Slack thread agent never answers a DM from outside its group (the host asks /v1/check first and fails closed), still default-off (components.slackRelay). Default renders differ only in the helm.sh/chart labels. | | agent-relay-0.7.45 | **planned** | agent-relay 0.7.45
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.43, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.7, relaygate 0.1.8) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.44 and slack-relay 0.3.7: opt-in sessions.mcp (read-only Sessions tools for the Slack agents, each read decided by relaygate as the agent; the read credential stays in the host), still default-off (components.slackRelay). Default renders differ only in the helm.sh/chart labels. | @@ -302,7 +303,8 @@ Services image (sessions-pipeline-worker, alleyoop and the privileged SQL Jobs): | relaygate-0.1.2 | **planned** | relaygate 0.1.2 | relaygate: `ghcr.io/agentworkforce/relaygate@sha256:` | | | Carries 0.1.1. The Sessions proxy forwards each caller's own Sessions credential, so secrets.sessionsToken is optional; adds proxy.sessionsUploadUrl, proxy.sessionsReadUrl and proxy.sessionsHosts (SESSIONS_UPLOAD_URL, SESSIONS_READ_URL, SESSIONS_HOSTS). Needs relaygate sha256:8c2adac4 (main 35c2a8f) or later for the passthrough and new settings. Ships no default digest. | | relaygate-0.1.1 | **planned** | relaygate 0.1.1 | relaygate: `ghcr.io/agentworkforce/relaygate@sha256:` | | | Build 2 support (opt-in Relaycast and Sessions proxies, sessionDefaults, admin explain) and policy defaults that follow relaygate examples/policy.pit.json (every stream 660 plus explicit ACLs, the Slack app channel pit-only, per-key name prefixes, no catch-all inbox, ceilings). Needs relaygate build 2 (sha256:84cb5e83 or later) for the proxies. Default-off in the agent-relay umbrella; ships no default digest. | | relaygate-0.1.0 | **planned** | relaygate 0.1.0 | relaygate: `ghcr.io/agentworkforce/relaygate@sha256:` | | | First registered chart, rendered only; default-off in the agent-relay umbrella (components.relaygate). Build 1 of the server (registration, mode check, /v1/check, classifier, audit); the Relaycast/Sessions proxy follows. Ships no default digest. | -| slack-relay-0.3.10 | unreleased | slack-relay 0.3.10 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.9. Behind relaygate each agent gets mcp__relay_agents (list_agents with paging and a name/persona filter, get_agent): read-only calls to relaygate GET /v1/agents and /v1/agents/:name with the agent's own rg_ token, so it sees every agent the policy shows it. Relaycast's agent.list and workspace tools, which need a workspace key no gated agent has, are refused. The system prompt says the agent sees all agents, messages only its own group, and never cites a workspace key. New host.relayAgentsMcp (RELAY_AGENTS_MCP, default true). Needs an image with src/agents-mcp.ts. Default-off in the agent-relay umbrella; ships no default digest. | +| slack-relay-0.3.11 | unreleased | slack-relay 0.3.11 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.10. The router adds a reaction (slack.ackReaction, SLACK_ACK_REACTION, default eyes; empty turns it off) to each message it routes to an agent (a mention, a reply in a thread it holds, an allowed DM) as soon as it takes it, fire-and-forget: routing never waits on it, already_reacted is ignored and failures log Slack's error code only. Needs the bot scope reactions:write (added to the manifest); without it the router logs once and stops trying until restarted. Existing installs add reactions:write, reinstall the Slack app and restart the router. Default renders gain the SLACK_ACK_REACTION env. Default-off in the agent-relay umbrella; ships no default digest. | +| slack-relay-0.3.10 | **planned** | slack-relay 0.3.10 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.9. Behind relaygate each agent gets mcp__relay_agents (list_agents with paging and a name/persona filter, get_agent): read-only calls to relaygate GET /v1/agents and /v1/agents/:name with the agent's own rg_ token, so it sees every agent the policy shows it. Relaycast's agent.list and workspace tools, which need a workspace key no gated agent has, are refused. The system prompt says the agent sees all agents, messages only its own group, and never cites a workspace key. New host.relayAgentsMcp (RELAY_AGENTS_MCP, default true). Needs an image with src/agents-mcp.ts. Default-off in the agent-relay umbrella; ships no default digest. | | slack-relay-0.3.9 | **planned** | slack-relay 0.3.9 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.8. sessions.mcp tools never drop items of a page to fit the output cap (the cursor points past all of them); only strings are cut, and a page that still does not fit asks for a smaller limit. An OAuth MCP server named sessions no longer replaces the built-in Sessions tools. Sessions carry user {id, name, email} from relay-control organization memberships (cached ten minutes) and list_sessions/search_sessions filter by person. Default renders differ only in the chart labels. Default-off in the agent-relay umbrella; ships no default digest. | | slack-relay-0.3.8 | **planned** | slack-relay 0.3.8 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.7. Behind relaygate the agent host answers a DM only after /v1/check allows the agent to write the exact answer to the sender's inbox (relaycast:inbox/); a denial, an unknown recipient or a gate error withholds it (logged as reply withheld: recipient outside group). The turn still runs and uploads, and the agent is told it can't answer outside-group senders. New host.replyToOutside (REPLY_TO_OUTSIDE, default false) only applies without relaygate. Default renders gain the REPLY_TO_OUTSIDE env. Default-off in the agent-relay umbrella; ships no default digest. | | slack-relay-0.3.7 | **planned** | slack-relay 0.3.7 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.6. Opt-in sessions.mcp: each agent gets read-only Sessions tools (mcp__sessions), every read sent to relaygate with the agent's own rg_ token so relaygate decides as the agent; the host mints the read credential as the uploader user and keeps it in a loopback proxy the agent never sees. Reuses sessions.upload's orgId, workspaceId, relayControlUrl and enrollment key. Needs an image with src/sessions-mcp.ts. Default renders differ only in the chart labels. Default-off in the agent-relay umbrella; ships no default digest. | @@ -1244,7 +1246,7 @@ chart `slack-relay` · values [`ci/default-values.yaml`](../charts/slack-relay/c | shipped | [Slack relay through relaygate](#opt-slack-relay-relaygate) | `direct`, `relaygate` | `direct` | values `relaygate.*`, `secrets.relaygateEnrollmentKey.*`; env `RELAYGATE_URL`, `RELAYGATE_ENROLLMENT_KEY`; Secret `` keys `enrollment-key` (only with relaygate.url) | | shipped | [Slack relay agent identity secret](#opt-slack-relay-agent-identity-secret) | `unset`, `set` | `unset` | values `secrets.agentIdentitySecret.*`; env `AGENT_IDENTITY_SECRET`; Secret `` keys `identity-secret` (optional) | | shipped | [Slack event delivery (Socket Mode or HTTP)](#opt-slack-relay-mode) | `socket`, `http` | `socket` | values `slack.mode`, `ingress.enabled`, `ingress.*`; env `SLACK_MODE` | -| shipped | [Slack channels, DMs and shared-channel refusal](#opt-slack-relay-channels) | `all invited channels`, `listed` | `all invited channels` | values `slack.allowedChannels`, `slack.allowDms`, `slack.refuseSharedChannels`; env `SLACK_ALLOWED_CHANNELS`, `SLACK_ALLOW_DMS`, `SLACK_REFUSE_SHARED_CHANNELS` | +| shipped | [Slack channels, DMs and shared-channel refusal](#opt-slack-relay-channels) | `all invited channels`, `listed` | `all invited channels` | values `slack.allowedChannels`, `slack.allowDms`, `slack.refuseSharedChannels`, `slack.ackReaction`; env `SLACK_ALLOWED_CHANNELS`, `SLACK_ALLOW_DMS`, `SLACK_REFUSE_SHARED_CHANNELS`, `SLACK_ACK_REACTION` | | shipped | [Slack relay orchestrator and routing](#opt-slack-relay-orchestrator) | `claude`, `deterministic` | `claude` | values `router.orchestrator`, `router.orchestratorModel`, `router.agentPrefix`, `router.allowAgentReuse`, `router.knownAgents`, `router.idleReleaseMinutes`, `router.resources`; env `ORCHESTRATOR`, `ORCHESTRATOR_MODEL`, `AGENT_PREFIX`, `ALLOW_AGENT_REUSE`, `KNOWN_AGENTS_JSON`, `IDLE_RELEASE_MINUTES` | | shipped | [Slack relay agent model, persona and tools](#opt-slack-relay-agents) | `workdir-scoped read tools`, `widened` | `workdir-scoped read tools` | values `host.agentName`, `host.agentModel`, `host.persona`, `host.allowedTools`, `host.disallowedTools`, `host.permissionMode`, `host.relaycastMcp`, `host.relayAgentsMcp`, `host.turnTimeoutSeconds`, `host.idleReleaseMinutes`, `host.replyToOutside`, `host.resources`; env `HOST_AGENT_NAME`, `AGENT_MODEL`, `AGENT_PERSONA`, `AGENT_ALLOWED_TOOLS`, `AGENT_DISALLOWED_TOOLS`, `AGENT_PERMISSION_MODE`, `RELAYCAST_MCP`, `RELAY_AGENTS_MCP`, `TURN_TIMEOUT_SECONDS`, `IDLE_RELEASE_MINUTES`, `REPLY_TO_OUTSIDE` | | shipped | [Slack relay read-only GitHub repositories](#opt-slack-relay-repos) | `false`, `listed`, `token selection` | `false` | values `repos.*`; env `GITHUB_TOKEN`, `REPOS_AUTH`, `GITHUB_APP_ID`, `GITHUB_APP_INSTALLATION_ID`, `GITHUB_APP_PRIVATE_KEY_FILE`, `REPOS_BASE_URL`, `REPOS_API_URL`, `REPOS_REFRESH_MINUTES`, `REPOS_LIST`; Secret `` keys `private-key`, `app-id`, `installation-id` (GitHub App mode (recommended); app-id and installation-id only when repos.app.appId / installationId are empty); Secret `` keys `token` (token mode, instead of repos.app) | @@ -4311,15 +4313,15 @@ socket (default) holds an outbound WebSocket to Slack and needs no inbound traff **Slack channels, DMs and shared-channel refusal** · shipped · chart `slack-relay` · profiles slack-relay -slack.allowedChannels lists the channel IDs (C...) the app answers in; empty answers in every channel the bot is invited to, so restrict it for a first rollout. slack.allowDms answers direct messages. slack.refuseSharedChannels (default on, fail closed) refuses channels shared outside the workspace for answers and ingest. +slack.allowedChannels lists the channel IDs (C...) the app answers in; empty answers in every channel the bot is invited to, so restrict it for a first rollout. slack.allowDms answers direct messages. slack.refuseSharedChannels (default on, fail closed) refuses channels shared outside the workspace for answers and ingest. slack.ackReaction (default eyes, empty turns it off) is the reaction the router adds to each message it routes, as soon as it takes it; it needs the bot scope reactions:write, and without it the router logs once and routes as before. - Default: `all invited channels` - Choices: `all invited channels`; `listed` - Provided by: operator -- Values: `slack.allowedChannels`, `slack.allowDms`, `slack.refuseSharedChannels` -- Env: `SLACK_ALLOWED_CHANNELS`, `SLACK_ALLOW_DMS`, `SLACK_REFUSE_SHARED_CHANNELS` +- Values: `slack.allowedChannels`, `slack.allowDms`, `slack.refuseSharedChannels`, `slack.ackReaction` +- Env: `SLACK_ALLOWED_CHANNELS`, `SLACK_ALLOW_DMS`, `SLACK_REFUSE_SHARED_CHANNELS`, `SLACK_ACK_REACTION` - Verify: a mention in a channel outside slack.allowedChannels gets no answer and the router logs nothing for it -- Sources: [`charts/slack-relay/values.yaml:41-48`](../charts/slack-relay/values.yaml#L41-L48), [`charts/slack-relay/templates/router.yaml:65-78`](../charts/slack-relay/templates/router.yaml#L65-L78) +- Sources: [`charts/slack-relay/values.yaml:89-104`](../charts/slack-relay/values.yaml#L89-L104), [`charts/slack-relay/templates/router.yaml:65-82`](../charts/slack-relay/templates/router.yaml#L65-L82) #### opt.slack-relay.orchestrator diff --git a/docs/self-hosted-slack-relay.md b/docs/self-hosted-slack-relay.md index 51a66d19..39ef2533 100644 --- a/docs/self-hosted-slack-relay.md +++ b/docs/self-hosted-slack-relay.md @@ -28,7 +28,7 @@ One message, end to end: | Piece | Kind | What it does | | --- | --- | --- | -| Router | Deployment, 1 replica, PVC | Holds the Slack connection. Records every message in the **ledger**: threads, the people in them, agents, and an append-only event log. Routes by ledger lookup and asks the orchestrator only about threads nobody owns yet. It is the only component with Slack credentials. | +| Router | Deployment, 1 replica, PVC | Holds the Slack connection. Records every message in the **ledger**: threads, the people in them, agents, and an append-only event log. Routes by ledger lookup and asks the orchestrator only about threads nobody owns yet. Each message it routes gets an :eyes: reaction as soon as the router takes it, before the agent starts (`slack.ackReaction`). It is the only component with Slack credentials. | | Orchestrator | in the router | Each Slack thread gets its own agent; that is enforced in code. A Claude model (default `claude-fable-5-2`) that sees every agent, its status, what it's working on and whose threads it holds, decides only whether a new thread goes to a pinned agent (`router.knownAgents`) instead. With no pinned agents it isn't called. `router.allowAgentReuse: true` lets it also hand a thread to an agent that already owns others. | | Agent host | StatefulSet, 1 replica, PVC | Runs the per-thread agents with headless Claude Code (default `claude-opus-5-5`). Each agent is its own relay identity with its own workdir and Claude session on the volume. It runs no process between messages: the host keeps only each agent's relay connection, like a node, and a routed Slack message or a direct message on the relay (from a person or another agent) wakes the agent and resumes its session. A DM is answered by DM; an agent's automatic answer to another agent's DM gets no reply back, so agents can't loop. Behind relaygate a DM from outside the pit gets no answer at all (see "Messages from outside the pit"). It has no Slack credentials. | @@ -74,11 +74,23 @@ never leave your control. Bot scopes the manifest requests: `app_mentions:read`, `channels:history`, `groups:history`, `im:history` (to read the threads it is in), `chat:write` -(to answer) and `channels:read` / `groups:read` (to refuse channels shared -outside the workspace). Events: `app_mention`, `message.channels`, `message.groups` and +(to answer), `reactions:write` (to put :eyes: on each message it routes, so +people see it was picked up) and `channels:read` / `groups:read` (to refuse +channels shared outside the workspace). Events: `app_mention`, `message.channels`, `message.groups` and `message.im`. The router ignores channel messages unless they mention the app or are in a thread it already holds. It ignores DMs unless `slack.allowDms` is -set. +set. Ignored messages get no reaction. + +**Existing installs:** an app created from an older manifest lacks +`reactions:write`. Add it under **OAuth & Permissions**, **Bot Token Scopes**, +then reinstall the app to the workspace (**Install App**, **Reinstall to +Workspace**); the bot token stays the same. Until then the router logs +`ack reaction off: the bot token lacks reactions:write (add reactions:write and +reinstall the app)` once, adds no reactions, and routes as before. Once it has +logged that, it stops trying until it restarts, so after the reinstall restart +the router, standalone or in the umbrella: +`kubectl -n agent-relay rollout restart deployment -l app.kubernetes.io/name=slack-relay,app.kubernetes.io/component=router`. +To turn the reaction off, set `slack.ackReaction: ""`. To receive events over HTTPS instead of Socket Mode, render the manifest with `--mode http --url https:///slack/events`. Then set `slack.mode: http`, @@ -721,6 +733,7 @@ See `charts/slack-relay/values.yaml`. The ones you're most likely to change: | --- | --- | --- | | `slack.allowedChannels` | `[]` (any channel the bot is in) | Channel IDs the app answers in. | | `slack.allowDms` | `false` | Answer DMs to the bot. | +| `slack.ackReaction` | `eyes` | Reaction added to each message the router routes, right away. Needs `reactions:write`. Empty turns it off. | | `router.orchestrator` | `claude` | `deterministic` to skip the model and start one agent per thread. | | `router.orchestratorModel` | `claude-fable-5-2` | | | `router.knownAgents` | `[]` | Pinned agents the orchestrator may route to, e.g. a company knowledge agent. | diff --git a/self-hosted/requirements.yaml b/self-hosted/requirements.yaml index 27b8ae99..7ab3c302 100644 --- a/self-hosted/requirements.yaml +++ b/self-hosted/requirements.yaml @@ -1788,9 +1788,22 @@ compatibility: images: relayauth: { repository: ghcr.io/agentworkforce/relayauth, digest: sha256:eb71daa28e30eb7305f666d0bccc5a4002e53e8a574e3c4c32163d907a1b71df } notes: superseded by 0.1.1. - - id: agent-relay-0.7.48 + - id: agent-relay-0.7.50 status: unreleased current: true + charts: { agent-relay: 0.7.50, relay-control: 0.4.22, relay-webapp: 0.2.7 } + app_versions: { agent-relay: 0.1.0, relay-control: 0.1.0, relay-webapp: 0.1.0 } + depends: + agent-relay: { relaycast: 0.3.16, relayauth: 0.1.5, sessions-pipeline: 0.8.43, relay-control: 0.4.22, relay-webapp: 0.2.7, relayflows: 0.2.5, durable-actors: 0.14.6-awf.4, relayfile: 0.2.2, telemetry-collector: 0.1.7, relay-chief: 0.1.0, slack-relay: 0.3.11, relaygate: 0.1.9 } + images: + relaycast: { repository: ghcr.io/agentworkforce/relaycast-self-host, digest: sha256:ec062ef901af15cf575b53a71d7eb09f2e6ab6e7c0d5be2da35339a275a5c6cc } + relaycast-postgres: { repository: ghcr.io/agentworkforce/relaycast-self-host, digest: sha256:ec062ef901af15cf575b53a71d7eb09f2e6ab6e7c0d5be2da35339a275a5c6cc } + sessions-pipeline-worker: { repository: ghcr.io/agentworkforce/sessions-pipeline, digest: sha256:77022c5b6a1d30f96f921d703eb27a1acada8ec273ad84aebdde24f8eddce305 } + relay-control: { repository: ghcr.io/agentworkforce/relay-control, digest: sha256:d1b6ca95fab240a9d41208d83de3b1f4245408b0765038762f1c419ee60f43bc } + relay-webapp: { repository: ghcr.io/agentworkforce/relay-webapp, digest: sha256:bd295ccb7d1323965dce890f19d0b7f857d706c00d7756f719c713763fdb49f3 } + notes: 'Carries 0.7.48 and slack-relay 0.3.11: the Slack router reacts :eyes: to each message it routes as soon as it takes it (slack.ackReaction, needs the bot scope reactions:write), still default-off (components.slackRelay). Default renders differ only in the helm.sh/chart labels.' + - id: agent-relay-0.7.48 + status: planned charts: { agent-relay: 0.7.48, relay-control: 0.4.22, relay-webapp: 0.2.7 } app_versions: { agent-relay: 0.1.0, relay-control: 0.1.0, relay-webapp: 0.1.0 } depends: @@ -3327,9 +3340,16 @@ compatibility: images: relaygate: { repository: ghcr.io/agentworkforce/relaygate, digest_required: true } notes: First registered chart, rendered only; default-off in the agent-relay umbrella (components.relaygate). Build 1 of the server (registration, mode check, /v1/check, classifier, audit); the Relaycast/Sessions proxy follows. Ships no default digest. - - id: slack-relay-0.3.10 + - id: slack-relay-0.3.11 status: unreleased current: true + charts: { slack-relay: 0.3.11 } + app_versions: { slack-relay: 0.1.0 } + images: + slack-relay: { repository: ghcr.io/agentworkforce/slack-relay, digest_required: true } + notes: 'Carries 0.3.10. The router adds a reaction (slack.ackReaction, SLACK_ACK_REACTION, default eyes; empty turns it off) to each message it routes to an agent (a mention, a reply in a thread it holds, an allowed DM) as soon as it takes it, fire-and-forget: routing never waits on it, already_reacted is ignored and failures log Slack''s error code only. Needs the bot scope reactions:write (added to the manifest); without it the router logs once and stops trying until restarted. Existing installs add reactions:write, reinstall the Slack app and restart the router. Default renders gain the SLACK_ACK_REACTION env. Default-off in the agent-relay umbrella; ships no default digest.' + - id: slack-relay-0.3.10 + status: planned charts: { slack-relay: 0.3.10 } app_versions: { slack-relay: 0.1.0 } images: @@ -7272,10 +7292,10 @@ entries: - id: opt.slack-relay.channels kind: option title: Slack channels, DMs and shared-channel refusal - description: slack.allowedChannels lists the channel IDs (C...) the app answers in; empty answers in every channel the bot is invited to, so restrict it for a first rollout. slack.allowDms answers direct messages. slack.refuseSharedChannels (default on, fail closed) refuses channels shared outside the workspace for answers and ingest. + description: slack.allowedChannels lists the channel IDs (C...) the app answers in; empty answers in every channel the bot is invited to, so restrict it for a first rollout. slack.allowDms answers direct messages. slack.refuseSharedChannels (default on, fail closed) refuses channels shared outside the workspace for answers and ingest. slack.ackReaction (default eyes, empty turns it off) is the reaction the router adds to each message it routes, as soon as it takes it; it needs the bot scope reactions:write, and without it the router logs once and routes as before. chart: slack-relay - values: [slack.allowedChannels, slack.allowDms, slack.refuseSharedChannels] - env: [SLACK_ALLOWED_CHANNELS, SLACK_ALLOW_DMS, SLACK_REFUSE_SHARED_CHANNELS] + values: [slack.allowedChannels, slack.allowDms, slack.refuseSharedChannels, slack.ackReaction] + env: [SLACK_ALLOWED_CHANNELS, SLACK_ALLOW_DMS, SLACK_REFUSE_SHARED_CHANNELS, SLACK_ACK_REACTION] profiles: [slack-relay] status: shipped provided_by: operator @@ -7285,8 +7305,8 @@ entries: - { value: listed } verify: a mention in a channel outside slack.allowedChannels gets no answer and the router logs nothing for it sources: - - "charts/slack-relay/values.yaml:41-48" - - "charts/slack-relay/templates/router.yaml:65-78" + - "charts/slack-relay/values.yaml:89-104" + - "charts/slack-relay/templates/router.yaml:65-82" - id: opt.slack-relay.orchestrator kind: option From de28ae3592cd2e40858eaeafd2c3c2907be9e40c Mon Sep 17 00:00:00 2001 From: Khaliq Date: Mon, 16 Nov 2026 17:58:25 -0800 Subject: [PATCH 2/2] docs(slack-relay): the reaction is requested, not guaranteed first; 0.3.11 needs the new image Co-Authored-By: Claude Opus 5.5 --- docs/self-hosted-requirements.md | 2 +- docs/self-hosted-slack-relay.md | 5 +++-- self-hosted/requirements.yaml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/self-hosted-requirements.md b/docs/self-hosted-requirements.md index 9a18e82b..727160f8 100644 --- a/docs/self-hosted-requirements.md +++ b/docs/self-hosted-requirements.md @@ -305,7 +305,7 @@ Services image (sessions-pipeline-worker, alleyoop and the privileged SQL Jobs): | relaygate-0.1.2 | **planned** | relaygate 0.1.2 | relaygate: `ghcr.io/agentworkforce/relaygate@sha256:` | | | Carries 0.1.1. The Sessions proxy forwards each caller's own Sessions credential, so secrets.sessionsToken is optional; adds proxy.sessionsUploadUrl, proxy.sessionsReadUrl and proxy.sessionsHosts (SESSIONS_UPLOAD_URL, SESSIONS_READ_URL, SESSIONS_HOSTS). Needs relaygate sha256:8c2adac4 (main 35c2a8f) or later for the passthrough and new settings. Ships no default digest. | | relaygate-0.1.1 | **planned** | relaygate 0.1.1 | relaygate: `ghcr.io/agentworkforce/relaygate@sha256:` | | | Build 2 support (opt-in Relaycast and Sessions proxies, sessionDefaults, admin explain) and policy defaults that follow relaygate examples/policy.pit.json (every stream 660 plus explicit ACLs, the Slack app channel pit-only, per-key name prefixes, no catch-all inbox, ceilings). Needs relaygate build 2 (sha256:84cb5e83 or later) for the proxies. Default-off in the agent-relay umbrella; ships no default digest. | | relaygate-0.1.0 | **planned** | relaygate 0.1.0 | relaygate: `ghcr.io/agentworkforce/relaygate@sha256:` | | | First registered chart, rendered only; default-off in the agent-relay umbrella (components.relaygate). Build 1 of the server (registration, mode check, /v1/check, classifier, audit); the Relaycast/Sessions proxy follows. Ships no default digest. | -| slack-relay-0.3.11 | unreleased | slack-relay 0.3.11 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.10. The router adds a reaction (slack.ackReaction, SLACK_ACK_REACTION, default eyes; empty turns it off) to each message it routes to an agent (a mention, a reply in a thread it holds, an allowed DM) as soon as it takes it, fire-and-forget: routing never waits on it, already_reacted is ignored and failures log Slack's error code only. Needs the bot scope reactions:write (added to the manifest); without it the router logs once and stops trying until restarted. Existing installs add reactions:write, reinstall the Slack app and restart the router. Default renders gain the SLACK_ACK_REACTION env. Default-off in the agent-relay umbrella; ships no default digest. | +| slack-relay-0.3.11 | unreleased | slack-relay 0.3.11 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.10. The router adds a reaction (slack.ackReaction, SLACK_ACK_REACTION, default eyes; empty turns it off) to each message it routes to an agent (a mention, a reply in a thread it holds, an allowed DM) as soon as it takes it, fire-and-forget: routing never waits on it, already_reacted is ignored and failures log Slack's error code only. Needs the bot scope reactions:write (added to the manifest); without it the router logs once and stops trying until restarted. Needs a slack-relay image built from this revision or later (the router code that sends the reaction); with an older image.digest the env is rendered but nothing reacts. Existing installs move to that image, add reactions:write, reinstall the Slack app and restart the router. Default renders gain the SLACK_ACK_REACTION env. Default-off in the agent-relay umbrella; ships no default digest. | | slack-relay-0.3.10 | **planned** | slack-relay 0.3.10 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.9. Behind relaygate each agent gets mcp__relay_agents (list_agents with paging and a name/persona filter, get_agent): read-only calls to relaygate GET /v1/agents and /v1/agents/:name with the agent's own rg_ token, so it sees every agent the policy shows it. Relaycast's agent.list and workspace tools, which need a workspace key no gated agent has, are refused. The system prompt says the agent sees all agents, messages only its own group, and never cites a workspace key. New host.relayAgentsMcp (RELAY_AGENTS_MCP, default true). Needs an image with src/agents-mcp.ts. Default-off in the agent-relay umbrella; ships no default digest. | | slack-relay-0.3.9 | **planned** | slack-relay 0.3.9 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.8. sessions.mcp tools never drop items of a page to fit the output cap (the cursor points past all of them); only strings are cut, and a page that still does not fit asks for a smaller limit. An OAuth MCP server named sessions no longer replaces the built-in Sessions tools. Sessions carry user {id, name, email} from relay-control organization memberships (cached ten minutes) and list_sessions/search_sessions filter by person. Default renders differ only in the chart labels. Default-off in the agent-relay umbrella; ships no default digest. | | slack-relay-0.3.8 | **planned** | slack-relay 0.3.8 | slack-relay: `ghcr.io/agentworkforce/slack-relay@sha256:` | | | Carries 0.3.7. Behind relaygate the agent host answers a DM only after /v1/check allows the agent to write the exact answer to the sender's inbox (relaycast:inbox/); a denial, an unknown recipient or a gate error withholds it (logged as reply withheld: recipient outside group). The turn still runs and uploads, and the agent is told it can't answer outside-group senders. New host.replyToOutside (REPLY_TO_OUTSIDE, default false) only applies without relaygate. Default renders gain the REPLY_TO_OUTSIDE env. Default-off in the agent-relay umbrella; ships no default digest. | diff --git a/docs/self-hosted-slack-relay.md b/docs/self-hosted-slack-relay.md index 39ef2533..4b985346 100644 --- a/docs/self-hosted-slack-relay.md +++ b/docs/self-hosted-slack-relay.md @@ -28,7 +28,7 @@ One message, end to end: | Piece | Kind | What it does | | --- | --- | --- | -| Router | Deployment, 1 replica, PVC | Holds the Slack connection. Records every message in the **ledger**: threads, the people in them, agents, and an append-only event log. Routes by ledger lookup and asks the orchestrator only about threads nobody owns yet. Each message it routes gets an :eyes: reaction as soon as the router takes it, before the agent starts (`slack.ackReaction`). It is the only component with Slack credentials. | +| Router | Deployment, 1 replica, PVC | Holds the Slack connection. Records every message in the **ledger**: threads, the people in them, agents, and an append-only event log. Routes by ledger lookup and asks the orchestrator only about threads nobody owns yet. For each message it routes it sends an :eyes: reaction request as soon as it takes the message, before routing, and does not wait for it, so the reaction usually shows before the agent starts but can land later or fail without affecting the answer (`slack.ackReaction`). It is the only component with Slack credentials. | | Orchestrator | in the router | Each Slack thread gets its own agent; that is enforced in code. A Claude model (default `claude-fable-5-2`) that sees every agent, its status, what it's working on and whose threads it holds, decides only whether a new thread goes to a pinned agent (`router.knownAgents`) instead. With no pinned agents it isn't called. `router.allowAgentReuse: true` lets it also hand a thread to an agent that already owns others. | | Agent host | StatefulSet, 1 replica, PVC | Runs the per-thread agents with headless Claude Code (default `claude-opus-5-5`). Each agent is its own relay identity with its own workdir and Claude session on the volume. It runs no process between messages: the host keeps only each agent's relay connection, like a node, and a routed Slack message or a direct message on the relay (from a person or another agent) wakes the agent and resumes its session. A DM is answered by DM; an agent's automatic answer to another agent's DM gets no reply back, so agents can't loop. Behind relaygate a DM from outside the pit gets no answer at all (see "Messages from outside the pit"). It has no Slack credentials. | @@ -81,7 +81,8 @@ channels shared outside the workspace). Events: `app_mention`, `message.channels or are in a thread it already holds. It ignores DMs unless `slack.allowDms` is set. Ignored messages get no reaction. -**Existing installs:** an app created from an older manifest lacks +**Existing installs:** the reaction needs a slack-relay image from chart 0.3.11 +or later. An app created from an older manifest also lacks `reactions:write`. Add it under **OAuth & Permissions**, **Bot Token Scopes**, then reinstall the app to the workspace (**Install App**, **Reinstall to Workspace**); the bot token stays the same. Until then the router logs diff --git a/self-hosted/requirements.yaml b/self-hosted/requirements.yaml index 92347e10..91627e1c 100644 --- a/self-hosted/requirements.yaml +++ b/self-hosted/requirements.yaml @@ -3388,7 +3388,7 @@ compatibility: app_versions: { slack-relay: 0.1.0 } images: slack-relay: { repository: ghcr.io/agentworkforce/slack-relay, digest_required: true } - notes: 'Carries 0.3.10. The router adds a reaction (slack.ackReaction, SLACK_ACK_REACTION, default eyes; empty turns it off) to each message it routes to an agent (a mention, a reply in a thread it holds, an allowed DM) as soon as it takes it, fire-and-forget: routing never waits on it, already_reacted is ignored and failures log Slack''s error code only. Needs the bot scope reactions:write (added to the manifest); without it the router logs once and stops trying until restarted. Existing installs add reactions:write, reinstall the Slack app and restart the router. Default renders gain the SLACK_ACK_REACTION env. Default-off in the agent-relay umbrella; ships no default digest.' + notes: 'Carries 0.3.10. The router adds a reaction (slack.ackReaction, SLACK_ACK_REACTION, default eyes; empty turns it off) to each message it routes to an agent (a mention, a reply in a thread it holds, an allowed DM) as soon as it takes it, fire-and-forget: routing never waits on it, already_reacted is ignored and failures log Slack''s error code only. Needs the bot scope reactions:write (added to the manifest); without it the router logs once and stops trying until restarted. Needs a slack-relay image built from this revision or later (the router code that sends the reaction); with an older image.digest the env is rendered but nothing reacts. Existing installs move to that image, add reactions:write, reinstall the Slack app and restart the router. Default renders gain the SLACK_ACK_REACTION env. Default-off in the agent-relay umbrella; ships no default digest.' - id: slack-relay-0.3.10 status: planned charts: { slack-relay: 0.3.10 }