🧾 feat: Persist Authoritative Subagent Control Receipts (#15168)

* feat: persist subagent control receipts

* fix: require control receipt persistence

* fix: preserve authoritative control history
This commit is contained in:
Danny Avila 2026-08-24 11:39:56 -04:00 committed by GitHub
parent e0d5e11cdf
commit a997275902
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 1608 additions and 28 deletions

View file

@ -30,6 +30,7 @@ jest.mock('~/models', () => ({
getConvo: jest.fn(),
getMessages: jest.fn(),
listActiveSubagentThreadLeases: jest.fn(),
recordSubagentTaskControlReceipt: jest.fn(),
releaseSubagentThreadLease: jest.fn(),
reserveSubagentThread: jest.fn(),
renewSubagentThreadLease: jest.fn(),
@ -55,11 +56,19 @@ const {
const subagentThreadTaskStore = require('./subagentThreadStore');
const { configureSubagentTaskRouting } = subagentThreadTaskStore;
const taskStoreOptions = createSubagentThreadTaskStore.mock.calls[0][1];
const taskStoreMethods = createSubagentThreadTaskStore.mock.calls[0][0];
const db = require('~/models');
const activityPrepareRegistration = registerShutdownTask.mock.calls.find(
([name]) => name === 'subagent activity streams prepare',
);
describe('subagent thread Redis lifecycle', () => {
it('wires durable control receipt persistence into the host store', () => {
expect(taskStoreMethods.recordSubagentTaskControlReceipt).toBe(
db.recordSubagentTaskControlReceipt,
);
});
it('reads completion wakeup rollout state at task preparation time', async () => {
isEnabled.mockReturnValueOnce(false);