mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-29 05:20:49 +00:00
🪟 feat: Read Child Threads Through Their Parent (#15073)
* feat: add parent-scoped subagent thread reads * fix: tighten child thread read bounds * perf: project child activity messages * test: update child activity route fixtures * test: satisfy response mock types * fix: bound child activity reads at storage * style: sort child activity imports * fix: bound child activity storage reads
This commit is contained in:
parent
8c14f03432
commit
634432b2ae
18 changed files with 942 additions and 11 deletions
|
|
@ -32,6 +32,7 @@ module.exports = {
|
|||
});
|
||||
return archiveAllHandler;
|
||||
}),
|
||||
createSubagentThreadViewHandler: jest.fn(() => (_req, res) => res.status(200).json({})),
|
||||
deleteConvoSharedLinksWithCleanup: jest.fn(),
|
||||
deleteAllSharedLinksWithCleanup: jest.fn(),
|
||||
deleteAgentCheckpoints: jest.fn(),
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ const {
|
|||
isEnabled,
|
||||
deleteAgentCheckpoints,
|
||||
createArchiveAllHandler,
|
||||
createSubagentThreadViewHandler,
|
||||
resolveImportMaxFileSize,
|
||||
restoreTenantContextFromReq,
|
||||
deleteAllSharedLinksWithCleanup,
|
||||
|
|
@ -33,6 +34,11 @@ const assistantClients = {
|
|||
|
||||
const router = express.Router();
|
||||
const archiveAllHandler = createArchiveAllHandler({ archiveAllConvos: db.archiveAllConvos });
|
||||
const subagentThreadViewHandler = createSubagentThreadViewHandler({
|
||||
getConvoOwnership: db.getConvoOwnership,
|
||||
getSubagentThreadForParent: db.getSubagentThreadForParent,
|
||||
getMessagesForSubagentThreadView: db.getMessagesForSubagentThreadView,
|
||||
});
|
||||
router.use(requireJwtAuth);
|
||||
|
||||
const isValidProjectFilter = (projectId) =>
|
||||
|
|
@ -79,6 +85,8 @@ router.get('/', async (req, res) => {
|
|||
}
|
||||
});
|
||||
|
||||
router.get('/:parentConversationId/subagents/:threadId', subagentThreadViewHandler);
|
||||
|
||||
router.get('/:conversationId', async (req, res) => {
|
||||
const { conversationId } = req.params;
|
||||
const convo = await db.getConvo(req.user.id, conversationId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue