feat: add structured room role metadata
This commit is contained in:
23
runners/agent-runner/test/room-role-context.test.ts
Normal file
23
runners/agent-runner/test/room-role-context.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { prependRoomRoleHeader } from '../src/room-role-context.js';
|
||||
|
||||
describe('claude runner room role header', () => {
|
||||
it('prepends a canonical role header when metadata exists', () => {
|
||||
expect(
|
||||
prependRoomRoleHeader('hello', {
|
||||
serviceId: 'codex-review',
|
||||
role: 'owner',
|
||||
ownerServiceId: 'codex-review',
|
||||
reviewerServiceId: 'codex-main',
|
||||
failoverOwner: true,
|
||||
}),
|
||||
).toBe(
|
||||
'[ROOM_ROLE self=codex-review role=owner owner=codex-review reviewer=codex-main failover=1]\n\nhello',
|
||||
);
|
||||
});
|
||||
|
||||
it('leaves prompts unchanged without room metadata', () => {
|
||||
expect(prependRoomRoleHeader('hello')).toBe('hello');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user