Audit outbound delivery and fix reviewer turn routing

This commit is contained in:
ejclaw
2026-04-10 15:22:45 +09:00
parent c67bd1c622
commit 2e62e125ae
10 changed files with 457 additions and 10 deletions

View File

@@ -137,6 +137,32 @@ describe('buildRoomRoleContext', () => {
});
});
it('keeps the preferred reviewer role when fallback execution shares the arbiter service shadow', () => {
expect(
buildRoomRoleContext(
{
chat_jid: 'group@test',
owner_service_id: 'codex-main',
reviewer_service_id: 'claude',
arbiter_service_id: 'codex-review',
owner_failover_active: false,
activated_at: null,
reason: null,
explicit: false,
},
'codex-review',
'reviewer',
),
).toEqual({
serviceId: 'codex-review',
role: 'reviewer',
ownerServiceId: 'codex-main',
reviewerServiceId: 'claude',
failoverOwner: false,
arbiterServiceId: 'codex-review',
});
});
it('returns undefined for a non-paired room', () => {
expect(
buildRoomRoleContext(