fix: repair chat history from DB when Goose session has empty placeholders
Portal direct chat → goosed escalation can leave hollow Goose messages while h5_conversation_messages retains the full dialogue. Backfill session detail from DB, extend snapshot list fallback, and keep stored session id on transient boot failures so refresh no longer looks like a blank new chat. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+4
-2
@@ -1611,8 +1611,10 @@ export function createTkmindProxy({
|
||||
}
|
||||
|
||||
const directSessionIds = [...owned].filter(isDirectChatSessionId);
|
||||
if (directSessionIds.length > 0 && sessionSnapshotService?.isEnabled?.()) {
|
||||
for (const sessionId of directSessionIds) {
|
||||
const ownedMissingFromGoose = [...owned].filter((sessionId) => !sessionsById.has(sessionId));
|
||||
const snapshotFallbackIds = [...new Set([...directSessionIds, ...ownedMissingFromGoose])];
|
||||
if (snapshotFallbackIds.length > 0 && sessionSnapshotService?.isEnabled?.()) {
|
||||
for (const sessionId of snapshotFallbackIds) {
|
||||
if (sessionsById.has(sessionId)) continue;
|
||||
const snapshot = await sessionSnapshotService.get(sessionId).catch(() => null);
|
||||
if (!snapshot?.session) continue;
|
||||
|
||||
Reference in New Issue
Block a user