feat(chat): add session-scoped temporary attachments with async parsing

Let users upload documents in chat without ingesting them into a knowledge base: files are parsed in the background, referenced by ID on send, and expire after a configurable TTL.
This commit is contained in:
wizardchen
2026-07-16 14:48:20 +08:00
committed by lyingbug
parent 7b2c9e73bf
commit ceb4d1a310
63 changed files with 3513 additions and 248 deletions
+9
View File
@@ -155,6 +155,15 @@ func compactToolSummary(success bool, errMsg string, data map[string]interface{}
if count > 0 {
return fmt.Sprintf("Semantic search returned %d result(s) (details omitted from history)", count)
}
case "attachment_parsing":
parsed := intField(data, "parsed_count")
skipped := intField(data, "skipped_count")
if skipped > 0 {
return fmt.Sprintf("Parsed %d attachment(s), %d skipped (still processing)", parsed, skipped)
}
if parsed > 0 {
return fmt.Sprintf("Parsed %d attachment(s)", parsed)
}
}
if displayType := stringField(data, "display_type"); displayType != "" {
return fmt.Sprintf("Tool completed (%s; payload omitted from history)", displayType)