fix(backend): include context_id in report fetch API to prevent fallback context mismatch in chat
This commit is contained in:
parent
bcdd6e36ff
commit
2f7dd95699
@ -971,7 +971,7 @@ xray.module5: track1(数组,每项含node/action/strategy/purpose), track2(数
|
||||
db = SessionDB()
|
||||
with db._lock:
|
||||
cursor = db._conn.execute(
|
||||
"SELECT report_json, created_at, client_id FROM deepview_reports_v2 WHERE report_id = ?",
|
||||
"SELECT report_json, created_at, client_id, context_id FROM deepview_reports_v2 WHERE report_id = ?",
|
||||
(reportId,)
|
||||
)
|
||||
row = cursor.fetchone()
|
||||
@ -981,10 +981,12 @@ xray.module5: track1(数组,每项含node/action/strategy/purpose), track2(数
|
||||
|
||||
reportData = json.loads(row[0])
|
||||
clientId = row[2]
|
||||
contextId = row[3]
|
||||
|
||||
# Hot patch reportCode for older generated reports that might have hallucinated ones
|
||||
reportData["reportCode"] = f"DW-AMXG-{reportId[4:].upper()}"
|
||||
reportData["id"] = reportId
|
||||
reportData["context_id"] = contextId
|
||||
|
||||
# Attach clientId into the data payload so the frontend knows if it's archived
|
||||
if clientId:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user