~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
/** A late Cancel click must preserve an already scheduled SSE completion. */
import { resolve } from 'node:path';
import { compileTemplateHarness } from '../helpers/template-harness.js';
import '@js/utils/sse-completion.js';
beforeEach(() => {
vi.useFakeTimers();
document.body.innerHTML = '<div id="download-progress-modal" style="display: block"></div>';
vi.stubGlobal('alert', vi.fn());
});
afterEach(() => {
vi.clearAllTimers();
vi.useRealTimers();
vi.unstubAllGlobals();
delete window.closeProgressModal;
document.body.replaceChildren();
});
it.each(['library', 'download_manager'])(
'keeps the %s completion callback live after a late Cancel click',
async page => {
const runtime = compileTemplateHarness({
templatePath: resolve(
__dirname,
`../../../src/local_deep_research/web/templates/pages/${page}.html`,
),
functionNames: ['cancelDownloads', 'closeProgressModal'],
preamble: 'let currentDownloadController = null; let currentDownloadRunId = 1;',
returnExpression: '{ cancelDownloads, closeProgressModal, isCurrent: () => currentDownloadRunId === 1 }',
});
window.closeProgressModal = runtime.closeProgressModal;
const onSuccess = vi.fn();
window.handleSSECompletion({ complete: true }, onSuccess, runtime.isCurrent);
runtime.cancelDownloads();
expect(document.getElementById('download-progress-modal').style.display).toBe('none');
expect(onSuccess).not.toHaveBeenCalled();
await vi.advanceTimersByTimeAsync(2000);
expect(onSuccess).toHaveBeenCalledOnce();
expect(document.getElementById('download-progress-modal').style.display).toBe('none');
expect(vi.getTimerCount()).toBe(0);
},
);