mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-22 05:00:41 +00:00
fix(mom): private channel messages not being logged
- Add message.groups to required bot events in README - Add groups:history and groups:read to required scopes in README - app_mention handler now logs messages directly instead of relying on message event - Add deduplication in ChannelStore.logMessage() to prevent double-logging - Remove redundant current message append in agent.ts (already in log)
This commit is contained in:
parent
db6d655ee9
commit
706554a5d3
6 changed files with 67 additions and 11 deletions
|
|
@ -364,15 +364,7 @@ export function createAgentRunner(sandboxConfig: SandboxConfig): AgentRunner {
|
|||
|
||||
const channelId = ctx.message.channel;
|
||||
const workspacePath = executor.getWorkspacePath(channelDir.replace(`/${channelId}`, ""));
|
||||
const recentMessagesFromLog = getRecentMessages(channelDir, 50);
|
||||
|
||||
// Append the current message (may not be in log yet due to race condition
|
||||
// between app_mention and message events)
|
||||
const currentMsgDate = new Date(parseFloat(ctx.message.ts) * 1000).toISOString().substring(0, 19);
|
||||
const currentMsgUser = ctx.message.userName || ctx.message.user;
|
||||
const currentMsgAttachments = ctx.message.attachments.map((a) => a.local).join(",");
|
||||
const currentMsgLine = `${currentMsgDate}\t${currentMsgUser}\t${ctx.message.rawText}\t${currentMsgAttachments}`;
|
||||
const recentMessages = recentMessagesFromLog + "\n" + currentMsgLine;
|
||||
const recentMessages = getRecentMessages(channelDir, 50);
|
||||
|
||||
const memory = getMemory(channelDir);
|
||||
const systemPrompt = buildSystemPrompt(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue