Skip to content
Open
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
21 changes: 18 additions & 3 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,24 @@ class ConfigManager {

/* search section */
this.uiConfigSections.search.forEach((f) => {
if (f.env && !this.currentConfig.search[f.key]) {
this.currentConfig.search[f.key] =
process.env[f.env] ?? f.default ?? '';
if (!f.env) return;

const envValue = process.env[f.env]?.trim();
if (envValue) {
if (f.key === 'searxngURL') {
try {
new URL(envValue);
} catch {
return;
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Invalid SEARXNG_API_URL is silently ignored, leaving stale persisted search.searxngURL active and re-saved.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/lib/config/index.ts, line 239:

<comment>Invalid `SEARXNG_API_URL` is silently ignored, leaving stale persisted `search.searxngURL` active and re-saved.</comment>

<file context>
@@ -230,8 +230,16 @@ class ConfigManager {
+          try {
+            new URL(envValue);
+          } catch {
+            return;
+          }
+        }
</file context>
Suggested change
return;
this.currentConfig.search[f.key] = f.default ?? '';
return;
Fix with Cubic

}
}

this.currentConfig.search[f.key] = envValue;
return;
}

if (!this.currentConfig.search[f.key]) {
this.currentConfig.search[f.key] = f.default ?? '';
}
});

Expand Down