Skip to content

The open-source app everyone uses to manage agents at work

fix(slack): require result and review updates in conversation prompts (#15611)

Dotta43212cb2b72a
diff --git a/server/src/__tests__/heartbeat-context-summary.test.ts b/server/src/__tests__/heartbeat-context-summary.test.ts
index 70930db8cf..67bdca4107 100644
--- a/server/src/__tests__/heartbeat-context-summary.test.ts
+++ b/server/src/__tests__/heartbeat-context-summary.test.ts
@@ -301,6 +301,11 @@ describe("buildPaperclipTaskMarkdown", () => {
externalChatProvider: "slack", nativeRunner, includeDescription,
});
expect(markdown).toContain("Interactive questions in Slack:");
+ expect(markdown).toContain("When you have results, update the user in the originating Slack");
+ expect(markdown).toContain("When the user needs to review a plan, approve an action, or review a result");
+ expect(markdown).toContain("create the required human-input or approval interaction before you yield");
+ expect(markdown).toContain("Saving a plan or setting a task to in_review alone does not ask the user to review it");
+ expect(markdown).toContain("do not continue gated work until the required approval is recorded");
expect(markdown).toContain("ask_user_questions");
expect(markdown).toContain("single_select");
expect(markdown).toContain("resumes this task after the answer");
diff --git a/server/src/services/chat-communication-guidance.test.ts b/server/src/services/chat-communication-guidance.test.ts
index 44b568d259..a1f7736976 100644
--- a/server/src/services/chat-communication-guidance.test.ts
+++ b/server/src/services/chat-communication-guidance.test.ts
@@ -3,6 +3,15 @@ import { CHAT_PROVIDERS, updateChatEndpointSchema } from "@paperclipai/shared";
import { buildChatCommunicationGuidance } from "./chat-communication-guidance.js";
describe("initial medium communication guidance", () => {
+ it.each([true, false])("requires result and review updates in Slack (direct=%s)", (isDirectMessage) => {
+ const guidance = buildChatCommunicationGuidance({ provider: "slack", isDirectMessage });
+ expect(guidance).toContain("When you have results, update the user in the originating Slack");
+ expect(guidance).toContain("Put this update in your final response");
+ expect(guidance).toContain("When the user needs to review a plan, approve an action, or review a result");
+ expect(guidance).toContain("create the required human-input or approval interaction before you yield");
+ expect(guidance).toContain("do not continue gated work until the required approval is recorded");
+ });
+
it("guides Slack presentation while retaining ordinary agent tools and explicit output requests", () => {
const guidance = buildChatCommunicationGuidance({ provider: "slack", isDirectMessage: false, communicationInstructions: "Use customer-facing names." });
expect(guidance).toContain("shared channel thread");
diff --git a/server/src/services/chat-communication-guidance.ts b/server/src/services/chat-communication-guidance.ts
index f96a5ee010..c76fcf9500 100644
--- a/server/src/services/chat-communication-guidance.ts
+++ b/server/src/services/chat-communication-guidance.ts
@@ -1,10 +1,12 @@
import type { ChatProvider } from "@paperclipai/shared";
+import { slackTaskUpdateGuidance } from "./connectors/slack/task-update-guidance.js";
// Presentation guidance only. Task execution and permissions belong to the
// ordinary Paperclip agent runtime, not the provider transport.
const providerGuidance: Partial<Record<ChatProvider, string>> = {
slack: [
"This task began in Slack. Write replies for the person talking with you there.",
+ ...slackTaskUpdateGuidance,
"Lead with the answer or outcome. Use compact paragraphs or short lists, and omit routine execution bookkeeping. Honor requests for more detail or exact output over default brevity.",
"Put small answers directly in the message. For substantial plans, reports, and other deliverables, use your normal document or artifact tools, then share a useful summary and accessible links or supported attachments in Slack. Follow the runtime's file-delivery contract and do not claim delivery until confirmed.",
"Ask useful questions through the existing human-input tools. Continue normal Paperclip planning, task creation, assignment, delegation, and approval workflows; these communication instructions grant no additional authority.",
diff --git a/server/src/services/connectors/slack/agent-guidance.ts b/server/src/services/connectors/slack/agent-guidance.ts
index bf1c5fb2e1..7ab63ad213 100644
--- a/server/src/services/connectors/slack/agent-guidance.ts
+++ b/server/src/services/connectors/slack/agent-guidance.ts
@@ -1,4 +1,5 @@
import { slackAppConfigurationSchema } from "@paperclipai/shared";
+import { slackTaskUpdateGuidance } from "./task-update-guidance.js";
// Per-turn routing guidance, including resumed CLI sessions. This describes
// existing capabilities; it never grants tools or overrides action policies.
@@ -7,6 +8,7 @@ export function slackChatAgentGuidance(nativeRunner: boolean, savedCommand?: str
return [
"",
"Slack replies and actions:",
+ ...slackTaskUpdateGuidance,
"Paperclip delivers your final response to the originating Slack conversation. Use assigned Slack action tools for an explicitly requested post, edit, reaction, pin, bookmark, canvas, list, or channel operation. Do not post a second copy of your ordinary reply with slack_post_message.",
"For a requested file in this conversation, follow the external-chat file-delivery contract below. slack_upload_file is for explicitly uploading an existing Paperclip attachment to another allowed destination. Neither queued nor uncertain means delivered; retain the original operation key and inspect its receipt instead of starting the write again.",
"Use only the tools assigned to this run and honor their action policies. Missing tools or Slack permissions are a capability limitation; never ask for a bot token or use another bot to work around it.",
diff --git a/server/src/services/connectors/slack/task-update-guidance.ts b/server/src/services/connectors/slack/task-update-guidance.ts
new file mode 100644
index 0000000000..5c51f67101
--- /dev/null
+++ b/server/src/services/connectors/slack/task-update-guidance.ts
@@ -0,0 +1,5 @@
+// Shared by initial conversation guidance and every later Slack turn.
+export const slackTaskUpdateGuidance = [
+ "When you have results, update the user in the originating Slack channel thread or direct conversation. Include the outcome and accessible links or supported attachments. Do not leave results only in a Paperclip task, document, or work product. Put this update in your final response so Paperclip can deliver it; do not send a duplicate with slack_post_message.",
+ "When the user needs to review a plan, approve an action, or review a result, notify them in the same Slack conversation. State what needs review, include the saved review link when available, and explain the action they must take. Follow the normal workflow to save the artifact and create the required human-input or approval interaction before you yield. Saving a plan or setting a task to in_review alone does not ask the user to review it. Do not claim notification or delivery without a successful receipt, and do not continue gated work until the required approval is recorded.",
+];
diff --git a/skills/slack/SKILL.md b/skills/slack/SKILL.md
index 9bffa57ef0..63c5ca173a 100644
--- a/skills/slack/SKILL.md
+++ b/skills/slack/SKILL.md
@@ -80,3 +80,13 @@ On a Slack-linked task, human messages sent from Paperclip and your final respon
are mirrored into its Slack thread. Do not manually send the same final response
again. Ordinary tasks and routines have no automatic Slack destination: perform the
requested Slack send explicitly and report whether delivery was confirmed.
+
+On a Slack-linked task, when results are ready, include the outcome and accessible
+deliverable links or supported attachments in your final response to the originating
+Slack conversation.
+Do not leave the result only on the Paperclip task. When the user must review a
+plan, approve an action, or review a result, save the artifact and create the
+required review interaction through the normal Paperclip workflow. Tell the user
+what needs review and what action to take in the same Slack conversation. A saved
+plan or an `in_review` status alone is not a review request. Keep approval gates
+in place and do not claim delivery without a successful receipt.