mirror of
https://github.com/block/goose.git
synced 2026-07-17 12:56:20 +02:00
Add better debugging and caching for session loading
- Add detailed logging for resumeAgent responses - Immediately cache loaded sessions and messages - Add conversation preview in debug logs - This should help identify why conversations aren't loading
This commit is contained in:
@@ -316,11 +316,19 @@ export function useChatStream({
|
||||
log.session('resumed-existing', sessionId, {
|
||||
messageCount: conversation.length,
|
||||
sessionName: loadedSession.name,
|
||||
sessionDescription: loadedSession.description,
|
||||
conversationPreview: conversation.slice(0, 2).map(m => `${m.role}: ${m.content[0]?.text?.slice(0, 50)}...`)
|
||||
});
|
||||
|
||||
setSession(loadedSession);
|
||||
setMessagesAndLog(conversation, 'load-existing');
|
||||
|
||||
// Cache the loaded session and messages immediately
|
||||
resultsCache.set(sessionId, { session: loadedSession, messages: conversation });
|
||||
|
||||
setChatState(ChatState.Idle);
|
||||
} else {
|
||||
log.session('resume-response-empty', sessionId);
|
||||
}
|
||||
} catch (error) {
|
||||
log.session('resume-failed', sessionId, { error });
|
||||
|
||||
Reference in New Issue
Block a user