Improve in-flight cancel latency via run abort signal propagation

This commit is contained in:
William Valentin
2026-02-19 12:24:39 -08:00
parent 290303c14e
commit 2c3a00f6dd
12 changed files with 148 additions and 20 deletions
+3 -2
View File
@@ -24,10 +24,11 @@ describe('NativeAgent', () => {
const response = await agent.process('Hi');
expect(response).toBe('Hello!');
expect(mockClient.chat).toHaveBeenCalledWith({
expect(mockClient.chat).toHaveBeenCalledWith(expect.objectContaining({
messages: [{ role: 'user', content: 'Hi' }],
system: 'You are helpful.',
});
signal: expect.any(AbortSignal),
}));
const history = agent.getHistory();
expect(history).toHaveLength(2);