chore(rebase): realign duplicate backend/channel/schema files with main

This commit is contained in:
William Valentin
2026-02-17 15:44:47 -08:00
parent 03fa96583c
commit b0d06d0650
9 changed files with 0 additions and 691 deletions
-34
View File
@@ -15,19 +15,6 @@ vi.mock('child_process', () => ({
const mockExecFile = vi.mocked(execFile);
function makeFailChild(stderrText = 'failed'): FakeChild {
const child = new EventEmitter() as FakeChild;
child.stdout = new EventEmitter();
child.stderr = new EventEmitter();
child.stdin = { end: vi.fn() };
child.kill = vi.fn();
setImmediate(() => {
child.stderr.emit('data', Buffer.from(stderrText));
child.emit('close', 1);
});
return child;
}
describe('ExternalCliBackend', () => {
beforeEach(() => {
vi.clearAllMocks();
@@ -117,25 +104,4 @@ describe('ExternalCliBackend', () => {
expect(opencode.name).toBe('opencode');
expect(gemini.name).toBe('gemini');
});
it('retries failed backend calls when retries are configured', async () => {
spawnMock
.mockImplementationOnce(() => makeFailChild('transient'))
.mockImplementationOnce(() => makeChild('recovered'));
const backend = new ExternalCliBackend({
name: 'codex',
command: 'codex',
retries: 1,
retryDelayMs: 0,
});
const result = await backend.process({
systemPrompt: 'sys',
history: [],
message: 'retry me',
});
expect(result).toBe('recovered');
expect(spawnMock).toHaveBeenCalledTimes(2);
});
});