fix(slack): mrkdwn + thread edge cases (#464) (thanks @austinm911)

This commit is contained in:
Peter Steinberger
2026-01-09 22:09:02 +01:00
parent 8890fbcf38
commit 84046cbad8
8 changed files with 222 additions and 49 deletions

View File

@@ -152,6 +152,19 @@ export async function handleSlackAction(
mediaUrl: mediaUrl ?? undefined,
threadTs: threadTs ?? undefined,
});
// Keep "first" mode consistent even when the agent explicitly provided
// threadTs: once we send a message to the current channel, consider the
// first reply "used" so later tool calls don't auto-thread again.
if (context?.hasRepliedRef && context.currentChannelId) {
const normalizedTarget = to.startsWith("channel:")
? to.slice("channel:".length)
: to;
if (normalizedTarget === context.currentChannelId) {
context.hasRepliedRef.value = true;
}
}
return jsonResult({ ok: true, result });
}
case "editMessage": {