A React Native app for the ultimate thinking partner.

fix(knowledge): use primary agent for archival memory instead of sleeptime agent

- Remove sleeptime_agent_id checks and error messages
- Use coAgent.id directly for all archival memory operations
- Apply to loadPassages, createPassage, deletePassage, and modifyPassage
- Fixes "Sleeptime agent not available" error in Knowledge > Archival Memory
- Archival memory now works with the primary Co agent

+8 -25
+8 -25
App.tsx
··· 1067 1067 // Archival Memory (Passages) functions 1068 1068 const loadPassages = async (resetCursor = false) => { 1069 1069 if (!coAgent) return; 1070 - if (!coAgent.sleeptime_agent_id) { 1071 - console.error('No sleeptime agent available for archival memory'); 1072 - setPassagesError('Sleeptime agent not available'); 1073 - return; 1074 - } 1075 1070 1076 1071 setIsLoadingPassages(true); 1077 1072 setPassagesError(null); ··· 1088 1083 params.search = passageSearchQuery; 1089 1084 } 1090 1085 1091 - // Use sleeptime agent for archival memory 1092 - const result = await lettaApi.listPassages(coAgent.sleeptime_agent_id, params); 1086 + // Use primary agent for archival memory 1087 + const result = await lettaApi.listPassages(coAgent.id, params); 1093 1088 1094 1089 if (resetCursor) { 1095 1090 setPassages(result); ··· 1111 1106 1112 1107 const createPassage = async (text: string, tags?: string[]) => { 1113 1108 if (!coAgent) return; 1114 - if (!coAgent.sleeptime_agent_id) { 1115 - Alert.alert('Error', 'Sleeptime agent not available'); 1116 - return; 1117 - } 1118 1109 1119 1110 setIsLoadingPassages(true); 1120 1111 try { 1121 - // Use sleeptime agent for archival memory 1122 - await lettaApi.createPassage(coAgent.sleeptime_agent_id, { text, tags }); 1112 + // Use primary agent for archival memory 1113 + await lettaApi.createPassage(coAgent.id, { text, tags }); 1123 1114 await loadPassages(true); 1124 1115 Alert.alert('Success', 'Passage created successfully'); 1125 1116 } catch (error: any) { ··· 1132 1123 1133 1124 const deletePassage = async (passageId: string) => { 1134 1125 if (!coAgent) return; 1135 - if (!coAgent.sleeptime_agent_id) { 1136 - Alert.alert('Error', 'Sleeptime agent not available'); 1137 - return; 1138 - } 1139 1126 1140 1127 const confirmed = Platform.OS === 'web' 1141 1128 ? window.confirm('Are you sure you want to delete this passage?') ··· 1153 1140 if (!confirmed) return; 1154 1141 1155 1142 try { 1156 - // Use sleeptime agent for archival memory 1157 - await lettaApi.deletePassage(coAgent.sleeptime_agent_id, passageId); 1143 + // Use primary agent for archival memory 1144 + await lettaApi.deletePassage(coAgent.id, passageId); 1158 1145 await loadPassages(true); 1159 1146 if (Platform.OS === 'web') { 1160 1147 window.alert('Passage deleted successfully'); ··· 1173 1160 1174 1161 const modifyPassage = async (passageId: string, text: string, tags?: string[]) => { 1175 1162 if (!coAgent) return; 1176 - if (!coAgent.sleeptime_agent_id) { 1177 - Alert.alert('Error', 'Sleeptime agent not available'); 1178 - return; 1179 - } 1180 1163 1181 1164 setIsLoadingPassages(true); 1182 1165 try { 1183 - // Use sleeptime agent for archival memory 1184 - await lettaApi.modifyPassage(coAgent.sleeptime_agent_id, passageId, { text, tags }); 1166 + // Use primary agent for archival memory 1167 + await lettaApi.modifyPassage(coAgent.id, passageId, { text, tags }); 1185 1168 await loadPassages(true); 1186 1169 Alert.alert('Success', 'Passage updated successfully'); 1187 1170 } catch (error: any) {