fix(km): restore knowledge base readback
This commit is contained in:
@@ -252,13 +252,18 @@ class KnowledgeService:
|
||||
result = await db.execute(
|
||||
sa_text(
|
||||
"SELECT id FROM knowledge_entries "
|
||||
"WHERE entry_type = 'anti_pattern' "
|
||||
"WHERE LOWER(CAST(entry_type AS TEXT)) = :entry_type "
|
||||
"AND symptoms_hash = :hash "
|
||||
"AND created_at >= :cutoff "
|
||||
"AND status != 'ARCHIVED' "
|
||||
"AND LOWER(CAST(status AS TEXT)) != :archived "
|
||||
"ORDER BY created_at DESC LIMIT 5"
|
||||
),
|
||||
{"hash": symptoms_hash, "cutoff": cutoff},
|
||||
{
|
||||
"entry_type": EntryType.ANTI_PATTERN.value,
|
||||
"hash": symptoms_hash,
|
||||
"cutoff": cutoff,
|
||||
"archived": EntryStatus.ARCHIVED.value,
|
||||
},
|
||||
)
|
||||
entry_ids = [row.id for row in result.fetchall()]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user