🪟 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:
Danny Avila 2026-08-21 11:10:26 -04:00 committed by GitHub
parent 8c14f03432
commit 634432b2ae
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 942 additions and 11 deletions

View file

@ -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(),

View file

@ -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);