From 755e840b8c8aca964493a20666779d4fbd9d9e0c Mon Sep 17 00:00:00 2001 From: Vojta Bartos Date: Tue, 16 Jun 2026 10:16:56 +0200 Subject: [PATCH 1/3] feat(slack): nudge users toward opening a PR for code-fixable issues --- packages/agent/src/server/agent-server.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/agent/src/server/agent-server.ts b/packages/agent/src/server/agent-server.ts index 0492b9fd06..e0c701d0e4 100644 --- a/packages/agent/src/server/agent-server.ts +++ b/packages/agent/src/server/agent-server.ts @@ -1732,6 +1732,9 @@ You are replying in a Slack thread. Slack readers want short, skimmable answers # Mentioning users When you want to ping a Slack user in your reply, copy their \`<@U…|displayname>\` token verbatim from the message context — Slack renders that as a real mention. Writing \`@displayname\` as plain text does NOT ping them. + +# Suggesting code changes +You can also open pull requests directly from this Slack thread. When the user's question describes a problem with a plausible code-side fix — a bug visible in errors or logs, missing or broken instrumentation, a broken funnel step traceable to UI code, a stale config that lives in a repo — end your reply with a one-sentence offer to open a PR for the fix and ask if they want you to proceed. Skip the offer for pure data lookups with no actionable code change (e.g. "what was DAU yesterday?"), and skip it when the fix would clearly live outside any repo you can reach. ` : ""; const signedCommitInstructions = ` From b9cb6a16af7c7bd77a028cdcd3e5af9612ff41c4 Mon Sep 17 00:00:00 2001 From: Vojta Bartos Date: Wed, 17 Jun 2026 09:53:42 +0200 Subject: [PATCH 2/3] feat(slack): forbid fabricating mention tokens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tighten the Slack-origin system prompt rule on user mentions: require that the `<@U…|displayname>` token come from the thread context verbatim, and explicitly forbid substituting the display name (or any other string) for the `U…` ID. Falls back to plain text when no labeled token exists. Follow-up to #2676: the agent learned the token's shape but invented the user ID — observed in a Slack reply rendering `<@Paul|Paul D'Ambra>`, which Slack doesn't ping. --- packages/agent/src/server/agent-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/agent/src/server/agent-server.ts b/packages/agent/src/server/agent-server.ts index e0c701d0e4..1d7f1da433 100644 --- a/packages/agent/src/server/agent-server.ts +++ b/packages/agent/src/server/agent-server.ts @@ -1731,7 +1731,7 @@ You are replying in a Slack thread. Slack readers want short, skimmable answers - This is a default, not a hard rule. If the user (or their saved memory) asks for more depth or a specific format, follow that instead. # Mentioning users -When you want to ping a Slack user in your reply, copy their \`<@U…|displayname>\` token verbatim from the message context — Slack renders that as a real mention. Writing \`@displayname\` as plain text does NOT ping them. +To ping a Slack user, reuse a \`<@U…|displayname>\` token that already appears in the message context — copy it verbatim, including the \`U…\` ID. Do NOT construct a mention token from a name, and do NOT substitute the display name (or any other string) for the \`U…\` ID — \`<@Paul|Paul D'Ambra>\` is not a valid mention; only the form with the real ID like \`<@U02DXFTVDNE|Paul D'Ambra>\` is. If the person you want to refer to has no \`<@U…|displayname>\` token anywhere in the thread context, write their name as plain text instead of inventing one. # Suggesting code changes You can also open pull requests directly from this Slack thread. When the user's question describes a problem with a plausible code-side fix — a bug visible in errors or logs, missing or broken instrumentation, a broken funnel step traceable to UI code, a stale config that lives in a repo — end your reply with a one-sentence offer to open a PR for the fix and ask if they want you to proceed. Skip the offer for pure data lookups with no actionable code change (e.g. "what was DAU yesterday?"), and skip it when the fix would clearly live outside any repo you can reach. From 98a48029b75f0ebb8033bf292e9786041b2be5ee Mon Sep 17 00:00:00 2001 From: Vojta Bartos Date: Wed, 17 Jun 2026 14:24:08 +0200 Subject: [PATCH 3/3] chore(slack): swap real name in mention prompt example for a placeholder --- packages/agent/src/server/agent-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/agent/src/server/agent-server.ts b/packages/agent/src/server/agent-server.ts index 1d7f1da433..4ba0e2e47d 100644 --- a/packages/agent/src/server/agent-server.ts +++ b/packages/agent/src/server/agent-server.ts @@ -1731,7 +1731,7 @@ You are replying in a Slack thread. Slack readers want short, skimmable answers - This is a default, not a hard rule. If the user (or their saved memory) asks for more depth or a specific format, follow that instead. # Mentioning users -To ping a Slack user, reuse a \`<@U…|displayname>\` token that already appears in the message context — copy it verbatim, including the \`U…\` ID. Do NOT construct a mention token from a name, and do NOT substitute the display name (or any other string) for the \`U…\` ID — \`<@Paul|Paul D'Ambra>\` is not a valid mention; only the form with the real ID like \`<@U02DXFTVDNE|Paul D'Ambra>\` is. If the person you want to refer to has no \`<@U…|displayname>\` token anywhere in the thread context, write their name as plain text instead of inventing one. +To ping a Slack user, reuse a \`<@U…|displayname>\` token that already appears in the message context — copy it verbatim, including the \`U…\` ID. Do NOT construct a mention token from a name, and do NOT substitute the display name (or any other string) for the \`U…\` ID — \`<@Jane|Jane Doe>\` is not a valid mention; only the form with the real ID like \`<@U01ABCDEF23|Jane Doe>\` is. If the person you want to refer to has no \`<@U…|displayname>\` token anywhere in the thread context, write their name as plain text instead of inventing one. # Suggesting code changes You can also open pull requests directly from this Slack thread. When the user's question describes a problem with a plausible code-side fix — a bug visible in errors or logs, missing or broken instrumentation, a broken funnel step traceable to UI code, a stale config that lives in a repo — end your reply with a one-sentence offer to open a PR for the fix and ask if they want you to proceed. Skip the offer for pure data lookups with no actionable code change (e.g. "what was DAU yesterday?"), and skip it when the fix would clearly live outside any repo you can reach.