feat(agents): improve session ID extraction and JSONL file handling
- Fix session ID extraction to use correct field name "session_id" instead of "sessionId" - Add comprehensive database update logging with error handling - Implement cross-project session file search in get_session_output - Add new load_agent_session_history command for robust JSONL loading - Update UI components to prioritize JSONL file loading over fallback methods - Improve error handling and logging throughout the session management flow - Fix BufReader imports and alias conflicts in Tauri backend This enhances the reliability of agent session tracking and output retrieval by properly handling Claude Code's actual JSON structure and implementing better fallback mechanisms for session data access.
This commit is contained in:
@@ -925,6 +925,21 @@ export const api = {
|
||||
return invoke("load_session_history", { sessionId, projectId });
|
||||
},
|
||||
|
||||
/**
|
||||
* Loads the JSONL history for a specific agent session
|
||||
* Similar to loadSessionHistory but searches across all project directories
|
||||
* @param sessionId - The session ID (UUID)
|
||||
* @returns Promise resolving to array of session messages
|
||||
*/
|
||||
async loadAgentSessionHistory(sessionId: string): Promise<any[]> {
|
||||
try {
|
||||
return await invoke<any[]>('load_agent_session_history', { sessionId });
|
||||
} catch (error) {
|
||||
console.error("Failed to load agent session history:", error);
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Executes a new interactive Claude Code session with streaming output
|
||||
*/
|
||||
|
Reference in New Issue
Block a user