Skip to content

armgit / Orkas

Public Imported from GitHub
0

Orkas is an open-source (MIT), local-first AI team for your desktop: a Commander turns your goal into to-dos and coordinates 16 built-in specialist agents plus Claude Code, Codex, OpenCode, OpenClaw and Hermes, with projects, scheduled automations and connectors. Free app for macOS & Windows; built-in models or your own keys.

Preserve Node listener warnings while rejecting application error look-alikes

wyt735b1e943348
diff --git a/scripts/model-eval-log-policy.mjs b/scripts/model-eval-log-policy.mjs
index efa56e3d..0af1b017 100644
--- a/scripts/model-eval-log-policy.mjs
+++ b/scripts/model-eval-log-policy.mjs
@@ -204,7 +204,9 @@ export function createModelEvalLogCollector(phase, { maxLineChars = MAX_PARTIAL_
// application errors that merely mention deprecation.
const nodeDeprecation = level === "error" && source === "console"
&& /^\(node:\d+\) \[DEP\d{4}\] DeprecationWarning: /.test(message);
- if (nodeDeprecation) level = "warn";
+ const nodeListenerWarning = level === "error" && source === "console"
+ && /^\(node:\d+\) MaxListenersExceededWarning: /.test(message);
+ if (nodeDeprecation || nodeListenerWarning) level = "warn";
state.classificationCounts.runtime += 1;
state.levelCounts[level] += 1;
state.sourceCounts[source] = (state.sourceCounts[source] || 0) + 1;
@@ -214,6 +216,7 @@ export function createModelEvalLogCollector(phase, { maxLineChars = MAX_PARTIAL_
addFinding(
"warning",
nodeDeprecation ? "node-deprecation-warning"
+ : nodeListenerWarning ? "node-runtime-warning"
: /tool definition description exceeds soft budget/i.test(message)
? "tool-definition-soft-budget"
: "runtime-warning",
diff --git a/test/main/quality/process-log-policy.test.ts b/test/main/quality/process-log-policy.test.ts
new file mode 100644
index 00000000..597941ce
--- /dev/null
+++ b/test/main/quality/process-log-policy.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, it } from 'vitest';
+import { createModelEvalLogCollector } from '../../../scripts/model-eval-log-policy.mjs';
+
+// The Electron console bridge must preserve Node warning protocol while real
+// application errors and unrelated stderr continue to fail certification.
+describe('public process log warning boundaries', () => {
+ it.each(['stdout', 'stderr'])(
+ 'preserves a logger-wrapped Node listener warning for review on %s', stream => {
+ const logs = createModelEvalLogCollector('packaged-launch-library');
+ logs.ingest(stream, '[12:00:00.000] [error] [ (console)] (node:42) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 before-quit listeners added to [EventEmitter]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit\n');
+ expect(logs.finish()).toMatchObject({ passed: true, requiresReview: true,
+ coveragePassed: true, capturedLineCount: 1, analyzedLineCount: 1,
+ levelCounts: { warn: 1, error: 0 },
+ findings: [expect.objectContaining({ code: 'node-runtime-warning', severity: 'warning', count: 1 })] });
+ logs.ingest('stderr', 'unexpected native failure\n');
+ expect(logs.finish().passed).toBe(false);
+ },
+ );
+
+ it.each([
+ '[12:00:00.000] [error] [ (library)] (node:42) MaxListenersExceededWarning: fixture',
+ '[12:00:00.000] [error] [ (console)] failed after MaxListenersExceededWarning',
+ '[12:00:00.000] [error] [ (console)] (node:42) Error: MaxListenersExceededWarning',
+ ])('keeps listener-warning look-alikes as application errors: %s', line => {
+ const logs = createModelEvalLogCollector('packaged-launch-library');
+ logs.ingest('stderr', line);
+ expect(logs.finish()).toMatchObject({ passed: false,
+ findings: [expect.objectContaining({ code: 'runtime-error', severity: 'error' })] });
+ });
+
+});