fix(aia,ssa,asl,infra): harden SSE transport and stabilize attachment context

Deliver SSE protocol hardening for SAE/HTTP2 paths, add graceful shutdown health behavior, and improve SSA retry UX for transient stream failures. For AIA, persist attachment extraction results in database with cache read-through fallback, plus production cache safety guard to prevent memory-cache drift in multi-instance deployments; also restore ASL SR page scrolling behavior.

Made-with: Cursor
This commit is contained in:
2026-03-09 18:45:12 +08:00
parent 50657dd81f
commit 5c5fec52c1
27 changed files with 807 additions and 100 deletions

View File

@@ -127,6 +127,31 @@ model Message {
@@schema("aia_schema")
}
/// AIA 附件持久化(数据库真相源,缓存仅加速)
model AiaAttachment {
id String @id
userId String @map("user_id")
conversationId String @map("conversation_id")
filename String
mimeType String? @map("mime_type")
size Int
ossUrl String @map("oss_url")
textContent String? @map("text_content") @db.Text
extractStatus String @default("success") @map("extract_status") // success | failed | empty
extractError String? @map("extract_error")
tokenCount Int @default(0) @map("token_count")
truncated Boolean @default(false)
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
@@index([conversationId], map: "idx_aia_attachments_conversation_id")
@@index([userId], map: "idx_aia_attachments_user_id")
@@index([extractStatus], map: "idx_aia_attachments_extract_status")
@@index([createdAt], map: "idx_aia_attachments_created_at")
@@map("attachments")
@@schema("aia_schema")
}
model KnowledgeBase {
id String @id @default(uuid())
userId String @map("user_id")