feat: add structured room role metadata
This commit is contained in:
@@ -15,6 +15,9 @@ vi.mock('./config.js', () => ({
|
||||
CODEX_REVIEW_SERVICE_ID: 'codex-review',
|
||||
DATA_DIR: '/tmp/ejclaw-test-data',
|
||||
SERVICE_SESSION_SCOPE: 'claude',
|
||||
normalizeServiceId: vi.fn((serviceId: string) =>
|
||||
serviceId === 'codex' ? 'codex-main' : serviceId,
|
||||
),
|
||||
}));
|
||||
|
||||
vi.mock('./db.js', () => ({
|
||||
@@ -231,6 +234,32 @@ describe('runAgentForGroup room memory', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('passes paired-room role metadata through to the runner input', async () => {
|
||||
const group = { ...makeGroup(), folder: 'test-group' };
|
||||
|
||||
await runAgentForGroup(makeDeps(), {
|
||||
group,
|
||||
prompt: 'hello',
|
||||
chatJid: 'group@test',
|
||||
runId: 'run-room-role',
|
||||
});
|
||||
|
||||
expect(agentRunner.runAgentProcess).toHaveBeenCalledWith(
|
||||
group,
|
||||
expect.objectContaining({
|
||||
roomRoleContext: {
|
||||
serviceId: 'claude',
|
||||
role: 'owner',
|
||||
ownerServiceId: 'claude',
|
||||
reviewerServiceId: 'codex-main',
|
||||
failoverOwner: false,
|
||||
},
|
||||
}),
|
||||
expect.any(Function),
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
it('adds reviewer silence guidance when the current service is the reviewer for the chat', async () => {
|
||||
const group = { ...makeGroup(), folder: 'test-group' };
|
||||
vi.mocked(serviceRouting.getEffectiveChannelLease).mockReturnValue({
|
||||
|
||||
Reference in New Issue
Block a user