Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: extract isClaudeCliProvider helper, fix xhigh description, guard lazy reload loop, remove duplicate toast

Adam Eivy0ca6191de838
diff --git a/client/src/App.jsx b/client/src/App.jsx
index e7960c623b..ca41fa2140 100644
--- a/client/src/App.jsx
+++ b/client/src/App.jsx
@@ -22,11 +22,16 @@ import Instances from './pages/Instances';
import MeatSpace from './pages/MeatSpace';
// Auto-reload on stale chunk errors (e.g., after a rebuild changes chunk hashes)
+// Uses sessionStorage to prevent infinite reload loops (max 1 reload per session)
const lazyWithReload = (importFn) => lazy(() =>
importFn().catch(err => {
if (err.message?.includes('MIME type') || err.message?.includes('Failed to fetch dynamically imported module')) {
- window.location.reload();
- return new Promise(() => {}); // hang until reload completes
+ const key = 'lazyReloadAttempted';
+ if (!sessionStorage.getItem(key)) {
+ sessionStorage.setItem(key, '1');
+ window.location.reload();
+ return new Promise(() => {}); // hang until reload completes
+ }
}
throw err;
})
diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsx
index 404481aa13..b805962520 100644
--- a/client/src/components/cos/TaskAddForm.jsx
+++ b/client/src/components/cos/TaskAddForm.jsx
@@ -195,7 +195,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
})) : undefined,
position: addToTop ? 'top' : 'bottom'
}).catch(err => {
- toast.error(err.message);
+ console.warn('Failed to add COS task:', err);
setIsSubmitting(false);
return null;
});
diff --git a/server/services/subAgentSpawner.js b/server/services/subAgentSpawner.js
index f19a3dd0b7..b7de0e2256 100644
--- a/server/services/subAgentSpawner.js
+++ b/server/services/subAgentSpawner.js
@@ -1687,7 +1687,7 @@ async function spawnViaRunner(agentId, task, prompt, workspacePath, model, provi
// For Claude CLI providers, merge ~/.claude/settings.json env vars so Bedrock config
// (CLAUDE_CODE_USE_BEDROCK, AWS_PROFILE, etc.) is present in the runner spawn env
- const claudeSettingsEnv = provider.type === 'cli' && (provider.id === 'claude-code' || provider.id === 'claude-code-bedrock')
+ const claudeSettingsEnv = isClaudeCliProvider(provider)
? await getClaudeSettingsEnv()
: {};
@@ -1931,7 +1931,7 @@ async function spawnDirectly(agentId, task, prompt, workspacePath, model, provid
// For Claude CLI providers, inject ~/.claude/settings.json env vars so Bedrock config
// (CLAUDE_CODE_USE_BEDROCK, AWS_PROFILE, etc.) is present even if PM2 lacks them
- const claudeSettingsEnv = provider.type === 'cli' && (provider.id === 'claude-code' || provider.id === 'claude-code-bedrock')
+ const claudeSettingsEnv = isClaudeCliProvider(provider)
? await getClaudeSettingsEnv()
: {};
@@ -2404,6 +2404,12 @@ function buildSpawnArgs(config, model) {
* Ensures user's Bedrock/provider config (CLAUDE_CODE_USE_BEDROCK, AWS_PROFILE, etc.)
* is present in spawned agent environments even if PM2 was started without them
*/
+/**
+ * Check if a provider is a Claude CLI provider that needs settings.json env injection
+ */
+const isClaudeCliProvider = (provider) =>
+ provider?.type === 'cli' && (provider.id === 'claude-code' || provider.id === 'claude-code-bedrock');
+
let _claudeSettingsEnvCache = null;
let _claudeSettingsEnvCacheTime = 0;
const SETTINGS_CACHE_TTL_MS = 5 * 60 * 1000; // 5 minutes
diff --git a/server/services/thinkingLevels.js b/server/services/thinkingLevels.js
index 3fecea2329..100fac5da5 100644
--- a/server/services/thinkingLevels.js
+++ b/server/services/thinkingLevels.js
@@ -48,7 +48,7 @@ const THINKING_LEVELS = {
model: 'opus',
maxTokens: 16384,
localPreferred: false,
- description: 'Maximum reasoning with Opus'
+ description: 'Maximum reasoning with provider\'s heaviest model'
}
}