Skip to content

~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.

fix(web): preserve explicit log severity (#5193)

S6a343c111e66
diff --git a/src/local_deep_research/web/static/js/components/logpanel.js b/src/local_deep_research/web/static/js/components/logpanel.js
index 889bfd011d..ed5d68b86a 100644
--- a/src/local_deep_research/web/static/js/components/logpanel.js
+++ b/src/local_deep_research/web/static/js/components/logpanel.js
@@ -848,12 +848,14 @@
logsArray.forEach(log => {
if (!log.timestamp && !log.time) return; // Skip invalid logs
- // Resolve log type from metadata first so we don't collapse
- // a diagnostic error or milestone into a routine info entry
- // that happens to share its text.
- let logType = (log.log_type || log.type || log.level || 'info').toLowerCase();
+ // Explicit server metadata is authoritative. Only infer a
+ // type from message text for legacy payloads that omitted
+ // severity entirely; otherwise an INFO message mentioning
+ // "error handling" would be misclassified as an error.
+ const explicitLogType = log.log_type || log.type || log.level;
+ let logType = (explicitLogType || 'info').toLowerCase();
const messageText = (log.message || log.content || '').toLowerCase();
- if (logType === 'info' || logType === '') {
+ if (!explicitLogType) {
if (messageText.includes('complete') ||
messageText.includes('finished') ||
messageText.includes('starting phase') ||
diff --git a/tests/js/components/logpanel.test.js b/tests/js/components/logpanel.test.js
index eb85ba11c8..521220afb3 100644
--- a/tests/js/components/logpanel.test.js
+++ b/tests/js/components/logpanel.test.js
@@ -781,6 +781,31 @@ describe('loadLogsForResearch — standard-array content dedup', () => {
return document.querySelectorAll('.ldr-console-log-entry');
}
+ it('preserves explicit info severity when the message mentions errors or failures', async () => {
+ const entries = await loadStandardLogs([
+ standardEntry(
+ 'Researching error handling and failed-request recovery requirements',
+ '2026-05-08T12:00:00Z',
+ 'INFO'
+ ),
+ ]);
+
+ expect(entries).toHaveLength(1);
+ expect(entries[0].dataset.logType).toBe('info');
+ });
+
+ it('infers error severity for legacy entries without level metadata', async () => {
+ const entries = await loadStandardLogs([
+ {
+ timestamp: '2026-05-08T12:00:00Z',
+ message: 'request failed during processing',
+ },
+ ]);
+
+ expect(entries).toHaveLength(1);
+ expect(entries[0].dataset.logType).toBe('error');
+ });
+
it('keeps identical error standard entries within one minute', async () => {
const entries = await loadStandardLogs([
standardEntry('request failed', '2026-05-08T12:00:00Z', 'error'),