fix: keep chat replies out of results

Completed local and channel replies were duplicated into Results as Markdown artifacts, making the panel a second conversation history. Replies now stay in their conversations, legacy duplicates are filtered without deleting data, and standalone images, scheduled jobs, headless delegations, heartbeats, and imports remain visible.

Release note: 普通本地与消息通道回复不再重复出现在成果栏;已有重复内容仅从列表隐藏,不会删除历史数据。
This commit is contained in:
mesalogo
2026-08-18 13:14:13 +08:00
parent e387c09f52
commit 0413807b8f
10 changed files with 173 additions and 84 deletions
+16 -1
View File
@@ -3166,11 +3166,25 @@ export class AssistantDatabase {
CASE WHEN kind = 'image' THEN NULL
ELSE inline_content END AS inline_content,
byte_size, created_at, updated_at`
const visibleArtifact = `NOT (
kind = 'markdown' AND EXISTS (
SELECT 1
FROM tasks
WHERE tasks.id = artifacts.task_id
AND tasks.conversation_id IS NOT NULL
AND (
tasks.origin = 'user' OR (
tasks.origin = 'delegation'
AND tasks.conversation_id NOT LIKE 'delegation:%'
)
)
)
)`
const rows = projectId
? this.requireDatabase()
.prepare(
`SELECT ${columns} FROM artifacts
WHERE project_id = ?
WHERE project_id = ? AND ${visibleArtifact}
ORDER BY created_at DESC
LIMIT ?`
)
@@ -3178,6 +3192,7 @@ export class AssistantDatabase {
: this.requireDatabase()
.prepare(
`SELECT ${columns} FROM artifacts
WHERE ${visibleArtifact}
ORDER BY created_at DESC
LIMIT ?`
)