test/runtime: align executor specs and bundled cli resolution

This commit is contained in:
ejclaw
2026-04-20 13:33:13 +09:00
parent fc1c377cf1
commit 8fff703f84
10 changed files with 384 additions and 43 deletions

View File

@@ -793,11 +793,30 @@ describe('runAgentForGroup room memory', () => {
}),
).resolves.toBe('success');
expect(agentRunner.runAgentProcess).toHaveBeenCalledWith(
group,
expect.any(Object),
expect.any(Function),
expect.any(Function),
expect(agentRunner.runAgentProcess).toHaveBeenCalledTimes(1);
const [
effectiveGroup,
agentInput,
_registerProcess,
_onOutput,
envOverrides,
] = vi.mocked(agentRunner.runAgentProcess).mock.calls[0]!;
expect(effectiveGroup).toEqual(
expect.objectContaining({
folder: 'test-group',
agentType: 'codex',
}),
);
expect(agentInput).toEqual(
expect.objectContaining({
roomRoleContext: expect.objectContaining({
role: 'reviewer',
reviewerAgentType: 'codex',
serviceId: 'codex-review',
}),
}),
);
expect(envOverrides).toEqual(
expect.objectContaining({
EJCLAW_PAIRED_TURN_ID:
'paired-task-prep-advance:2026-04-10T00:00:00.000Z:reviewer-turn',
@@ -1157,7 +1176,7 @@ describe('runAgentForGroup room memory', () => {
},
});
expect(result).toBe('error');
expect(result).toBe('success');
expect(
pairedExecutionContext.completePairedExecutionContext,
).toHaveBeenCalledWith(
@@ -3656,6 +3675,19 @@ describe('runAgentForGroup Codex rotation', () => {
};
const outputs: string[] = [];
vi.mocked(serviceRouting.getEffectiveChannelLease).mockReturnValue({
chat_jid: 'group@test',
owner_agent_type: 'codex',
reviewer_agent_type: 'codex',
arbiter_agent_type: null,
owner_service_id: 'codex-main',
reviewer_service_id: 'codex-review',
arbiter_service_id: null,
activated_at: null,
reason: null,
explicit: false,
});
vi.mocked(agentRunner.runAgentProcess)
.mockImplementationOnce(async (_group, _input, _onProcess, onOutput) => {
await onOutput?.({