Slack: remove ids from prompts + thread-safe tool suppression
This commit is contained in:
parent
f55bf604e4
commit
246216b1f8
@ -16,7 +16,7 @@ Use `slack` to react, manage pins, send/edit/delete messages, and fetch member i
|
||||
- For reactions, an `emoji` (Unicode or `:name:`).
|
||||
- For message sends, a `to` target (`channel:<id>` or `user:<id>`) and `content`.
|
||||
|
||||
Message context lines include `slack message id` and `channel` fields you can reuse directly.
|
||||
Message text no longer includes `slack message id`. Use metadata fields like `MessageSid` or `ReplyToId`.
|
||||
|
||||
## Actions
|
||||
|
||||
|
||||
@ -241,6 +241,7 @@ export function createFollowupRunner(params: {
|
||||
messageProvider: queued.run.messageProvider,
|
||||
messagingToolSentTargets: runResult.messagingToolSentTargets,
|
||||
originatingTo: queued.originatingTo,
|
||||
originatingThreadId: queued.originatingThreadId,
|
||||
accountId: queued.run.agentAccountId,
|
||||
});
|
||||
const finalPayloads = suppressMessagingToolReplies ? [] : dedupedPayloads;
|
||||
|
||||
@ -398,7 +398,6 @@ export async function prepareSlackMessage(params: {
|
||||
GroupSubject: isRoomish ? roomLabel : undefined,
|
||||
From: slackFrom,
|
||||
}) ?? (isDirectMessage ? senderName : roomLabel);
|
||||
const textWithId = `${rawBody}\n[slack message id: ${message.ts} channel: ${message.channel}]`;
|
||||
const storePath = resolveStorePath(ctx.cfg.session?.store, {
|
||||
agentId: route.agentId,
|
||||
});
|
||||
@ -411,7 +410,7 @@ export async function prepareSlackMessage(params: {
|
||||
channel: "Slack",
|
||||
from: envelopeFrom,
|
||||
timestamp: message.ts ? Math.round(Number(message.ts) * 1000) : undefined,
|
||||
body: textWithId,
|
||||
body: rawBody,
|
||||
chatType: isDirectMessage ? "direct" : "channel",
|
||||
sender: { name: senderName, id: senderId },
|
||||
previousTimestamp,
|
||||
@ -430,9 +429,7 @@ export async function prepareSlackMessage(params: {
|
||||
channel: "Slack",
|
||||
from: roomLabel,
|
||||
timestamp: entry.timestamp,
|
||||
body: `${entry.body}${
|
||||
entry.messageId ? ` [id:${entry.messageId} channel:${message.channel}]` : ""
|
||||
}`,
|
||||
body: entry.body,
|
||||
chatType: "channel",
|
||||
senderLabel: entry.sender,
|
||||
envelope: envelopeOptions,
|
||||
@ -466,12 +463,11 @@ export async function prepareSlackMessage(params: {
|
||||
if (starter?.text) {
|
||||
const starterUser = starter.userId ? await ctx.resolveUserName(starter.userId) : null;
|
||||
const starterName = starterUser?.name ?? starter.userId ?? "Unknown";
|
||||
const starterWithId = `${starter.text}\n[slack message id: ${starter.ts ?? threadTs} channel: ${message.channel}]`;
|
||||
threadStarterBody = formatThreadStarterEnvelope({
|
||||
channel: "Slack",
|
||||
author: starterName,
|
||||
timestamp: starter.ts ? Math.round(Number(starter.ts) * 1000) : undefined,
|
||||
body: starterWithId,
|
||||
body: starter.text,
|
||||
envelope: envelopeOptions,
|
||||
});
|
||||
const snippet = starter.text.replace(/\s+/g, " ").slice(0, 80);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user