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

fix: pass silent to custom-catch call sites to prevent double toasts (#2026)

Adam Eivyaa840dbf34a8
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 765e510a04..275447b978 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -16,3 +16,4 @@
- Consolidated five component-local duration/uptime/time-until formatters onto the shared `utils/formatters.js` helpers (`formatDurationMs`, `timeUntil`), per the "do not re-define formatters inside components" convention (#2028). `formatDurationMs` gained a day bucket (`2d 3h`) so long uptimes no longer render as an unbounded hours count; ProcessesTab, CityHud, Shell session ages, the CoS QuickSummary "next job" countdown, and the Loops interval label now all route through the shared helpers, and a `console.log` in `memoryClassifier.js` was collapsed to a single interpolated line.
- Migration 155 heals `data/prompts/stages/cd-treatment.md` installs that #1808's anchor-based migration 148 left stranded (#2042). Installs seeded before the `imageStrength` scene knob (older pre-#1808 template) got the `## Cast & ingredients` list but missed the per-scene `"cast": [{ "ingredientId": … }]` field, so the Creative Director cast-threading regression test stayed red on the runtime template and migration 148 (already applied) never re-ran. The new hash-driven prompt-replace upgrades those copies (and both pristine pre-#1808 shipped versions) to the current shipped reference, leaving hand-customized copies untouched. Also folds `cd-treatment.md` into `buildPromptDriftTables` so setup-data.js's drift warning classifies a stranded copy correctly.
+- Fixed double error toasts across ~50 call sites that owned a custom `.catch` toast: they now pass `{ silent: true }` so the `apiCore.request()` default toast no longer fires alongside the component's own, per the "Silent vs. toasting API requests" convention (#2026). Also added the missing trailing `options = {}` passthrough to ~40 `api*.js` wrappers (CoS tasks/agents/jobs, Brain people/projects/ideas/admin/memories/buckets/inbox, GSD, memory approve/reject, app task-type overrides, feature-agent controls, browser/backup/system, MeatSpace POST drills, goals, messages) so callers can actually suppress the built-in toast. Sites whose `.catch` only reverts state (no toast) were intentionally left on the default single toast.
diff --git a/client/src/components/BackupWidget.jsx b/client/src/components/BackupWidget.jsx
index 1e139557d0..4c5ac01c85 100644
--- a/client/src/components/BackupWidget.jsx
+++ b/client/src/components/BackupWidget.jsx
@@ -71,7 +71,7 @@ function RestorePanel({ snapshot, onClose }) {
snapshotId: snapshot.id,
dryRun: true,
subdirFilter: filter.trim() || null
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(`Preview failed: ${err.message}`);
return null;
});
@@ -85,7 +85,7 @@ function RestorePanel({ snapshot, onClose }) {
snapshotId: snapshot.id,
dryRun: false,
subdirFilter: filter.trim() || null
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(`Restore failed: ${err.message}`);
return null;
});
@@ -278,7 +278,7 @@ const BackupWidget = memo(function BackupWidget() {
const handleBackupNow = useCallback(async () => {
setTriggering(true);
- await api.triggerBackup().catch(err => {
+ await api.triggerBackup({ silent: true }).catch(err => {
toast.error(`Backup failed: ${err.message}`);
}).then(result => {
if (result) {
diff --git a/client/src/components/QuickBrainCapture.jsx b/client/src/components/QuickBrainCapture.jsx
index 6c6c27b0f7..2d72cfa2d6 100644
--- a/client/src/components/QuickBrainCapture.jsx
+++ b/client/src/components/QuickBrainCapture.jsx
@@ -42,7 +42,7 @@ export default function QuickBrainCapture() {
toast.success(result.isGitHubRepo ? 'GitHub repo added' : 'Link saved');
}
} else {
- const result = await api.captureBrainThought(text, undefined, undefined, { creative }).catch(err => {
+ const result = await api.captureBrainThought(text, undefined, undefined, { creative }, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to capture thought');
setInput(prev => prev || text);
return null;
diff --git a/client/src/components/apps/SlashDoPanel.jsx b/client/src/components/apps/SlashDoPanel.jsx
index 2fd210f6c1..d18d9a064f 100644
--- a/client/src/components/apps/SlashDoPanel.jsx
+++ b/client/src/components/apps/SlashDoPanel.jsx
@@ -28,7 +28,7 @@ export default function SlashDoPanel({ appId, appType }) {
const handleRun = async (command) => {
setLoading(command.id);
- const result = await api.createSlashdoTask(command.id, appId).catch(err => {
+ const result = await api.createSlashdoTask(command.id, appId, { silent: true }).catch(err => {
toast.error(err.message || `Failed to queue ${command.label}`);
return null;
});
diff --git a/client/src/components/apps/tabs/AutomationTab.jsx b/client/src/components/apps/tabs/AutomationTab.jsx
index ae07179a53..97720026ab 100644
--- a/client/src/components/apps/tabs/AutomationTab.jsx
+++ b/client/src/components/apps/tabs/AutomationTab.jsx
@@ -46,7 +46,7 @@ export default function AutomationTab({ appId, appName }) {
const handleResume = async () => {
setResuming(true);
- const result = await api.resumeCos().catch(err => {
+ const result = await api.resumeCos({ silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -59,7 +59,7 @@ export default function AutomationTab({ appId, appName }) {
const handleToggle = async (taskType, isEnabled) => {
const newEnabled = !isEnabled;
- await api.updateAppTaskTypeOverride(appId, taskType, { enabled: newEnabled }).catch(err => {
+ await api.updateAppTaskTypeOverride(appId, taskType, { enabled: newEnabled }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -78,7 +78,7 @@ export default function AutomationTab({ appId, appName }) {
}
setCronEditing(prev => { const n = { ...prev }; delete n[taskType]; return n; });
const value = interval === 'null' ? null : interval;
- await api.updateAppTaskTypeOverride(appId, taskType, { interval: value }).catch(err => {
+ await api.updateAppTaskTypeOverride(appId, taskType, { interval: value }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -89,7 +89,7 @@ export default function AutomationTab({ appId, appName }) {
};
const handleCronSave = async (taskType, expr) => {
- await api.updateAppTaskTypeOverride(appId, taskType, { interval: expr }).catch(err => {
+ await api.updateAppTaskTypeOverride(appId, taskType, { interval: expr }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -102,7 +102,7 @@ export default function AutomationTab({ appId, appName }) {
const handleMetaToggle = async (taskType, field, globalTaskMetadata) => {
const taskMetadata = toggleAppMetadataOverride(overrides[taskType]?.taskMetadata, globalTaskMetadata, field);
- await api.updateAppTaskTypeOverride(appId, taskType, { taskMetadata }).catch(err => {
+ await api.updateAppTaskTypeOverride(appId, taskType, { taskMetadata }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -114,7 +114,7 @@ export default function AutomationTab({ appId, appName }) {
const handleTrigger = async (taskType) => {
setTriggering(taskType);
- const result = await api.triggerCosOnDemandTask(taskType, appId).catch(err => {
+ const result = await api.triggerCosOnDemandTask(taskType, appId, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -133,7 +133,7 @@ export default function AutomationTab({ appId, appName }) {
const handleToggleAll = async () => {
const newEnabled = !allEnabled;
- const result = await api.toggleAllAppTaskTypes(appId, newEnabled).catch(err => {
+ const result = await api.toggleAllAppTaskTypes(appId, newEnabled, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/brain/links/BucketBoard.jsx b/client/src/components/brain/links/BucketBoard.jsx
index 2448926cac..810de63339 100644
--- a/client/src/components/brain/links/BucketBoard.jsx
+++ b/client/src/components/brain/links/BucketBoard.jsx
@@ -20,7 +20,7 @@ export default function BucketBoard({ links, buckets, setBuckets, onAssignLink,
e.preventDefault();
const name = newName.trim();
if (!name) return;
- const bucket = await api.createBrainBucket({ name }).catch(err => {
+ const bucket = await api.createBrainBucket({ name }, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to create bucket');
return null;
});
@@ -32,7 +32,7 @@ export default function BucketBoard({ links, buckets, setBuckets, onAssignLink,
};
const handleUpdate = useCallback(async (id, patch) => {
- const updated = await api.updateBrainBucket(id, patch).catch(err => {
+ const updated = await api.updateBrainBucket(id, patch, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to update bucket');
return null;
});
@@ -40,7 +40,7 @@ export default function BucketBoard({ links, buckets, setBuckets, onAssignLink,
}, [setBuckets]);
const handleDelete = useCallback(async (id) => {
- const ok = await api.deleteBrainBucket(id).catch(err => {
+ const ok = await api.deleteBrainBucket(id, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to delete bucket');
return null;
});
@@ -77,7 +77,7 @@ export default function BucketBoard({ links, buckets, setBuckets, onAssignLink,
const next = [...prev];
const [moved] = next.splice(from, 1);
next.splice(to, 0, moved);
- api.reorderBrainBuckets(next.map(b => b.id)).catch(err => {
+ api.reorderBrainBuckets(next.map(b => b.id), { silent: true }).catch(err => {
toast.error(err.message || 'Failed to reorder buckets');
});
return next;
diff --git a/client/src/components/brain/links/BucketBoard.test.jsx b/client/src/components/brain/links/BucketBoard.test.jsx
index 3d13f48102..0605ee1ca5 100644
--- a/client/src/components/brain/links/BucketBoard.test.jsx
+++ b/client/src/components/brain/links/BucketBoard.test.jsx
@@ -135,7 +135,7 @@ describe('BucketBoard', () => {
fireEvent.change(screen.getByLabelText('New bucket name'), { target: { value: 'Reading' } });
fireEvent.click(screen.getByText('Create'));
- await waitFor(() => expect(api.createBrainBucket).toHaveBeenCalledWith({ name: 'Reading' }));
+ await waitFor(() => expect(api.createBrainBucket).toHaveBeenCalledWith({ name: 'Reading' }, { silent: true }));
expect(setBuckets).toHaveBeenCalled();
});
});
diff --git a/client/src/components/brain/tabs/ConfigTab.jsx b/client/src/components/brain/tabs/ConfigTab.jsx
index 912a78710d..02853f1f6a 100644
--- a/client/src/components/brain/tabs/ConfigTab.jsx
+++ b/client/src/components/brain/tabs/ConfigTab.jsx
@@ -104,7 +104,7 @@ export default function ConfigTab({ onRefresh }) {
const handleSaveEmbedding = async () => {
setSavingEmbedding(true);
const result = await api
- .updateCosConfig({ embeddingProviderId: embeddingProvider, embeddingModel })
+ .updateCosConfig({ embeddingProviderId: embeddingProvider, embeddingModel }, { silent: true })
.catch(err => { toast.error(err.message || 'Failed to save embedding config'); return null; });
setSavingEmbedding(false);
if (result) {
@@ -139,7 +139,7 @@ export default function ConfigTab({ onRefresh }) {
weeklyReviewTime
};
- const result = await api.updateBrainSettings(updatedSettings).catch(err => {
+ const result = await api.updateBrainSettings(updatedSettings, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to save settings');
return null;
});
diff --git a/client/src/components/brain/tabs/DigestTab.jsx b/client/src/components/brain/tabs/DigestTab.jsx
index 2497eb89aa..e00c26a7f9 100644
--- a/client/src/components/brain/tabs/DigestTab.jsx
+++ b/client/src/components/brain/tabs/DigestTab.jsx
@@ -45,7 +45,7 @@ export default function DigestTab({ onRefresh }) {
const handleRunDigest = async () => {
setRunningDigest(true);
- const result = await api.runBrainDigest().catch(err => {
+ const result = await api.runBrainDigest(undefined, undefined, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to generate digest');
return null;
});
@@ -60,7 +60,7 @@ export default function DigestTab({ onRefresh }) {
const handleRunReview = async () => {
setRunningReview(true);
- const result = await api.runBrainReview().catch(err => {
+ const result = await api.runBrainReview(undefined, undefined, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to generate review');
return null;
});
diff --git a/client/src/components/brain/tabs/InboxTab.jsx b/client/src/components/brain/tabs/InboxTab.jsx
index 71ff7aba91..b1b2e6bcd6 100644
--- a/client/src/components/brain/tabs/InboxTab.jsx
+++ b/client/src/components/brain/tabs/InboxTab.jsx
@@ -106,7 +106,7 @@ export default function InboxTab({ onRefresh, settings }) {
setInputText('');
setEntries(prev => [optimisticEntry, ...prev]);
- const result = await api.captureBrainThought(text, undefined, undefined, { creative }).catch(err => {
+ const result = await api.captureBrainThought(text, undefined, undefined, { creative }, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to capture thought');
setEntries(prev => prev.filter(e => e.id !== tempId));
return null;
@@ -121,7 +121,7 @@ export default function InboxTab({ onRefresh, settings }) {
};
const handleResolve = async (entryId, destination) => {
- const result = await api.resolveBrainReview(entryId, destination).catch(err => {
+ const result = await api.resolveBrainReview(entryId, destination, undefined, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to resolve');
return null;
});
@@ -136,7 +136,7 @@ export default function InboxTab({ onRefresh, settings }) {
const handleRetry = async (entryId) => {
if (retryingId) return;
setRetryingId(entryId);
- const result = await api.retryBrainClassification(entryId).catch(err => {
+ const result = await api.retryBrainClassification(entryId, undefined, undefined, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to retry');
return null;
});
@@ -155,7 +155,7 @@ export default function InboxTab({ onRefresh, settings }) {
return;
}
- const result = await api.fixBrainClassification(entryId, fixDestination).catch(err => {
+ const result = await api.fixBrainClassification(entryId, fixDestination, undefined, undefined, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to fix');
return null;
});
@@ -180,7 +180,7 @@ export default function InboxTab({ onRefresh, settings }) {
return;
}
- const result = await api.updateBrainInboxEntry(entryId, editText.trim()).catch(err => {
+ const result = await api.updateBrainInboxEntry(entryId, editText.trim(), { silent: true }).catch(err => {
toast.error(err.message || 'Failed to update');
return null;
});
@@ -201,7 +201,7 @@ export default function InboxTab({ onRefresh, settings }) {
const handleDelete = async (entryId) => {
let failed = false;
- await api.deleteBrainInboxEntry(entryId).catch(err => {
+ await api.deleteBrainInboxEntry(entryId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to delete');
failed = true;
});
@@ -214,7 +214,7 @@ export default function InboxTab({ onRefresh, settings }) {
};
const handleMarkDone = async (entryId) => {
- const result = await api.markBrainInboxDone(entryId).catch(err => {
+ const result = await api.markBrainInboxDone(entryId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to mark done');
return null;
});
diff --git a/client/src/components/brain/tabs/LinksTab.jsx b/client/src/components/brain/tabs/LinksTab.jsx
index 765b124a05..76e26ac0bd 100644
--- a/client/src/components/brain/tabs/LinksTab.jsx
+++ b/client/src/components/brain/tabs/LinksTab.jsx
@@ -270,7 +270,7 @@ export default function LinksTab({ onRefresh }) {
};
const handleDelete = async (linkId) => {
- const result = await api.deleteBrainLink(linkId).catch(err => {
+ const result = await api.deleteBrainLink(linkId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to delete');
return null;
});
@@ -283,7 +283,7 @@ export default function LinksTab({ onRefresh }) {
};
const handleClone = async (linkId) => {
- const result = await api.cloneBrainLink(linkId).catch(err => {
+ const result = await api.cloneBrainLink(linkId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to start clone');
return null;
});
@@ -295,7 +295,7 @@ export default function LinksTab({ onRefresh }) {
};
const handlePull = async (linkId) => {
- const result = await api.pullBrainLink(linkId).catch(err => {
+ const result = await api.pullBrainLink(linkId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to pull');
return null;
});
@@ -306,14 +306,14 @@ export default function LinksTab({ onRefresh }) {
};
const handleOpenFolder = async (linkId) => {
- await api.openBrainLinkFolder(linkId).catch(err => {
+ await api.openBrainLinkFolder(linkId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to open folder');
});
};
const handleScan = async (linkId) => {
setScanningId(linkId);
- const result = await api.scanBrainLink(linkId).catch(err => {
+ const result = await api.scanBrainLink(linkId, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to start scan');
return null;
});
diff --git a/client/src/components/brain/tabs/MemoryTab.jsx b/client/src/components/brain/tabs/MemoryTab.jsx
index 4f77e39a19..6e444a175c 100644
--- a/client/src/components/brain/tabs/MemoryTab.jsx
+++ b/client/src/components/brain/tabs/MemoryTab.jsx
@@ -91,25 +91,25 @@ export default function MemoryTab({ onRefresh }) {
let result;
switch (activeType) {
case 'people':
- result = await api.updateBrainPerson(editingId, editForm).catch(err => {
+ result = await api.updateBrainPerson(editingId, editForm, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'projects':
- result = await api.updateBrainProject(editingId, editForm).catch(err => {
+ result = await api.updateBrainProject(editingId, editForm, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'ideas':
- result = await api.updateBrainIdea(editingId, editForm).catch(err => {
+ result = await api.updateBrainIdea(editingId, editForm, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'admin':
- result = await api.updateBrainAdminItem(editingId, editForm).catch(err => {
+ result = await api.updateBrainAdminItem(editingId, editForm, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -117,7 +117,7 @@ export default function MemoryTab({ onRefresh }) {
case 'memories': {
const { tagInput, ...memData } = editForm;
if (tagInput != null) memData.tags = tagInput.split(',').map(s => s.trim()).filter(Boolean);
- result = await api.updateBrainMemory(editingId, memData).catch(err => {
+ result = await api.updateBrainMemory(editingId, memData, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -138,25 +138,25 @@ export default function MemoryTab({ onRefresh }) {
let result;
switch (activeType) {
case 'people':
- result = await api.createBrainPerson(addForm).catch(err => {
+ result = await api.createBrainPerson(addForm, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'projects':
- result = await api.createBrainProject({ ...addForm, status: addForm.status || 'active' }).catch(err => {
+ result = await api.createBrainProject({ ...addForm, status: addForm.status || 'active' }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'ideas':
- result = await api.createBrainIdea(addForm).catch(err => {
+ result = await api.createBrainIdea(addForm, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'admin':
- result = await api.createBrainAdminItem({ ...addForm, status: addForm.status || 'open' }).catch(err => {
+ result = await api.createBrainAdminItem({ ...addForm, status: addForm.status || 'open' }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -164,7 +164,7 @@ export default function MemoryTab({ onRefresh }) {
case 'memories': {
const { tagInput, ...memData } = addForm;
if (tagInput != null) memData.tags = tagInput.split(',').map(s => s.trim()).filter(Boolean);
- result = await api.createBrainMemory(memData).catch(err => {
+ result = await api.createBrainMemory(memData, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -185,31 +185,31 @@ export default function MemoryTab({ onRefresh }) {
let failed = false;
switch (activeType) {
case 'people':
- await api.deleteBrainPerson(id).catch(err => {
+ await api.deleteBrainPerson(id, { silent: true }).catch(err => {
toast.error(err.message);
failed = true;
});
break;
case 'projects':
- await api.deleteBrainProject(id).catch(err => {
+ await api.deleteBrainProject(id, { silent: true }).catch(err => {
toast.error(err.message);
failed = true;
});
break;
case 'ideas':
- await api.deleteBrainIdea(id).catch(err => {
+ await api.deleteBrainIdea(id, { silent: true }).catch(err => {
toast.error(err.message);
failed = true;
});
break;
case 'admin':
- await api.deleteBrainAdminItem(id).catch(err => {
+ await api.deleteBrainAdminItem(id, { silent: true }).catch(err => {
toast.error(err.message);
failed = true;
});
break;
case 'memories':
- await api.deleteBrainMemory(id).catch(err => {
+ await api.deleteBrainMemory(id, { silent: true }).catch(err => {
toast.error(err.message);
failed = true;
});
@@ -228,19 +228,19 @@ export default function MemoryTab({ onRefresh }) {
const update = { status: 'done' };
switch (activeType) {
case 'projects':
- result = await api.updateBrainProject(record.id, update).catch(err => {
+ result = await api.updateBrainProject(record.id, update, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'ideas':
- result = await api.updateBrainIdea(record.id, update).catch(err => {
+ result = await api.updateBrainIdea(record.id, update, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
break;
case 'admin':
- result = await api.updateBrainAdminItem(record.id, update).catch(err => {
+ result = await api.updateBrainAdminItem(record.id, update, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/brain/tabs/TrustTab.jsx b/client/src/components/brain/tabs/TrustTab.jsx
index 50f6b4593d..3e21da4308 100644
--- a/client/src/components/brain/tabs/TrustTab.jsx
+++ b/client/src/components/brain/tabs/TrustTab.jsx
@@ -56,7 +56,7 @@ export default function TrustTab({ onRefresh }) {
dailyDigestTime: settingsForm.dailyDigestTime,
weeklyReviewTime: settingsForm.weeklyReviewTime,
weeklyReviewDay: settingsForm.weeklyReviewDay
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to save settings');
return null;
});
diff --git a/client/src/components/cos/ActionableInsightsBanner.jsx b/client/src/components/cos/ActionableInsightsBanner.jsx
index 7b92d01749..c4f2315c1e 100644
--- a/client/src/components/cos/ActionableInsightsBanner.jsx
+++ b/client/src/components/cos/ActionableInsightsBanner.jsx
@@ -117,7 +117,7 @@ export default function ActionableInsightsBanner({ onTaskUnblocked }) {
};
const handleUnblockTask = async (taskId, taskType) => {
- const result = await api.updateCosTask(taskId, { status: 'pending', type: taskType }).catch(err => {
+ const result = await api.updateCosTask(taskId, { status: 'pending', type: taskType }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/cos/TaskAddForm.jsx b/client/src/components/cos/TaskAddForm.jsx
index d988561607..97632ed0d4 100644
--- a/client/src/components/cos/TaskAddForm.jsx
+++ b/client/src/components/cos/TaskAddForm.jsx
@@ -166,7 +166,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
provider: newTask.provider,
model: newTask.model,
app: newTask.app
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -184,7 +184,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
// Delete a user template
const deleteTemplate = useCallback(async (templateId, e) => {
e.stopPropagation();
- const result = await api.deleteCosTaskTemplate(templateId).catch(err => {
+ const result = await api.deleteCosTaskTemplate(templateId, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -274,7 +274,7 @@ export default function TaskAddForm({ providers, apps, onTaskAdded, compact = fa
mimeType: a.mimeType
})) : undefined,
position: addToTop ? 'top' : 'bottom'
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to add task');
return null;
});
diff --git a/client/src/components/cos/tabs/AgentCard.jsx b/client/src/components/cos/tabs/AgentCard.jsx
index 9559770820..072dcd9de8 100644
--- a/client/src/components/cos/tabs/AgentCard.jsx
+++ b/client/src/components/cos/tabs/AgentCard.jsx
@@ -151,7 +151,7 @@ export default function AgentCard({ agent, onPause, onKill, onDelete, onResume,
const result = await api.submitCosAgentFeedback(agent.id, {
rating,
comment: feedbackComment || undefined
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(`Failed to submit feedback: ${err.message}`);
return null;
});
@@ -192,7 +192,7 @@ export default function AgentCard({ agent, onPause, onKill, onDelete, onResume,
if (sendingBtw || !btwInput.trim()) return;
setSendingBtw(true);
- const result = await api.sendCosAgentBtw(agent.id, btwInput.trim()).catch(err => {
+ const result = await api.sendCosAgentBtw(agent.id, btwInput.trim(), { silent: true }).catch(err => {
toast.error(`Failed to send: ${err.message}`);
return null;
});
diff --git a/client/src/components/cos/tabs/AgentsTab.jsx b/client/src/components/cos/tabs/AgentsTab.jsx
index ebf990e4dc..631fdb4720 100644
--- a/client/src/components/cos/tabs/AgentsTab.jsx
+++ b/client/src/components/cos/tabs/AgentsTab.jsx
@@ -57,21 +57,21 @@ export default function AgentsTab({ agents, onRefresh, liveOutputs, providers, a
}, [dateBuckets, loadedDates]);
const handleKill = async (agentId) => {
- const result = await api.killCosAgent(agentId).catch(err => { toast.error(err.message); return null; });
+ const result = await api.killCosAgent(agentId, { silent: true }).catch(err => { toast.error(err.message); return null; });
if (!result) return;
toast.success('Agent force killed');
onRefresh();
};
const handlePause = async (agentId) => {
- const result = await api.pauseCosAgent(agentId, 'Paused from CoS agent list').catch(err => { toast.error(err.message); return null; });
+ const result = await api.pauseCosAgent(agentId, 'Paused from CoS agent list', { silent: true }).catch(err => { toast.error(err.message); return null; });
if (!result) return;
toast.success('Agent paused');
onRefresh();
};
const handleDelete = useCallback(async (agentId) => {
- const result = await api.deleteCosAgent(agentId).catch(err => { toast.error(err.message); return null; });
+ const result = await api.deleteCosAgent(agentId, { silent: true }).catch(err => { toast.error(err.message); return null; });
if (!result) return;
setLoadedAgents(prev => {
const deleted = prev.find(a => a.id === agentId);
@@ -100,7 +100,7 @@ export default function AgentsTab({ agents, onRefresh, liveOutputs, providers, a
app: app || undefined,
type,
screenshots
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -112,7 +112,7 @@ export default function AgentsTab({ agents, onRefresh, liveOutputs, providers, a
const handleClearCompleted = async () => {
setConfirmingClear(false);
- const result = await api.clearCompletedCosAgents().catch(err => { toast.error(err.message); return null; });
+ const result = await api.clearCompletedCosAgents({ silent: true }).catch(err => { toast.error(err.message); return null; });
if (!result) return;
setLoadedAgents([]);
setLoadedDates(new Set());
diff --git a/client/src/components/cos/tabs/ConfigTab.jsx b/client/src/components/cos/tabs/ConfigTab.jsx
index 4299e471a1..e5c278d30c 100644
--- a/client/src/components/cos/tabs/ConfigTab.jsx
+++ b/client/src/components/cos/tabs/ConfigTab.jsx
@@ -281,7 +281,7 @@ export default function ConfigTab({ config, onUpdate, onEvaluate, avatarStyle, s
const handleLevelChange = async (params) => {
const updatedData = { ...formData, ...params };
setFormData(updatedData);
- await api.updateCosConfig(params).catch(err => toast.error(err.message));
+ await api.updateCosConfig(params, { silent: true }).catch(err => toast.error(err.message));
onUpdate();
};
@@ -322,7 +322,7 @@ export default function ConfigTab({ config, onUpdate, onEvaluate, avatarStyle, s
};
const handleSave = async () => {
- await api.updateCosConfig(formData).catch(err => toast.error(err.message));
+ await api.updateCosConfig(formData, { silent: true }).catch(err => toast.error(err.message));
toast.success('Configuration updated');
setEditing(false);
onUpdate();
diff --git a/client/src/components/cos/tabs/GsdConcernsPanel.jsx b/client/src/components/cos/tabs/GsdConcernsPanel.jsx
index 9d0dfc7215..bd4a87d23c 100644
--- a/client/src/components/cos/tabs/GsdConcernsPanel.jsx
+++ b/client/src/components/cos/tabs/GsdConcernsPanel.jsx
@@ -24,7 +24,7 @@ export default function GsdConcernsPanel({ appId, concerns, onTaskCreated }) {
const handleCreateTask = async (concernId) => {
setCreating(concernId);
- const result = await api.createGsdConcernTasks(appId, { concernIds: [concernId] }).catch(err => {
+ const result = await api.createGsdConcernTasks(appId, { concernIds: [concernId] }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -37,7 +37,7 @@ export default function GsdConcernsPanel({ appId, concerns, onTaskCreated }) {
const handleCreateAll = async () => {
setCreating('all');
- const result = await api.createGsdConcernTasks(appId, { all: true }).catch(err => {
+ const result = await api.createGsdConcernTasks(appId, { all: true }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/cos/tabs/GsdProjectCard.jsx b/client/src/components/cos/tabs/GsdProjectCard.jsx
index 644c040f7a..dbc4c500a6 100644
--- a/client/src/components/cos/tabs/GsdProjectCard.jsx
+++ b/client/src/components/cos/tabs/GsdProjectCard.jsx
@@ -14,7 +14,7 @@ export default function GsdProjectCard({ project, onRefresh }) {
const loadDetail = async () => {
if (detail) return;
setLoading(true);
- const data = await api.getGsdProject(project.appId).catch(err => {
+ const data = await api.getGsdProject(project.appId, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/cos/tabs/JobsTab.jsx b/client/src/components/cos/tabs/JobsTab.jsx
index d05d53c835..1d430c6d59 100644
--- a/client/src/components/cos/tabs/JobsTab.jsx
+++ b/client/src/components/cos/tabs/JobsTab.jsx
@@ -307,7 +307,7 @@ function JobCard({ job, apps, providers, onToggle, onTrigger, onDelete, onUpdate
const handleSave = async () => {
const payload = normalizeJobPayload(editData);
- const result = await api.updateCosJob(job.id, payload).catch(err => {
+ const result = await api.updateCosJob(job.id, payload, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -620,7 +620,7 @@ export default function JobsTab() {
const [newJob, setNewJob] = useState(INITIAL_JOB);
const fetchJobs = useCallback(async () => {
- const data = await api.getCosJobs().catch(err => {
+ const data = await api.getCosJobs({ silent: true }).catch(err => {
toast.error(`Failed to load jobs: ${err.message}`);
return null;
});
@@ -659,7 +659,7 @@ export default function JobsTab() {
return;
}
- const created = await api.createCosJob(normalizeJobPayload(newJob)).catch(err => {
+ const created = await api.createCosJob(normalizeJobPayload(newJob), { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -671,7 +671,7 @@ export default function JobsTab() {
};
const handleToggle = async (jobId) => {
- const result = await api.toggleCosJob(jobId).catch(err => {
+ const result = await api.toggleCosJob(jobId, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -683,7 +683,7 @@ export default function JobsTab() {
const handleTrigger = async (jobId) => {
toast.loading('Triggering job...', { id: 'job-trigger' });
- const result = await api.triggerCosJob(jobId).catch(err => {
+ const result = await api.triggerCosJob(jobId, { silent: true }).catch(err => {
toast.error(err.message, { id: 'job-trigger' });
return null;
});
@@ -699,7 +699,7 @@ export default function JobsTab() {
};
const handleDelete = async (jobId) => {
- const result = await api.deleteCosJob(jobId).catch(err => {
+ const result = await api.deleteCosJob(jobId, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/cos/tabs/MemoryEditModal.jsx b/client/src/components/cos/tabs/MemoryEditModal.jsx
index 641d3d2e66..136328381a 100644
--- a/client/src/components/cos/tabs/MemoryEditModal.jsx
+++ b/client/src/components/cos/tabs/MemoryEditModal.jsx
@@ -61,7 +61,7 @@ export default function MemoryEditModal({ memory, apps, onSave, onClose }) {
sourceAppId: formData.sourceAppId || null,
importance: formData.importance,
confidence: formData.confidence
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(err.message || 'Failed to update memory');
return null;
});
diff --git a/client/src/components/cos/tabs/MemoryTab.jsx b/client/src/components/cos/tabs/MemoryTab.jsx
index 0bade1ba9f..9081f05226 100644
--- a/client/src/components/cos/tabs/MemoryTab.jsx
+++ b/client/src/components/cos/tabs/MemoryTab.jsx
@@ -88,7 +88,7 @@ export default function MemoryTab({ apps = [] }) {
if (actionRef.current) return;
actionRef.current = true;
setActionInFlight(id);
- const result = await action(id).catch(err => {
+ const result = await action(id, { silent: true }).catch(err => {
toast.error(err?.message || `Failed to ${label.toLowerCase()} memory`);
return null;
});
diff --git a/client/src/components/cos/tabs/ScheduleTab.jsx b/client/src/components/cos/tabs/ScheduleTab.jsx
index a96842003a..98ef529016 100644
--- a/client/src/components/cos/tabs/ScheduleTab.jsx
+++ b/client/src/components/cos/tabs/ScheduleTab.jsx
@@ -51,7 +51,7 @@ export default function ScheduleTab({ apps }) {
}, [fetchSchedule, fetchProviders]);
const handleUpdateTask = async (taskType, settings) => {
- const result = await api.updateCosTaskInterval(taskType, settings).catch(err => {
+ const result = await api.updateCosTaskInterval(taskType, settings, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -62,7 +62,7 @@ export default function ScheduleTab({ apps }) {
};
const handleTriggerTask = async (taskType, appId = null) => {
- const result = await api.triggerCosOnDemandTask(taskType, appId).catch(err => {
+ const result = await api.triggerCosOnDemandTask(taskType, appId, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -73,7 +73,7 @@ export default function ScheduleTab({ apps }) {
};
const handleResetTask = async (taskType) => {
- const result = await api.resetCosTaskHistory(taskType).catch(err => {
+ const result = await api.resetCosTaskHistory(taskType, null, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -86,7 +86,7 @@ export default function ScheduleTab({ apps }) {
const handleTriggerAppImprovement = (taskType, appId) => handleTriggerTask(taskType, appId);
const handleUpdateAppOverride = async (appId, taskType, { enabled, interval, taskMetadata }) => {
- const result = await api.updateAppTaskTypeOverride(appId, taskType, { enabled, interval, taskMetadata }).catch(err => {
+ const result = await api.updateAppTaskTypeOverride(appId, taskType, { enabled, interval, taskMetadata }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -98,7 +98,7 @@ export default function ScheduleTab({ apps }) {
};
const handleBulkToggleOverride = async (taskType, enabled) => {
- const result = await api.bulkUpdateAppTaskTypeOverride(taskType, { enabled }).catch(err => {
+ const result = await api.bulkUpdateAppTaskTypeOverride(taskType, { enabled }, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/components/cos/tabs/TaskItem.jsx b/client/src/components/cos/tabs/TaskItem.jsx
index 2bce81e2a6..c8cf5ce37e 100644
--- a/client/src/components/cos/tabs/TaskItem.jsx
+++ b/client/src/components/cos/tabs/TaskItem.jsx
@@ -160,7 +160,7 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
if (newStatus === 'blocked' && blockedReasonText) {
updates.blockedReason = blockedReasonText;
}
- const result = await api.updateCosTask(task.id, updates).catch(err => { toast.error(err.message); return null; });
+ const result = await api.updateCosTask(task.id, updates, { silent: true }).catch(err => { toast.error(err.message); return null; });
if (!result) return;
toast.success(`Task marked as ${newStatus}`);
onRefresh();
@@ -178,7 +178,7 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
};
const handleSave = async () => {
- const result = await api.updateCosTask(task.id, editData).catch(err => {
+ const result = await api.updateCosTask(task.id, editData, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -190,14 +190,14 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
const handleDelete = async () => {
const taskType = isSystem ? 'internal' : 'user';
- const result = await api.deleteCosTask(task.id, taskType).catch(err => { toast.error(err.message); return null; });
+ const result = await api.deleteCosTask(task.id, taskType, { silent: true }).catch(err => { toast.error(err.message); return null; });
if (!result) return;
toast.success('Task deleted');
onRefresh();
};
const handleApprove = async () => {
- const result = await api.approveCosTask(task.id).catch(err => {
+ const result = await api.approveCosTask(task.id, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -407,7 +407,7 @@ export default function TaskItem({ task, isSystem, awaitingApproval, onRefresh,
{task.status === 'pending' && !task.approvalRequired && (
<button
onClick={async () => {
- const result = await api.forceSpawnTask(task.id).catch(err => { toast.error(err.message); return null; });
+ const result = await api.forceSpawnTask(task.id, { silent: true }).catch(err => { toast.error(err.message); return null; });
if (result?.success) toast.success(`Spawning ${task.id}`);
if (onRefresh) onRefresh();
}}
diff --git a/client/src/components/cos/tabs/TasksTab.jsx b/client/src/components/cos/tabs/TasksTab.jsx
index b5ebfcbc64..4c4485a0c9 100644
--- a/client/src/components/cos/tabs/TasksTab.jsx
+++ b/client/src/components/cos/tabs/TasksTab.jsx
@@ -124,7 +124,7 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
// Persist to server
const taskIds = newOrder.map(t => t.id);
- const result = await api.reorderCosTasks(taskIds).catch(err => {
+ const result = await api.reorderCosTasks(taskIds, { silent: true }).catch(err => {
toast.error(err.message);
setUserTasksLocal(userTasks); // Revert on error
return null;
@@ -143,7 +143,7 @@ export default function TasksTab({ tasks, onRefresh, providers, apps }) {
<h3 className="text-lg font-semibold text-white">User Tasks (TASKS.md)</h3>
<button
onClick={async () => {
- await api.forceCosEvaluate().catch(err => toast.error(err.message));
+ await api.forceCosEvaluate({ silent: true }).catch(err => toast.error(err.message));
toast.success('Evaluation triggered');
}}
className="flex items-center gap-1 text-sm bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-400 px-3 py-1.5 rounded-lg transition-colors"
diff --git a/client/src/components/goals/GoalsListView.jsx b/client/src/components/goals/GoalsListView.jsx
index 8049c5c02b..afbd3dc65f 100644
--- a/client/src/components/goals/GoalsListView.jsx
+++ b/client/src/components/goals/GoalsListView.jsx
@@ -296,7 +296,7 @@ export default function GoalsListView({ data, onRefresh }) {
if (!dragGoal.parentId) return; // already a root goal
}
- const result = await api.updateGoal(dragGoal.id, { parentId: newParentId }).catch(err => {
+ const result = await api.updateGoal(dragGoal.id, { parentId: newParentId }, { silent: true }).catch(err => {
toast.error(err?.message || 'Failed to move goal');
return null;
});
diff --git a/client/src/components/messages/InboxTab.jsx b/client/src/components/messages/InboxTab.jsx
index 3ec410e000..b425d2f516 100644
--- a/client/src/components/messages/InboxTab.jsx
+++ b/client/src/components/messages/InboxTab.jsx
@@ -114,7 +114,7 @@ export default function InboxTab({ accounts }) {
let totalPruned = 0;
for (const acct of targets) {
toast(`Syncing ${acct.name} (${mode})...`, { icon: '📧' });
- const result = await api.syncMessageAccount(acct.id, mode).catch(err => {
+ const result = await api.syncMessageAccount(acct.id, mode, { silent: true }).catch(err => {
toast.error(`${acct.name}: ${err?.message || 'Sync failed'}`);
return null;
});
@@ -174,7 +174,7 @@ export default function InboxTab({ accounts }) {
}
setActionInProgress(msg.id);
toast(`${action === 'archive' ? 'Archiving' : 'Deleting'}...`, { icon: '📧' });
- const result = await api.executeMessageAction(msg.accountId, msg.id, action).catch(err => {
+ const result = await api.executeMessageAction(msg.accountId, msg.id, action, { silent: true }).catch(err => {
toast.error(err?.message || `${action} failed`);
return null;
});
diff --git a/client/src/hooks/usePostSession.js b/client/src/hooks/usePostSession.js
index 20d6f3000f..511f06ae03 100644
--- a/client/src/hooks/usePostSession.js
+++ b/client/src/hooks/usePostSession.js
@@ -81,7 +81,7 @@ export function usePostSession() {
setLastAnswer(null);
const first = drillConfigs[0];
- const drill = await generatePostDrill(first.type, first.config, first.providerId, first.model).catch(err => {
+ const drill = await generatePostDrill(first.type, first.config, first.providerId, first.model, { silent: true }).catch(err => {
toast.error(`Failed to generate drill: ${err.message}`);
setState(STATES.IDLE);
return null;
@@ -217,7 +217,7 @@ export function usePostSession() {
setState(STATES.LOADING);
const next = drills[nextIndex];
- const drill = await generatePostDrill(next.type, next.config, next.providerId, next.model).catch(err => {
+ const drill = await generatePostDrill(next.type, next.config, next.providerId, next.model, { silent: true }).catch(err => {
toast.error(`Failed to generate drill: ${err.message}`);
setState(STATES.IDLE);
return null;
@@ -260,7 +260,7 @@ export function usePostSession() {
const timeLimitMs = (drillConfig?.timeLimitSec || 120) * 1000;
const scoreResult = await scorePostLlmDrill(
drillResult.type, drillResult.drillData, drillResult.responses,
- timeLimitMs, drillConfig?.providerId, drillConfig?.model
+ timeLimitMs, drillConfig?.providerId, drillConfig?.model, { silent: true }
).catch(err => {
toast.error(`LLM scoring failed: ${err.message}`);
return null;
@@ -333,7 +333,7 @@ export function usePostSession() {
modules,
tasks: drillResults,
tags
- }).catch(err => {
+ }, { silent: true }).catch(err => {
toast.error(`Failed to save session: ${err.message}`);
setState(STATES.COMPLETE);
return null;
diff --git a/client/src/pages/Browser.jsx b/client/src/pages/Browser.jsx
index b0907cee42..b8ff50503e 100644
--- a/client/src/pages/Browser.jsx
+++ b/client/src/pages/Browser.jsx
@@ -85,7 +85,7 @@ export default function BrowserPage() {
const handleAction = useCallback(async (action, fn) => {
setActionLoading(action);
- const result = await fn().catch(err => {
+ const result = await fn({ silent: true }).catch(err => {
toast.error(`Failed to ${action}: ${err.message}`);
return null;
});
@@ -99,7 +99,7 @@ export default function BrowserPage() {
const handleSaveConfig = useCallback(async () => {
if (!configDraft) return;
- const saved = await updateBrowserConfig(configDraft).catch(err => {
+ const saved = await updateBrowserConfig(configDraft, { silent: true }).catch(err => {
toast.error(`Failed to save config: ${err.message}`);
return null;
});
@@ -111,7 +111,7 @@ export default function BrowserPage() {
}, [configDraft]);
const handleDeleteDownload = useCallback(async (name) => {
- const ok = await deleteBrowserDownload(name).then(() => true).catch(err => {
+ const ok = await deleteBrowserDownload(name, { silent: true }).then(() => true).catch(err => {
toast.error(`Failed to delete: ${err.message}`);
return false;
});
@@ -480,7 +480,7 @@ export default function BrowserPage() {
onClick={() => {
setNavUrl(url);
setActionLoading('navigate');
- navigateBrowser(url).then(() => {
+ navigateBrowser(url, { silent: true }).then(() => {
toast.success(`Opened ${label}`);
setNavUrl('');
fetchStatus();
diff --git a/client/src/pages/CharacterSheet.jsx b/client/src/pages/CharacterSheet.jsx
index cfe3cca642..02a97397f9 100644
--- a/client/src/pages/CharacterSheet.jsx
+++ b/client/src/pages/CharacterSheet.jsx
@@ -216,7 +216,7 @@ export default function CharacterSheet() {
// The route persists `avatarPath` onto the character server-side
// (persistToCharacter), so no follow-up charPut is needed — keep the
// optimistic setChar for instant feedback.
- generateAvatar({ name: char.name, characterClass: char.class, persistToCharacter: true })
+ generateAvatar({ name: char.name, characterClass: char.class, persistToCharacter: true }, { silent: true })
.then(result => {
setChar(prev => ({ ...prev, avatarPath: result.path }));
})
diff --git a/client/src/pages/ChiefOfStaff.jsx b/client/src/pages/ChiefOfStaff.jsx
index 16e9d702d2..2252fac8a3 100644
--- a/client/src/pages/ChiefOfStaff.jsx
+++ b/client/src/pages/ChiefOfStaff.jsx
@@ -297,7 +297,7 @@ export default function ChiefOfStaff() {
}, [socket, fetchData]);
const handleStart = async () => {
- const result = await api.startCos().catch(err => {
+ const result = await api.startCos({ silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -312,7 +312,7 @@ export default function ChiefOfStaff() {
};
const handleStop = async () => {
- const result = await api.stopCos().catch(err => {
+ const result = await api.stopCos({ silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -325,7 +325,7 @@ export default function ChiefOfStaff() {
};
const handleForceEvaluate = async () => {
- await api.forceCosEvaluate().catch(err => toast.error(err.message));
+ await api.forceCosEvaluate({ silent: true }).catch(err => toast.error(err.message));
toast.success('Evaluation triggered');
setAgentState('thinking');
setStatusMessage("Evaluating tasks...");
@@ -366,7 +366,7 @@ export default function ChiefOfStaff() {
setAgentState('investigating');
setStatusMessage("Running system health check...");
setSpeaking(true);
- const result = await api.forceHealthCheck().catch(err => {
+ const result = await api.forceHealthCheck({ silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/pages/FeatureAgentDetail.jsx b/client/src/pages/FeatureAgentDetail.jsx
index 2133535686..fcb3fcc61a 100644
--- a/client/src/pages/FeatureAgentDetail.jsx
+++ b/client/src/pages/FeatureAgentDetail.jsx
@@ -47,19 +47,19 @@ export default function FeatureAgentDetail() {
}, [fetchAgent, id]);
const handleStart = useCallback((agentId) => {
- api.startFeatureAgent(agentId).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Activated'); }).catch(err => toast.error(err.message || 'Action failed'));
+ api.startFeatureAgent(agentId, { silent: true }).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Activated'); }).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handlePause = useCallback((agentId) => {
- api.pauseFeatureAgent(agentId).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Paused'); }).catch(err => toast.error(err.message || 'Action failed'));
+ api.pauseFeatureAgent(agentId, { silent: true }).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Paused'); }).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleResume = useCallback((agentId) => {
- api.resumeFeatureAgent(agentId).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Resumed'); }).catch(err => toast.error(err.message || 'Action failed'));
+ api.resumeFeatureAgent(agentId, { silent: true }).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Resumed'); }).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleStop = useCallback((agentId) => {
- api.stopFeatureAgent(agentId).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Stopped'); }).catch(err => toast.error(err.message || 'Action failed'));
+ api.stopFeatureAgent(agentId, { silent: true }).then(data => { setAgent(prev => ({ ...prev, ...data })); toast.success('Stopped'); }).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleTrigger = useCallback((agentId) => {
- api.triggerFeatureAgent(agentId).then(() => toast.success('Run triggered')).catch(err => toast.error(err.message || 'Action failed'));
+ api.triggerFeatureAgent(agentId, { silent: true }).then(() => toast.success('Run triggered')).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleSave = useCallback((saved) => {
diff --git a/client/src/pages/FeatureAgents.jsx b/client/src/pages/FeatureAgents.jsx
index 9fc4a3b9a0..bc27cb6c2c 100644
--- a/client/src/pages/FeatureAgents.jsx
+++ b/client/src/pages/FeatureAgents.jsx
@@ -31,41 +31,41 @@ export default function FeatureAgents() {
}, [fetchAgents]);
const handleStart = useCallback((id) => {
- api.startFeatureAgent(id).then(agent => {
+ api.startFeatureAgent(id, { silent: true }).then(agent => {
setAgents(prev => prev.map(a => a.id === id ? { ...a, ...agent } : a));
toast.success('Feature agent activated');
}).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handlePause = useCallback((id) => {
- api.pauseFeatureAgent(id).then(agent => {
+ api.pauseFeatureAgent(id, { silent: true }).then(agent => {
setAgents(prev => prev.map(a => a.id === id ? { ...a, ...agent } : a));
toast.success('Feature agent paused');
}).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleResume = useCallback((id) => {
- api.resumeFeatureAgent(id).then(agent => {
+ api.resumeFeatureAgent(id, { silent: true }).then(agent => {
setAgents(prev => prev.map(a => a.id === id ? { ...a, ...agent } : a));
toast.success('Feature agent resumed');
}).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleStop = useCallback((id) => {
- api.stopFeatureAgent(id).then(agent => {
+ api.stopFeatureAgent(id, { silent: true }).then(agent => {
setAgents(prev => prev.map(a => a.id === id ? { ...a, ...agent } : a));
toast.success('Feature agent stopped');
}).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleTrigger = useCallback((id) => {
- api.triggerFeatureAgent(id).then(() => {
+ api.triggerFeatureAgent(id, { silent: true }).then(() => {
toast.success('Run triggered');
}).catch(err => toast.error(err.message || 'Action failed'));
}, []);
const handleDelete = useCallback((id) => {
- api.deleteFeatureAgent(id).then(() => {
+ api.deleteFeatureAgent(id, { silent: true }).then(() => {
setAgents(prev => prev.filter(a => a.id !== id));
toast.success('Feature agent deleted');
}).catch(err => toast.error(err.message || 'Action failed'));
diff --git a/client/src/pages/SystemHealthPage.jsx b/client/src/pages/SystemHealthPage.jsx
index d2050d7986..80942a9f3f 100644
--- a/client/src/pages/SystemHealthPage.jsx
+++ b/client/src/pages/SystemHealthPage.jsx
@@ -48,7 +48,7 @@ export default function SystemHealthPage() {
const handleSaveThresholds = async () => {
if (!draft) return;
setSaving(true);
- const result = await api.updateHealthThresholds(draft).catch(err => {
+ const result = await api.updateHealthThresholds(draft, { silent: true }).catch(err => {
toast.error(err?.message || 'Failed to save thresholds');
return null;
});
diff --git a/client/src/pages/Uploads.jsx b/client/src/pages/Uploads.jsx
index 1f352874d8..2e747ae745 100644
--- a/client/src/pages/Uploads.jsx
+++ b/client/src/pages/Uploads.jsx
@@ -32,7 +32,7 @@ export default function Uploads() {
const fileInputRef = useRef(null);
const fetchUploads = useCallback(async () => {
- const data = await api.listUploads().catch(err => {
+ const data = await api.listUploads({ silent: true }).catch(err => {
toast.error(err.message);
return { uploads: [], count: 0, totalSizeFormatted: '0 B' };
});
@@ -78,7 +78,7 @@ export default function Uploads() {
continue;
}
- const result = await api.uploadFile(base64, file.name).catch(err => {
+ const result = await api.uploadFile(base64, file.name, { silent: true }).catch(err => {
toast.error(`Failed to upload "${file.name}": ${err.message}`);
return null;
});
@@ -93,7 +93,7 @@ export default function Uploads() {
};
const handleDelete = async (filename) => {
- const result = await api.deleteUpload(filename).catch(err => {
+ const result = await api.deleteUpload(filename, { silent: true }).catch(err => {
toast.error(err.message);
return null;
});
@@ -110,7 +110,7 @@ export default function Uploads() {
return;
}
- const result = await api.deleteAllUploads().catch(err => {
+ const result = await api.deleteAllUploads({ silent: true }).catch(err => {
toast.error(err.message);
return null;
});
diff --git a/client/src/services/apiAgents.js b/client/src/services/apiAgents.js
index 0d56e0a174..85910f1d24 100644
--- a/client/src/services/apiAgents.js
+++ b/client/src/services/apiAgents.js
@@ -43,7 +43,7 @@ export const pauseCos = (reason) => request('/cos/pause', {
method: 'POST',
body: JSON.stringify({ reason })
});
-export const resumeCos = () => request('/cos/resume', { method: 'POST' });
+export const resumeCos = (options = {}) => request('/cos/resume', { method: 'POST', ...options });
export const getCosConfig = () => request('/cos/config');
export const updateCosConfig = (config, options = {}) => request('/cos/config', {
method: 'PUT',
@@ -53,13 +53,15 @@ export const updateCosConfig = (config, options = {}) => request('/cos/config',
// Today's per-domain autonomy usage (#711) for the Domain Budgets panel.
export const getCosBudgetUsage = (options = {}) => request('/cos/budget-usage', options);
export const getCosTasks = (options) => request('/cos/tasks', options);
-export const addCosTask = (task) => request('/cos/tasks', {
+export const addCosTask = (task, options = {}) => request('/cos/tasks', {
method: 'POST',
- body: JSON.stringify(task)
+ body: JSON.stringify(task),
+ ...options
});
-export const createSlashdoTask = (command, app) => request('/cos/tasks/slashdo', {
+export const createSlashdoTask = (command, app, options = {}) => request('/cos/tasks/slashdo', {
method: 'POST',
- body: JSON.stringify({ command, app })
+ body: JSON.stringify({ command, app }),
+ ...options
});
// Queue a CoS task to implement one specific JIRA ticket (sprint-board play button).
export const createJiraTicketTask = (app, ticketKey, options = {}) => request('/cos/tasks/jira-ticket', {
@@ -77,9 +79,10 @@ export const updateCosTask = (id, updates, options = {}) => request(`/cos/tasks/
...options
});
export const deleteCosTask = (id, taskType = 'user', options = {}) => request(`/cos/tasks/${id}?type=${taskType}`, { method: 'DELETE', ...options });
-export const reorderCosTasks = (taskIds) => request('/cos/tasks/reorder', {
+export const reorderCosTasks = (taskIds, options = {}) => request('/cos/tasks/reorder', {
method: 'POST',
- body: JSON.stringify({ taskIds })
+ body: JSON.stringify({ taskIds }),
+ ...options
});
export const approveCosTask = (id, options = {}) => request(`/cos/tasks/${id}/approve`, { method: 'POST', ...options });
export const forceCosEvaluate = (options = {}) => request('/cos/evaluate', { method: 'POST', ...options });
@@ -101,13 +104,15 @@ export const getCosAgentStats = (id, options) => request(`/cos/agents/${id}/stat
export const getCosAgentPrompt = (id) => request(`/cos/agents/${id}/prompt`);
export const deleteCosAgent = (id, options = {}) => request(`/cos/agents/${id}`, { method: 'DELETE', ...options });
export const clearCompletedCosAgents = (options = {}) => request('/cos/agents/completed', { method: 'DELETE', ...options });
-export const submitCosAgentFeedback = (id, feedback) => request(`/cos/agents/${id}/feedback`, {
+export const submitCosAgentFeedback = (id, feedback, options = {}) => request(`/cos/agents/${id}/feedback`, {
method: 'POST',
- body: JSON.stringify(feedback)
+ body: JSON.stringify(feedback),
+ ...options
});
-export const sendCosAgentBtw = (id, message) => request(`/cos/agents/${id}/btw`, {
+export const sendCosAgentBtw = (id, message, options = {}) => request(`/cos/agents/${id}/btw`, {
method: 'POST',
- body: JSON.stringify({ message })
+ body: JSON.stringify({ message }),
+ ...options
});
export const getCosFeedbackStats = () => request('/cos/feedback/stats');
export const getCosReports = () => request('/cos/reports');
@@ -151,9 +156,10 @@ export const clearDismissedCosRecommendations = () => request('/cos/learning/rec
export const getCosTaskTemplates = () => request('/cos/templates');
export const getCosPopularTemplates = (limit = 5) => request(`/cos/templates/popular?limit=${limit}`);
export const getCosTemplateCategories = () => request('/cos/templates/categories');
-export const createCosTaskTemplate = (data) => request('/cos/templates', {
+export const createCosTaskTemplate = (data, options = {}) => request('/cos/templates', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
export const createCosTemplateFromTask = (task, templateName) => request('/cos/templates/from-task', {
method: 'POST',
@@ -164,7 +170,7 @@ export const updateCosTaskTemplate = (id, data) => request(`/cos/templates/${id}
method: 'PUT',
body: JSON.stringify(data)
});
-export const deleteCosTaskTemplate = (id) => request(`/cos/templates/${id}`, { method: 'DELETE' });
+export const deleteCosTaskTemplate = (id, options = {}) => request(`/cos/templates/${id}`, { method: 'DELETE', ...options });
// Weekly Digest
export const getCosWeeklyDigest = (weekId = null) => {
@@ -212,22 +218,25 @@ export const getCosScheduleIntervalTypes = () => request('/cos/schedule/interval
export const getCosScheduleDueTasks = () => request('/cos/schedule/due');
export const getCosScheduleDueAppTasks = (appId) => request(`/cos/schedule/due/${appId}`);
// Unified task interval update
-export const updateCosTaskInterval = (taskType, settings) => request(`/cos/schedule/task/${taskType}`, {
+export const updateCosTaskInterval = (taskType, settings, options = {}) => request(`/cos/schedule/task/${taskType}`, {
method: 'PUT',
- body: JSON.stringify(settings)
+ body: JSON.stringify(settings),
+ ...options
});
// Deprecated aliases — delegate to unified endpoint
export const updateCosSelfImprovementInterval = (taskType, settings) => updateCosTaskInterval(taskType, settings);
export const updateCosAppImprovementInterval = (taskType, settings) => updateCosTaskInterval(taskType, settings);
-export const triggerCosOnDemandTask = (taskType, appId = null) => request('/cos/schedule/trigger', {
+export const triggerCosOnDemandTask = (taskType, appId = null, options = {}) => request('/cos/schedule/trigger', {
method: 'POST',
- body: JSON.stringify({ taskType, appId })
+ body: JSON.stringify({ taskType, appId }),
+ ...options
});
export const getCosOnDemandRequests = () => request('/cos/schedule/on-demand');
-export const resetCosTaskHistory = (taskType, appId = null) => request('/cos/schedule/reset', {
+export const resetCosTaskHistory = (taskType, appId = null, options = {}) => request('/cos/schedule/reset', {
method: 'POST',
- body: JSON.stringify({ taskType, appId })
+ body: JSON.stringify({ taskType, appId }),
+ ...options
});
export const getCosScheduleTemplates = () => request('/cos/schedule/templates');
export const addCosScheduleTemplate = (template) => request('/cos/schedule/templates', {
@@ -270,11 +279,11 @@ export const updateFeatureAgent = (id, data) => request(`/feature-agents/${id}`,
method: 'PUT',
body: JSON.stringify(data)
});
-export const deleteFeatureAgent = (id) => request(`/feature-agents/${id}`, { method: 'DELETE' });
-export const startFeatureAgent = (id) => request(`/feature-agents/${id}/start`, { method: 'POST' });
-export const pauseFeatureAgent = (id) => request(`/feature-agents/${id}/pause`, { method: 'POST' });
-export const resumeFeatureAgent = (id) => request(`/feature-agents/${id}/resume`, { method: 'POST' });
-export const triggerFeatureAgent = (id) => request(`/feature-agents/${id}/trigger`, { method: 'POST' });
-export const stopFeatureAgent = (id) => request(`/feature-agents/${id}/stop`, { method: 'POST' });
+export const deleteFeatureAgent = (id, options = {}) => request(`/feature-agents/${id}`, { method: 'DELETE', ...options });
+export const startFeatureAgent = (id, options = {}) => request(`/feature-agents/${id}/start`, { method: 'POST', ...options });
+export const pauseFeatureAgent = (id, options = {}) => request(`/feature-agents/${id}/pause`, { method: 'POST', ...options });
+export const resumeFeatureAgent = (id, options = {}) => request(`/feature-agents/${id}/resume`, { method: 'POST', ...options });
+export const triggerFeatureAgent = (id, options = {}) => request(`/feature-agents/${id}/trigger`, { method: 'POST', ...options });
+export const stopFeatureAgent = (id, options = {}) => request(`/feature-agents/${id}/stop`, { method: 'POST', ...options });
export const getFeatureAgentRuns = (id, limit) => request(`/feature-agents/${id}/runs${limit ? `?limit=${limit}` : ''}`);
export const getFeatureAgentOutput = (id) => request(`/feature-agents/${id}/output`);
diff --git a/client/src/services/apiApps.js b/client/src/services/apiApps.js
index d11bb311e2..874c9f2276 100644
--- a/client/src/services/apiApps.js
+++ b/client/src/services/apiApps.js
@@ -69,17 +69,20 @@ export const pullAndUpdateApp = (id) => request(`/apps/${id}/update`, { method:
export const buildApp = (id) => request(`/apps/${id}/build`, { method: 'POST' });
export const getAppStatus = (id) => request(`/apps/${id}/status`);
export const getAppTaskTypes = (id) => request(`/apps/${id}/task-types`);
-export const toggleAllAppTaskTypes = (id, enabled) => request(`/apps/${id}/task-types/all`, {
+export const toggleAllAppTaskTypes = (id, enabled, options = {}) => request(`/apps/${id}/task-types/all`, {
method: 'PUT',
- body: JSON.stringify({ enabled })
+ body: JSON.stringify({ enabled }),
+ ...options
});
-export const updateAppTaskTypeOverride = (id, taskType, { enabled, interval, taskMetadata } = {}) => request(`/apps/${id}/task-types/${taskType}`, {
+export const updateAppTaskTypeOverride = (id, taskType, { enabled, interval, taskMetadata } = {}, options = {}) => request(`/apps/${id}/task-types/${taskType}`, {
method: 'PUT',
- body: JSON.stringify({ enabled, interval, taskMetadata })
+ body: JSON.stringify({ enabled, interval, taskMetadata }),
+ ...options
});
-export const bulkUpdateAppTaskTypeOverride = (taskType, { enabled }) => request(`/apps/bulk-task-type/${taskType}`, {
+export const bulkUpdateAppTaskTypeOverride = (taskType, { enabled }, options = {}) => request(`/apps/bulk-task-type/${taskType}`, {
method: 'PUT',
- body: JSON.stringify({ enabled })
+ body: JSON.stringify({ enabled }),
+ ...options
});
export const detectAppIcons = () => request('/apps/detect-icons', { method: 'POST' });
export const detectAppIcon = (id) => request(`/apps/${id}/detect-icon`, { method: 'POST' });
diff --git a/client/src/services/apiBrain.js b/client/src/services/apiBrain.js
index 0f9d1bcb15..6ac7640de2 100644
--- a/client/src/services/apiBrain.js
+++ b/client/src/services/apiBrain.js
@@ -3,15 +3,17 @@ import { request } from './apiCore.js';
// Brain - Second Brain Feature
export const getBrainSummary = (options) => request('/brain/summary', options);
export const getBrainSettings = (options) => request('/brain/settings', options);
-export const updateBrainSettings = (settings) => request('/brain/settings', {
+export const updateBrainSettings = (settings, options = {}) => request('/brain/settings', {
method: 'PUT',
- body: JSON.stringify(settings)
+ body: JSON.stringify(settings),
+ ...options
});
// Brain - Capture & Inbox
-export const captureBrainThought = (text, providerOverride, modelOverride, { creative } = {}) => request('/brain/capture', {
+export const captureBrainThought = (text, providerOverride, modelOverride, { creative } = {}, options = {}) => request('/brain/capture', {
method: 'POST',
- body: JSON.stringify({ text, providerOverride, modelOverride, creative })
+ body: JSON.stringify({ text, providerOverride, modelOverride, creative }),
+ ...options
});
export const getBrainInbox = (options = {}) => {
const params = new URLSearchParams();
@@ -24,24 +26,28 @@ export const getBrainInbox = (options = {}) => {
return request(`/brain/inbox?${params}`, { silent: options.silent });
};
export const getBrainInboxEntry = (id) => request(`/brain/inbox/${id}`);
-export const resolveBrainReview = (inboxLogId, destination, editedExtracted) => request('/brain/review/resolve', {
+export const resolveBrainReview = (inboxLogId, destination, editedExtracted, options = {}) => request('/brain/review/resolve', {
method: 'POST',
- body: JSON.stringify({ inboxLogId, destination, editedExtracted })
+ body: JSON.stringify({ inboxLogId, destination, editedExtracted }),
+ ...options
});
-export const fixBrainClassification = (inboxLogId, newDestination, updatedFields, note) => request('/brain/fix', {
+export const fixBrainClassification = (inboxLogId, newDestination, updatedFields, note, options = {}) => request('/brain/fix', {
method: 'POST',
- body: JSON.stringify({ inboxLogId, newDestination, updatedFields, note })
+ body: JSON.stringify({ inboxLogId, newDestination, updatedFields, note }),
+ ...options
});
-export const retryBrainClassification = (id, providerOverride, modelOverride) => request(`/brain/inbox/${id}/retry`, {
+export const retryBrainClassification = (id, providerOverride, modelOverride, options = {}) => request(`/brain/inbox/${id}/retry`, {
method: 'POST',
- body: JSON.stringify({ providerOverride, modelOverride })
+ body: JSON.stringify({ providerOverride, modelOverride }),
+ ...options
});
-export const updateBrainInboxEntry = (id, capturedText) => request(`/brain/inbox/${id}`, {
+export const updateBrainInboxEntry = (id, capturedText, options = {}) => request(`/brain/inbox/${id}`, {
method: 'PUT',
- body: JSON.stringify({ capturedText })
+ body: JSON.stringify({ capturedText }),
+ ...options
});
-export const deleteBrainInboxEntry = (id) => request(`/brain/inbox/${id}`, { method: 'DELETE' });
-export const markBrainInboxDone = (id) => request(`/brain/inbox/${id}/done`, { method: 'POST' });
+export const deleteBrainInboxEntry = (id, options = {}) => request(`/brain/inbox/${id}`, { method: 'DELETE', ...options });
+export const markBrainInboxDone = (id, options = {}) => request(`/brain/inbox/${id}/done`, { method: 'POST', ...options });
// Stamp a batch of creative notes as consumed once their catalog ingest commits.
export const markBrainInboxSentToCatalog = (ids, options) => request('/brain/inbox/sent-to-catalog', {
method: 'POST',
@@ -71,15 +77,17 @@ export const getBrainProjects = (filters) => {
return request(`/brain/projects?${params}`);
};
export const getBrainProject = (id) => request(`/brain/projects/${id}`);
-export const createBrainProject = (data) => request('/brain/projects', {
+export const createBrainProject = (data, options = {}) => request('/brain/projects', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const updateBrainProject = (id, data) => request(`/brain/projects/${id}`, {
+export const updateBrainProject = (id, data, options = {}) => request(`/brain/projects/${id}`, {
method: 'PUT',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const deleteBrainProject = (id) => request(`/brain/projects/${id}`, { method: 'DELETE' });
+export const deleteBrainProject = (id, options = {}) => request(`/brain/projects/${id}`, { method: 'DELETE', ...options });
// Brain - Ideas
export const getBrainIdeas = (filters) => {
@@ -88,15 +96,17 @@ export const getBrainIdeas = (filters) => {
return request(`/brain/ideas?${params}`);
};
export const getBrainIdea = (id) => request(`/brain/ideas/${id}`);
-export const createBrainIdea = (data) => request('/brain/ideas', {
+export const createBrainIdea = (data, options = {}) => request('/brain/ideas', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const updateBrainIdea = (id, data) => request(`/brain/ideas/${id}`, {
+export const updateBrainIdea = (id, data, options = {}) => request(`/brain/ideas/${id}`, {
method: 'PUT',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const deleteBrainIdea = (id) => request(`/brain/ideas/${id}`, { method: 'DELETE' });
+export const deleteBrainIdea = (id, options = {}) => request(`/brain/ideas/${id}`, { method: 'DELETE', ...options });
// Brain - Admin
export const getBrainAdmin = (filters) => {
@@ -105,28 +115,32 @@ export const getBrainAdmin = (filters) => {
return request(`/brain/admin?${params}`);
};
export const getBrainAdminItem = (id) => request(`/brain/admin/${id}`);
-export const createBrainAdminItem = (data) => request('/brain/admin', {
+export const createBrainAdminItem = (data, options = {}) => request('/brain/admin', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const updateBrainAdminItem = (id, data) => request(`/brain/admin/${id}`, {
+export const updateBrainAdminItem = (id, data, options = {}) => request(`/brain/admin/${id}`, {
method: 'PUT',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const deleteBrainAdminItem = (id) => request(`/brain/admin/${id}`, { method: 'DELETE' });
+export const deleteBrainAdminItem = (id, options = {}) => request(`/brain/admin/${id}`, { method: 'DELETE', ...options });
// Brain - Memories
export const getBrainMemories = () => request('/brain/memories');
export const getBrainMemory = (id) => request(`/brain/memories/${id}`);
-export const createBrainMemory = (data) => request('/brain/memories', {
+export const createBrainMemory = (data, options = {}) => request('/brain/memories', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const updateBrainMemory = (id, data) => request(`/brain/memories/${id}`, {
+export const updateBrainMemory = (id, data, options = {}) => request(`/brain/memories/${id}`, {
method: 'PUT',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
-export const deleteBrainMemory = (id) => request(`/brain/memories/${id}`, { method: 'DELETE' });
+export const deleteBrainMemory = (id, options = {}) => request(`/brain/memories/${id}`, { method: 'DELETE', ...options });
// Brain - Third-party Imports
export const getBrainImportSources = () => request('/brain/import/sources');
@@ -155,15 +169,17 @@ export const getChatgptArchive = (name) =>
// Brain - Digests & Reviews
export const getBrainLatestDigest = () => request('/brain/digest/latest');
export const getBrainDigests = (limit = 10) => request(`/brain/digests?limit=${limit}`);
-export const runBrainDigest = (providerOverride, modelOverride) => request('/brain/digest/run', {
+export const runBrainDigest = (providerOverride, modelOverride, options = {}) => request('/brain/digest/run', {
method: 'POST',
- body: JSON.stringify({ providerOverride, modelOverride })
+ body: JSON.stringify({ providerOverride, modelOverride }),
+ ...options
});
export const getBrainLatestReview = () => request('/brain/review/latest');
export const getBrainReviews = (limit = 10) => request(`/brain/reviews?limit=${limit}`);
-export const runBrainReview = (providerOverride, modelOverride) => request('/brain/review/run', {
+export const runBrainReview = (providerOverride, modelOverride, options = {}) => request('/brain/review/run', {
method: 'POST',
- body: JSON.stringify({ providerOverride, modelOverride })
+ body: JSON.stringify({ providerOverride, modelOverride }),
+ ...options
});
// Brain - Links
@@ -193,11 +209,11 @@ export const reorderBrainLinks = (updates, options = {}) => request('/brain/link
body: JSON.stringify({ updates }),
...options
});
-export const deleteBrainLink = (id) => request(`/brain/links/${id}`, { method: 'DELETE' });
-export const cloneBrainLink = (id) => request(`/brain/links/${id}/clone`, { method: 'POST' });
-export const pullBrainLink = (id) => request(`/brain/links/${id}/pull`, { method: 'POST' });
-export const openBrainLinkFolder = (id) => request(`/brain/links/${id}/open-folder`, { method: 'POST' });
-export const scanBrainLink = (id) => request(`/brain/links/${id}/scan`, { method: 'POST' });
+export const deleteBrainLink = (id, options = {}) => request(`/brain/links/${id}`, { method: 'DELETE', ...options });
+export const cloneBrainLink = (id, options = {}) => request(`/brain/links/${id}/clone`, { method: 'POST', ...options });
+export const pullBrainLink = (id, options = {}) => request(`/brain/links/${id}/pull`, { method: 'POST', ...options });
+export const openBrainLinkFolder = (id, options = {}) => request(`/brain/links/${id}/open-folder`, { method: 'POST', ...options });
+export const scanBrainLink = (id, options = {}) => request(`/brain/links/${id}/scan`, { method: 'POST', ...options });
// Brain - Buckets (bookmark groups for links)
export const getBrainBuckets = (options = {}) => request('/brain/buckets', options);
diff --git a/client/src/services/apiGSD.js b/client/src/services/apiGSD.js
index 6c871a5007..14205af210 100644
--- a/client/src/services/apiGSD.js
+++ b/client/src/services/apiGSD.js
@@ -2,13 +2,14 @@ import { request } from './apiCore.js';
// GSD (Get Stuff Done) Integration
export const getGsdProjects = () => request('/cos/gsd/projects');
-export const getGsdProject = (appId) => request(`/cos/gsd/projects/${appId}`);
+export const getGsdProject = (appId, options = {}) => request(`/cos/gsd/projects/${appId}`, options);
export const getGsdConcerns = (appId) => request(`/cos/gsd/projects/${appId}/concerns`);
export const getGsdPhases = (appId) => request(`/cos/gsd/projects/${appId}/phases`);
export const getGsdPhase = (appId, phaseId) => request(`/cos/gsd/projects/${appId}/phases/${phaseId}`);
-export const createGsdConcernTasks = (appId, data) => request(`/cos/gsd/projects/${appId}/concerns/tasks`, {
+export const createGsdConcernTasks = (appId, data, options = {}) => request(`/cos/gsd/projects/${appId}/concerns/tasks`, {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
export const triggerGsdPhaseAction = (appId, phaseId, action) => request(`/cos/gsd/projects/${appId}/phases/${phaseId}/action`, {
method: 'POST',
diff --git a/client/src/services/apiMeatspace.js b/client/src/services/apiMeatspace.js
index 2373ba9813..089e74eb1e 100644
--- a/client/src/services/apiMeatspace.js
+++ b/client/src/services/apiMeatspace.js
@@ -179,20 +179,23 @@ export const getPostSessions = (from, to) => {
return request(`/meatspace/post/sessions?${params}`);
};
export const getPostSession = (id) => request(`/meatspace/post/sessions/${id}`);
-export const submitPostSession = (data) => request('/meatspace/post/sessions', {
+export const submitPostSession = (data, options = {}) => request('/meatspace/post/sessions', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
export const getPostStats = (days) => request(`/meatspace/post/stats${days != null ? `?days=${days}` : ''}`);
export const getPostAdaptivePreview = () => request('/meatspace/post/adaptive-preview');
-export const generatePostDrill = (type, config = {}, providerId, model) => request('/meatspace/post/drill', {
+export const generatePostDrill = (type, config = {}, providerId, model, options = {}) => request('/meatspace/post/drill', {
method: 'POST',
- body: JSON.stringify({ type, config, ...(providerId && { providerId }), ...(model && { model }) })
+ body: JSON.stringify({ type, config, ...(providerId && { providerId }), ...(model && { model }) }),
+ ...options
});
-export const scorePostLlmDrill = (type, drillData, responses, timeLimitMs, providerId, model) =>
+export const scorePostLlmDrill = (type, drillData, responses, timeLimitMs, providerId, model, options = {}) =>
request('/meatspace/post/score-llm', {
method: 'POST',
- body: JSON.stringify({ type, drillData, responses, timeLimitMs, ...(providerId && { providerId }), ...(model && { model }) })
+ body: JSON.stringify({ type, drillData, responses, timeLimitMs, ...(providerId && { providerId }), ...(model && { model }) }),
+ ...options
});
export const getPostDrillCacheStatus = () => request('/meatspace/post/drill-cache/status');
export const fillPostDrillCache = (types, providerId, model) => request('/meatspace/post/drill-cache/fill', {
diff --git a/client/src/services/apiMedia.js b/client/src/services/apiMedia.js
index 85cc50de64..5351824f87 100644
--- a/client/src/services/apiMedia.js
+++ b/client/src/services/apiMedia.js
@@ -16,14 +16,15 @@ export const deleteAttachment = (filename) => request(`/attachments/${encodeURIC
export const listAttachments = () => request('/attachments');
// Uploads (general file storage)
-export const uploadFile = (base64Data, filename) => request('/uploads', {
+export const uploadFile = (base64Data, filename, options = {}) => request('/uploads', {
method: 'POST',
- body: JSON.stringify({ data: base64Data, filename })
+ body: JSON.stringify({ data: base64Data, filename }),
+ ...options
});
-export const listUploads = () => request('/uploads');
+export const listUploads = (options = {}) => request('/uploads', options);
export const getUploadUrl = (filename) => `/api/uploads/${encodeURIComponent(filename)}`;
-export const deleteUpload = (filename) => request(`/uploads/${encodeURIComponent(filename)}`, { method: 'DELETE' });
-export const deleteAllUploads = () => request('/uploads?confirm=true', { method: 'DELETE' });
+export const deleteUpload = (filename, options = {}) => request(`/uploads/${encodeURIComponent(filename)}`, { method: 'DELETE', ...options });
+export const deleteAllUploads = (options = {}) => request('/uploads?confirm=true', { method: 'DELETE', ...options });
// Image Cleaner — composable opt-in pipeline (metadata strip and/or denoise).
// Uploads the RAW image bytes (no base64 inflation) with the step selection in
diff --git a/client/src/services/apiMemory.js b/client/src/services/apiMemory.js
index 0b78912ef7..5c6425e6b8 100644
--- a/client/src/services/apiMemory.js
+++ b/client/src/services/apiMemory.js
@@ -19,9 +19,10 @@ export const createMemory = (data) => request('/memory', {
method: 'POST',
body: JSON.stringify(data)
});
-export const updateMemory = (id, data) => request(`/memory/${id}`, {
+export const updateMemory = (id, data, options = {}) => request(`/memory/${id}`, {
method: 'PUT',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
export const deleteMemory = (id, hard = false) => request(`/memory/${id}?hard=${hard}`, { method: 'DELETE' });
export const searchMemories = (query, options = {}) => request('/memory/search', {
@@ -51,5 +52,5 @@ export const consolidateMemories = (options = {}) => request('/memory/consolidat
});
export const getEmbeddingStatus = () => request('/memory/embeddings/status');
export const getMemoryBackendStatus = () => request('/memory/backend/status', { silent: true });
-export const approveMemory = (id) => request(`/memory/${id}/approve`, { method: 'POST' });
-export const rejectMemory = (id) => request(`/memory/${id}/reject`, { method: 'POST' });
+export const approveMemory = (id, options = {}) => request(`/memory/${id}/approve`, { method: 'POST', ...options });
+export const rejectMemory = (id, options = {}) => request(`/memory/${id}/reject`, { method: 'POST', ...options });
diff --git a/client/src/services/apiSystem.js b/client/src/services/apiSystem.js
index b8c4f5e48e..56e142055e 100644
--- a/client/src/services/apiSystem.js
+++ b/client/src/services/apiSystem.js
@@ -11,9 +11,10 @@ export const checkHealth = (options) => request('/system/health', options);
export const getSystemHealth = (options) => request('/system/health/details', options);
export const getNetworkExposure = (options) => request('/network-exposure/status', options);
export const getCapabilities = (options) => request('/capabilities', options);
-export const updateHealthThresholds = (thresholds) => request('/system/health/thresholds', {
+export const updateHealthThresholds = (thresholds, options = {}) => request('/system/health/thresholds', {
method: 'PUT',
- body: JSON.stringify(thresholds)
+ body: JSON.stringify(thresholds),
+ ...options
});
// Update
@@ -97,7 +98,7 @@ export const resetUsage = () => request('/usage', { method: 'DELETE' });
export const getBackupStatus = (options) => request('/backup/status', options);
export const triggerBackup = (options) => request('/backup/run', { method: 'POST', ...options });
export const getBackupSnapshots = (options) => request('/backup/snapshots', options);
-export const restoreBackup = (data) => request('/backup/restore', { method: 'POST', body: JSON.stringify(data) });
+export const restoreBackup = (data, options = {}) => request('/backup/restore', { method: 'POST', body: JSON.stringify(data), ...options });
export const restoreDatabase = (data, options) => request('/backup/restore-db', { method: 'POST', body: JSON.stringify(data), ...options });
// Data Manager
@@ -147,26 +148,28 @@ export const reloadTelegramBridge = () => request('/telegram/bridge/reload', { m
// Browser - CDP browser management
export const getBrowserStatus = () => request('/browser');
export const getBrowserConfig = () => request('/browser/config');
-export const updateBrowserConfig = (config) => request('/browser/config', {
+export const updateBrowserConfig = (config, options = {}) => request('/browser/config', {
method: 'PUT',
- body: JSON.stringify(config)
+ body: JSON.stringify(config),
+ ...options
});
-export const launchBrowser = () => request('/browser/launch', { method: 'POST' });
-export const stopBrowser = () => request('/browser/stop', { method: 'POST' });
-export const restartBrowser = () => request('/browser/restart', { method: 'POST' });
+export const launchBrowser = (options = {}) => request('/browser/launch', { method: 'POST', ...options });
+export const stopBrowser = (options = {}) => request('/browser/stop', { method: 'POST', ...options });
+export const restartBrowser = (options = {}) => request('/browser/restart', { method: 'POST', ...options });
export const getBrowserHealth = () => request('/browser/health');
export const getBrowserProcess = () => request('/browser/process');
export const getBrowserPages = () => request('/browser/pages');
export const getBrowserVersion = () => request('/browser/version');
export const getBrowserLogs = (lines = 50) => request(`/browser/logs?lines=${lines}`);
export const getBrowserDownloads = () => request('/browser/downloads');
-export const deleteBrowserDownload = (name) =>
- request(`/browser/downloads/${encodeURIComponent(name)}`, { method: 'DELETE' });
+export const deleteBrowserDownload = (name, options = {}) =>
+ request(`/browser/downloads/${encodeURIComponent(name)}`, { method: 'DELETE', ...options });
export const browserDownloadUrl = (name) =>
`/api/browser/downloads/${encodeURIComponent(name)}`;
-export const navigateBrowser = (url) => request('/browser/navigate', {
+export const navigateBrowser = (url, options = {}) => request('/browser/navigate', {
method: 'POST',
- body: JSON.stringify({ url })
+ body: JSON.stringify({ url }),
+ ...options
});
// Instances (Federation)
@@ -205,9 +208,10 @@ export const listImageStylePresets = () => {
}
return stylePresetsPromise;
};
-export const generateAvatar = (data) => request('/image-gen/avatar', {
+export const generateAvatar = (data, options = {}) => request('/image-gen/avatar', {
method: 'POST',
- body: JSON.stringify(data)
+ body: JSON.stringify(data),
+ ...options
});
// Save an uploaded image into the gallery (`/data/images/`) and get back its
// `{ filename, path }`. Use this (not the generic `uploadFile`) when the stored