Release v0.18.6
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased]
|
||||
## [0.18.6] - 2025-12-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Duplicate message in context when message has attachments (sync from log didn't strip attachment section before comparing)
|
||||
- Use `<slack_attachments>` delimiter for attachments in messages (easier to parse/strip)
|
||||
|
||||
## [0.18.5] - 2025-12-12
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@mariozechner/pi-mom",
|
||||
"version": "0.18.5",
|
||||
"version": "0.18.6",
|
||||
"description": "Slack bot that delegates messages to the pi coding agent",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
@@ -21,9 +21,9 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sandbox-runtime": "^0.0.16",
|
||||
"@mariozechner/pi-agent-core": "^0.18.5",
|
||||
"@mariozechner/pi-ai": "^0.18.5",
|
||||
"@mariozechner/pi-coding-agent": "^0.18.5",
|
||||
"@mariozechner/pi-agent-core": "^0.18.6",
|
||||
"@mariozechner/pi-ai": "^0.18.6",
|
||||
"@mariozechner/pi-coding-agent": "^0.18.6",
|
||||
"@sinclair/typebox": "^0.34.0",
|
||||
"@slack/socket-mode": "^2.0.0",
|
||||
"@slack/web-api": "^7.0.0",
|
||||
|
||||
@@ -588,7 +588,7 @@ function createRunner(sandboxConfig: SandboxConfig, channelId: string, channelDi
|
||||
// Add attachment paths if any (convert to absolute paths in execution environment)
|
||||
if (ctx.message.attachments && ctx.message.attachments.length > 0) {
|
||||
const attachmentPaths = ctx.message.attachments.map((a) => `${workspacePath}/${a.local}`).join("\n");
|
||||
userMessage += `\n\nAttachments:\n${attachmentPaths}`;
|
||||
userMessage += `\n\n<slack_attachments>\n${attachmentPaths}\n</slack_attachments>`;
|
||||
}
|
||||
|
||||
// Debug: write context to last_prompt.jsonl
|
||||
|
||||
@@ -604,7 +604,7 @@ export function syncLogToContext(channelDir: string, excludeAfterTs?: string): n
|
||||
}
|
||||
|
||||
// For deduplication, we need to track what's already in context
|
||||
// Read context and extract user message content
|
||||
// Read context and extract user message content (strip attachments section for comparison)
|
||||
const existingMessages = new Set<string>();
|
||||
if (existsSync(contextFile)) {
|
||||
const contextContent = readFileSync(contextFile, "utf-8");
|
||||
@@ -613,9 +613,16 @@ export function syncLogToContext(channelDir: string, excludeAfterTs?: string): n
|
||||
try {
|
||||
const entry = JSON.parse(line);
|
||||
if (entry.type === "message" && entry.message?.role === "user") {
|
||||
const content =
|
||||
let content =
|
||||
typeof entry.message.content === "string" ? entry.message.content : entry.message.content?.[0]?.text;
|
||||
if (content) existingMessages.add(content);
|
||||
// Strip attachments section for comparison (live messages have it, log messages don't)
|
||||
if (content) {
|
||||
const attachmentsIdx = content.indexOf("\n\n<slack_attachments>\n");
|
||||
if (attachmentsIdx !== -1) {
|
||||
content = content.substring(0, attachmentsIdx);
|
||||
}
|
||||
existingMessages.add(content);
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user