Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions cli/__tests__/adapters.claude.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -255,17 +255,14 @@ describe('claude adapter — spawn()', () => {
});

test('rejects on timeout and SIGTERMs the child', async () => {
// Child never emits close within the window.
// Child closes only after the timeout kills it, independent of host load.
const proc = new EventEmitter();
proc.stdout = new EventEmitter();
proc.stderr = new EventEmitter();
proc.kill = jest.fn();
proc.kill = jest.fn(() => queueMicrotask(() => proc.emit('close', null)));
const impl = () => proc;

const p = claude.spawn('x', { sessionId: 'sid-1', timeoutMs: 20, _spawnImpl: impl });
// After kill, simulate the process closing so the adapter resolves its close handler.
setTimeout(() => proc.emit('close', null), 40);

await expect(p).rejects.toThrow(/timed out after 20ms/);
expect(proc.kill).toHaveBeenCalledWith('SIGTERM');
});
Expand Down
3 changes: 3 additions & 0 deletions cli/__tests__/adapters.opencode.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ describe('opencode public seat withholds a turn whose Commonly tools failed', ()
}));
await writeFile(join(pkgDir, 'src', 'index.js'), '');
await writeFile(join(home, 'current'), '0.3.13\n');
// The selected MCP is already installed for this fixture. Keep the
// detached warmer from racing with withTemp's teardown.
await writeFile(join(home, '.warm.lock'), 'warming\n');
const workspace = join(root, 'workspace');
await mkdir(workspace);
const keyFile = join(root, 'provider-key');
Expand Down
Loading