You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: SOLID_INTEGRATION_PROGRESS.md
+27-11Lines changed: 27 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ Successfully implemented Solid Pod storage integration for LibreChat, enabling u
86
86
- Added fallback mechanism for schema validation failures
87
87
- Extracts `model` and `endpoint` from messages when missing in conversation metadata
88
88
- Ensures `resendFiles` is included in payloads for agents endpoints (defaults to `true`)
89
-
-Fixed model extraction in `buildEndpointOption` middleware to load from Solid when missing
89
+
-**buildEndpointOption** (per PR review): Uses storage-agnostic `getConvo(req.user.id, conversationId, req)`to fill missing model; no Solid-specific logic in that middleware—storage is chosen in the model layer
90
90
91
91
### 10. Full Conversation Flow
92
92
-**Status**: Complete
@@ -100,9 +100,9 @@ Successfully implemented Solid Pod storage integration for LibreChat, enabling u
100
100
-**Status**: Complete
101
101
-**Details**:
102
102
- Conversation titles are properly saved to Solid Pod when generated
103
-
- Titles persist correctly after page refresh
103
+
- Titles persist correctly after page refresh and after sending more messages
104
104
-`saveConvo` correctly identifies Solid users before saving to Solid Pod
105
-
-`saveConvoToSolid` merges updates with existing conversation data to prevent data loss
105
+
-**saveConvoToSolid** merges existing Pod conversation into the incoming document before writing, so partial updates (e.g. after POST message or BaseClient saveConvo) preserve fields like `title` instead of overwriting the file and losing the generated title
106
106
107
107
### 12. Conversation Management Operations
108
108
-**Status**: Complete
@@ -124,6 +124,21 @@ Successfully implemented Solid Pod storage integration for LibreChat, enabling u
124
124
- Fetches shared messages directly from Pod using unauthenticated requests
125
125
- Properly removes public access when share is deleted
-**Single source of document shape**: JSON written to the Solid Pod now matches the same document shape as MongoDB; shape is defined in the model layer and aligned with `packages/data-schemas` (message + convo schema and types).
131
+
-**Messages**: `Message.js` builds the full message document (including `user`, `createdAt`, `updatedAt`) and passes it to `saveMessageToSolid`. SolidStorage only validates ids, resolves paths, and writes that document; the previous hand-built field list and defaults in SolidStorage were removed.
132
+
-**Conversations**: `Conversation.js` builds the full conversation document (conversationId, user, …convo, expiredAt, `previousConversationId` when renaming) and passes it to `saveConvoToSolid`. SolidStorage only adds Pod-specific data (message refs from the Pod, timestamps, optional model/endpoint fallback from messages), then merges with existing Pod conversation (to preserve e.g. title on partial updates) and writes. It no longer constructs the conversation payload from a custom field list.
133
+
-**Partial updates**: When the caller sends a partial update (e.g. after sending a message with no `title`), existing conversation from the Pod is merged into the incoming document before writing so fields like `title` are preserved.
134
+
135
+
### 15. PR Review: Config, Logging, Convos
136
+
-**Status**: Complete
137
+
-**Details**:
138
+
-**config.js**: `openidLoginEnabled` set to `isOpenIdEnabled` only (removed `|| isSolidEnabled`) so when only Solid is enabled the login page shows one Solid button, not both OpenID and Solid.
139
+
-**requireJwtAuth.js**: Removed non–Solid-specific debug logging added during auth flow debugging; reviewer suggested upstreaming useful logging in a separate PR if needed.
140
+
-**convos.js**: No code change; reviewer concern addressed by clarification—`getConvo(req.user.id, conversationId, req)` in `Conversation.js` already branches on `isSolidUser(req)` and uses Solid when the user is a Solid user.
141
+
127
142
## Current Status
128
143
129
144
### Working Features
@@ -196,22 +211,23 @@ None currently identified.
196
211
197
212
198
213
## Files Modified
199
-
-`api/server/services/SolidStorage.js` (NEW) - Core Solid Pod operations
214
+
-`api/server/services/SolidStorage.js` (NEW) - Core Solid Pod operations; schema-aligned: accepts full document from model layer, only adds message refs + timestamps + merge with existing for partial updates (no custom document content)
200
215
-`api/server/utils/isSolidUser.js` (NEW) - Shared helper to detect Solid login (`provider === 'solid'`), used across models, routes, and middleware (DRY)
201
-
-`api/models/Message.js` - Integrated Solid storage; MongoDB path for non-Solid users only (no fallback for Solid)
202
-
-`api/models/Conversation.js` - Integrated Solid storage; no MongoDB fallback for Solid users (return null/rethrow on Solid failure)
216
+
-`api/models/Message.js` - Integrated Solid storage; builds full message document (user, createdAt, updatedAt) and passes to SolidStorage; MongoDB path for non-Solid users only (no fallback for Solid)
217
+
-`api/models/Conversation.js` - Integrated Solid storage; builds full conversation document and passes to SolidStorage; no MongoDB fallback for Solid users (return null/rethrow on Solid failure); passes `previousConversationId` when renaming
203
218
-`api/server/routes/oauth.js` - Token logging and storage
-`api/server/middleware/validate/convoAccess.js` - Added Solid storage support for conversation access validation
208
-
-`api/server/middleware/buildEndpointOption.js` - Added model extraction from Solid storage when missing; uses shared `isSolidUser`
223
+
-`api/server/middleware/buildEndpointOption.js` - Uses storage-agnostic `getConvo(req.user.id, conversationId, req)` to fill missing model (no Solid-specific logic)
209
224
-`api/server/middleware/validateMessageReq.js` - Solid storage validation; no MongoDB fallback for Solid users (404 on Solid failure)
-`api/server/routes/config.js` - `openidLoginEnabled: isOpenIdEnabled` only so Solid-only shows one button (per PR review)
210
227
-`api/server/routes/messages.js` - Solid message reads return 503 on Solid failure (no MongoDB fallback)
211
228
-`api/server/services/Endpoints/agents/initialize.js` - Enhanced model discovery from request body and endpointOption
212
229
-`packages/data-provider/src/createPayload.ts` - Added normalization for Solid conversation objects and fallback handling
213
-
-`api/models/Conversation.js` - Fixed `saveConvo` to check for Solid users before saving to Solid Pod, added Solid storage support to `deleteConvos`
214
-
-`api/server/services/SolidStorage.js` - Enhanced `saveConvoToSolid` to merge updates with existing conversation data, improved message deletion logging
230
+
-`api/server/services/SolidStorage.js` - Schema-aligned: `saveMessageToSolid` accepts full message document; `saveConvoToSolid` accepts full convo document, merges with existing Pod conversation to preserve title (and other fields) on partial updates
215
231
-`api/server/utils/import/fork.js` - Added Solid storage support to `duplicateConversation` function
216
232
-`api/server/routes/convos.js` - Updated duplicate and delete endpoints to pass `req` for Solid storage support
217
233
-`api/server/services/SolidStorage.js` - Added `isArchived` field support in `saveConvoToSolid` and `getConvosByCursorFromSolid` for archive functionality
@@ -267,11 +283,11 @@ The following environment variables are used for the generic "Login with OpenID"
267
283
- Storage is chosen per user: **Solid Pod** for users who logged in with "Continue with Solid" (`provider === 'solid'`); **MongoDB** for everyone else. No environment variable is required.
268
284
269
285
### Imports (top-level vs inline)
270
-
-**API code** (Conversation.js, Message.js, buildEndpointOption.js, validateMessageReq.js, messages.js, convos.js, fork.js): SolidStorage and isSolidUser are required at **top level** for clarity and tooling (per PR review).
286
+
-**API code** (Conversation.js, Message.js, buildEndpointOption.js, validateMessageReq.js, messages.js, convos.js, fork.js): SolidStorage and isSolidUser are required at **top level** for clarity and tooling (per PR review). buildEndpointOption.js now uses only `getConvo` from `~/models` (no SolidStorage/isSolidUser).
271
287
-**packages/data-schemas share.ts**: SolidStorage and isSolidUser use **inline**`require()` inside the functions that need them, to avoid a circular dependency (data-schemas ← SolidStorage ← data-schemas for `logger`). Top-level require there caused `logger` to be undefined at load time and backend crash.
0 commit comments