📬 feat: Persist Channel Events and Delivery Receipts (#17595)

* 📬 feat: Persist Channel Events and Delivery Receipts

* fix: enforce channel run identity and fenced recovery

* fix: fence and erase channel state during account deletion

* refactor: share channel owner admission with private persistence

* refactor: name channel account-erasure boundary explicitly

* fix: prove channel identity and delivery authority at storage boundaries

* refactor: enforce channel delivery protocol and terminal lifecycle

* fix: enforce channel tenant and operation boundaries

* fix: initialize channel config from its composition owner

* test: verify config installs channel storage reader

* test: complete config initializer contract in model mocks

* test: include channel config reader in migration fixture

* test: await SSE subscription before advancing keepalive time

* test: Observe and Drain Concurrent Fixture Work
This commit is contained in:
Dustin Healy 2026-11-10 21:03:57 -08:00 • committed by GitHub
parent 1458e841e4
commit 7dd4fafdf3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 3816 additions and 54 deletions

View file

@ -5,16 +5,19 @@ const {
findMatchingPattern,
isDeploymentSkillId,
createMessageBudgetReader,
createChannelStorageConfigReader,
} = require('@librechat/api');
const getLogStores = require('~/cache/getLogStores');
const messageBudget = createMessageBudgetReader();
const channelStorageConfig = createChannelStorageConfigReader();
const methods = createMethods(mongoose, {
matchModelName,
findMatchingPattern,
isExternalSkillId: isDeploymentSkillId,
getCache: getLogStores,
getChannelStorageConfig: channelStorageConfig.getConfig,
getMCPAppMessageBudget: messageBudget.getBudget,
});
@ -28,5 +31,6 @@ const seedDatabase = async () => {
module.exports = {
...methods,
initializeMessageBudget: messageBudget.initialize,
initializeChannelStorageConfig: channelStorageConfig.initialize,
seedDatabase,
};

View file

@ -3,15 +3,21 @@ jest.mock('@librechat/api', () => ({
matchModelName: jest.fn(),
findMatchingPattern: jest.fn(),
isDeploymentSkillId: jest.fn(),
createChannelStorageConfigReader: jest.fn(() => ({
getConfig: jest.fn(),
initialize: jest.fn(),
})),
createMessageBudgetReader: jest.fn(() => ({ getBudget: jest.fn(), initialize: jest.fn() })),
}));
jest.mock('~/cache/getLogStores', () => jest.fn());
const { createMethods } = require('@librechat/data-schemas');
const { createMessageBudgetReader } = require('@librechat/api');
const { initializeMessageBudget } = require('./index');
const { createMessageBudgetReader, createChannelStorageConfigReader } = require('@librechat/api');
const { initializeMessageBudget, initializeChannelStorageConfig } = require('./index');
const reader = createMessageBudgetReader.mock.results[0].value;
const { getMCPAppMessageBudget } = createMethods.mock.calls[0][1];
const channelStorageConfigReader = createChannelStorageConfigReader.mock.results[0].value;
const { getMCPAppMessageBudget, getChannelStorageConfig: channelStorageConfigDependency } =
createMethods.mock.calls[0][1];
describe('message App budget dependency wiring', () => {
it('passes the same reader to storage and initializer to the composition root', () => {
@ -20,3 +26,11 @@ describe('message App budget dependency wiring', () => {
expect(reader.getBudget).not.toHaveBeenCalled();
});
});
describe('channel storage configuration dependency wiring', () => {
it('injects the deployment reader without reading config during module initialization', () => {
expect(channelStorageConfigDependency).toBe(channelStorageConfigReader.getConfig);
expect(initializeChannelStorageConfig).toBe(channelStorageConfigReader.initialize);
expect(channelStorageConfigReader.getConfig).not.toHaveBeenCalled();
});
});