Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.
Python agent-orchestrationaiai-agentschatopsdiscordlangchainmcpmicrosoft-teamsmulti-agentopen-sourceopenaiself-hostedslack
Describe follow-ups consistently in the agent instructions, and expose the flag in the chart (#982)
Abel Dantas91cad27a7755
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 7abb8b285..5c97cdf3a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -44,6 +44,17 @@ version of their own to them without also giving them a release of their own.### [Unreleased]+#### Changed+- **Following the conversation is described the same way everywhere, and the+ chart can turn it on.** The feature added in 0.31.0 is off unless+ `follow_the_conversation` is among the enabled feature flags+ (`FEATURE_FLAGS_ENABLED`, or `switchCore.featureFlags.enabled` in the Helm+ chart). The Switch skill and the agent runtime's instructions no longer tell+ agents that a message without their name can never reach them: a person's+ follow-up can, while other agents' chatter still does not. The chart lists+ the flag and, while it is on, sets `FOLLOW_THE_CONVERSATION_WINDOW_SECONDS`+ from `switchCore.followTheConversation.windowSeconds` (default 300).+#### Fixed- **The template guide agents read now covers a room's `roles:`,`references:` and `docs:`.** All three already worked in a room resourcediff --git a/console/packages/plugins/src/switch-skill/SKILL.md b/console/packages/plugins/src/switch-skill/SKILL.mdindex 0a3ea94ff..3db588e31 100644--- a/console/packages/plugins/src/switch-skill/SKILL.md+++ b/console/packages/plugins/src/switch-skill/SKILL.md@@ -123,9 +123,14 @@ does, and there is no polling tool to call.Where a server has "follow the conversation" switched on, a person's messagecan reach you without naming you: a reply in a thread where you spoke, or- were tagged, more recently than any other agent; their next message after- you have just answered them in the channel; or- any message in a room where you are the assigned agent. Treat it as meant+ were tagged, more recently than any other agent; their next channel message+ in an exchange with you that nobody else has interrupted, as long as every+ gap in it (their request to your answer, your answer to this message) is+ within the server's window, five minutes by default (after a break they+ need to mention you again); or any message in a room where you are the+ assigned agent. Only a person's text message that @-mentions+ nobody can arrive this way (an email address is not a mention); another+ agent's message never does. Treat it as meantfor you, but if it is clearly people talking to each other, stay quietrather than reply. People control this from the room: `!assign-agent @name`sends every message to one agent and `!unassign-agent` stops it;@@ -138,9 +143,9 @@ does, and there is no polling tool to call.`list_participants`. Your own join never produces one. When you do get one,react if it is relevant — greet the arrival and explain the room.-**Not delivered:** unaddressed room chatter — other agents talking to each-other, broadcast updates, the user thinking out loud without `@`-mentioning-you. It is filtered out and you will never see it in a delivered line. Pulling+**Not delivered:** the rest of the room's chatter, such as other agents+talking to each other, broadcast updates, or a person thinking out loud+without `@`-mentioning you, unless it is one of the follow-ups above. Pullingit is what `read_context` is for.Two annotations tell you when that matters:@@ -149,7 +154,8 @@ Two annotations tell you when that matters:messages arrived since you last read this room's context — call read_contextto catch up.)`. Switch keeps that count per room, so reading one room'scontext clears that room's and leaves every other room standing at its own.- Read what a silent line does and does not prove, below.+ It counts only what was not delivered to you, so a follow-up you were sent+ is not in it. Read what a silent line does and does not prove, below.- **Lost history** — when the server restarted or events aged out, theaffected room's count says so rather than quietly shrinking. The line reads`At least N … and there may have been more`, which is a floor, or says how@@ -327,8 +333,9 @@ session details; use the Switch messaging tools for explicit room replies.**When a message you receive carries a `thread_id`, reply with that same`thread_id`** so the conversation stays in its thread.- Threads bridge to and from Mattermost natively, and to Telegram forum- topics. You are only delivered threaded replies that address you; pull the- rest with `read_context`.+ topics. You are delivered threaded replies that address you, and the+ follow-ups in a thread you own where the server follows the conversation+ (see "Receiving room events"); pull the rest with `read_context`.- **Mattermost only — post at the root unless you were asked in a thread.**Mattermost shows a threaded reply as a reply count under the original postrather than in the channel, so the people waiting on you may never see it.diff --git a/console/packages/switch-agent-runtime/src/hosted.ts b/console/packages/switch-agent-runtime/src/hosted.tsindex 83ec62a32..2d10dad02 100644--- a/console/packages/switch-agent-runtime/src/hosted.ts+++ b/console/packages/switch-agent-runtime/src/hosted.ts@@ -78,7 +78,7 @@ export function runtimeInstructions(): string {const RUNTIME_LINES = ['Events from Switch rooms arrive as `[Switch] …` lines delivered into this session by the process that runs it, each naming the room, the sender and the message id.',- 'Only addressed messages and room_join events are delivered — unaddressed room chatter is filtered out.',+ "Addressed messages and room_join events are delivered. Where the server follows the conversation, so is a person's follow-up that names nobody: a reply in a thread you own, their next channel message in an exchange with you that nobody else interrupted and whose gaps (their request to your answer, your answer to this message) are all within the server's window (after a break they need to mention you again), or any message in a room where you are the assigned agent. Another agent's message reaches you only when it addresses you. The rest of the room's chatter is not delivered; read_context is how you see it.",'','A room_join event (`[Switch] <name> joined room <room>`) fires when a user or agent joins a room — but you are only told for rooms where you are configured to receive join events (per-room, per-agent; off by default, set via the join_event_listeners option on create_room / update_room or the gateway). React if it is relevant — e.g. a welcome agent greets the new arrival and explains the room via post_message, or send_targeted_message to address them directly. Your own join does not produce a room_join event.','',diff --git a/deploy/remote/helm/switch/README.md b/deploy/remote/helm/switch/README.mdindex b0b1c377a..f5f60d1db 100644--- a/deploy/remote/helm/switch/README.md+++ b/deploy/remote/helm/switch/README.md@@ -217,6 +217,28 @@ those services is refused with the reason. Switch Console asks the server andstops drawing them for its agents. An icon an owner set on any other host isunaffected.+## Follow the conversation++Off by default. With the `follow_the_conversation` feature flag on, a person's+message that names nobody can still reach an agent: a reply in a thread the+agent owns, their next channel message in an exchange with the agent that+nobody else interrupted, or any message in a room whose assigned agent it is.+People turn the follow-ups off per room with `!follow-ups off`.++```yaml+switchCore:+ featureFlags:+ enabled: ["follow_the_conversation"]+ followTheConversation:+ windowSeconds: 300+```++The chart sets `FOLLOW_THE_CONVERSATION_WINDOW_SECONDS` from `windowSeconds`+only while the flag is on (1 to 3600 seconds). A channel exchange counts only+while every gap in it, from a person's request to the agent's answer and from+that answer to their next message, is within the window; after a break, people+mention the agent again.+## Agent managementManaged agents, and the agent controllers that run them on users' machines, arediff --git a/deploy/remote/helm/switch/templates/_helpers.tpl b/deploy/remote/helm/switch/templates/_helpers.tplindex 0a82cc7b9..e83adb562 100644--- a/deploy/remote/helm/switch/templates/_helpers.tpl+++ b/deploy/remote/helm/switch/templates/_helpers.tpl@@ -837,6 +837,10 @@ this one. Drop it once the oldest supported image reads ID_SERVER_NAME. */}}- name: FEATURE_FLAGS_ENABLEDvalue: {{ join "," . | quote }}{{- end }}+{{- if has "follow_the_conversation" .Values.switchCore.featureFlags.enabled }}+- name: FOLLOW_THE_CONVERSATION_WINDOW_SECONDS+ value: {{ .Values.switchCore.followTheConversation.windowSeconds | quote }}+{{- end }}{{- if not (or .Values.gateway.enabled .Values.switchCore.serveDashboard) }}{{- fail "gateway.enabled and switchCore.serveDashboard are both off, so nothing serves the operator dashboard. Turn one of them on." }}{{- end }}diff --git a/deploy/remote/helm/switch/values.yaml b/deploy/remote/helm/switch/values.yamlindex e0ec90261..64ec55928 100644--- a/deploy/remote/helm/switch/values.yaml+++ b/deploy/remote/helm/switch/values.yaml@@ -389,6 +389,17 @@ switchCore:# How often a controller must report; one silent for three of these is# shown as unknown and gets no new placements.statusIntervalSeconds: 60+ # Follow the conversation: a person's message that names nobody can reach the+ # agent they are talking to (a thread it owns, their next message in a+ # channel exchange with it that nobody interrupted, a room's assigned agent).+ # Turned on by the "follow_the_conversation" feature flag+ # (featureFlags.enabled below).+ followTheConversation:+ # A channel exchange counts only while every gap in it (request to answer,+ # answer to the next message) is within this many seconds; after a break,+ # people mention the agent again. FOLLOW_THE_CONVERSATION_WINDOW_SECONDS,+ # 1 to 3600.+ windowSeconds: 300# The agents controller release switch-core tells every controller to run# (CONTROLLER_RELEASE_VERSION / _URL / _SHA256), except Switch Console's own,# which updates with Console. A controller that runs@@ -416,7 +427,8 @@ switchCore:# ["ecosystem.show_owners"]. Every other flag is off, and no one can change# them while the server runs. An unknown flag stops switch-core at startup.# Known flags: ecosystem.show_owners, agent_management, switch_cloud,- # hosted_agents, service_connections, agent_chats.+ # hosted_agents, service_connections, agent_chats, follow_the_conversation,+ # switch_buddy.featureFlags:enabled: []# Invitation e-mails. When enabled, an invitation addressed to an e-mail isdiff --git a/switch-expert/knowledge/GOTCHAS.md b/switch-expert/knowledge/GOTCHAS.mdindex 5e6e779ef..e771cceb1 100644--- a/switch-expert/knowledge/GOTCHAS.md+++ b/switch-expert/knowledge/GOTCHAS.md@@ -13,7 +13,14 @@ check, and log a correction.**It probably never heard you.** Agents are told about messages that address them. Generalchatter in the channel is not pushed to them — it is there to be read, but nothing wakes-them for it. If you want an answer, mention the agent by name.+them for it. If you want an answer, mention the agent by name. On a server with the+`follow_the_conversation` feature flag on, a reply in a thread the agent owns, your next+channel message in an exchange with it that nobody else interrupted, or any message in a+room where it is the assigned agent (`!assign-agent`) reaches it too, as long as the+message @-mentions nobody (an email address does not count as a mention). The channel+exchange counts only while every gap in it (your request to its answer, its answer to your+next message) is within the server's window, 5 minutes by default; after a break, mention+the agent again.**Or nothing is running it.** Switch is where an agent participates, not what runs it. Ifthe machine is asleep, the session is dead, or the app is closed, the agent is simply not