mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-21 21:03:56 +00:00
mom: fix [SILENT] to delete thread messages too
Track all thread message timestamps during a run. When response is [SILENT], delete all thread messages before deleting the main message. This prevents the 'This message was deleted' tombstone in Slack.
This commit is contained in:
parent
8ba6aa6627
commit
f1451fd8f0
3 changed files with 18 additions and 5 deletions
|
|
@ -690,11 +690,11 @@ function createRunner(sandboxConfig: SandboxConfig, channelId: string, channelDi
|
|||
.map((c) => c.text)
|
||||
.join("\n") || "";
|
||||
|
||||
// Check for [SILENT] marker - delete message instead of posting
|
||||
// Check for [SILENT] marker - delete message and thread instead of posting
|
||||
if (finalText.trim() === "[SILENT]" || finalText.trim().startsWith("[SILENT]")) {
|
||||
try {
|
||||
await ctx.deleteMessage();
|
||||
log.logInfo("Silent response - deleted status message");
|
||||
log.logInfo("Silent response - deleted message and thread");
|
||||
} catch (err) {
|
||||
const errMsg = err instanceof Error ? err.message : String(err);
|
||||
log.logWarning("Failed to delete message for silent response", errMsg);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue