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: silence double toasts in Loras/media custom-catch sites (#2669)

[._.]/ Adam Eivy07afae41224a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 2ad4a0159d..8b36594397 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -29,6 +29,7 @@
- [issue-2669] The Series Pipeline no longer shows two stacked error toasts when a stage or arc action fails — the custom-catch callers now pass `{ silent: true }` so only their own toast fires, not the shared `request()` helper's default one too. Swept the pipeline stages/canvas area (ArcCanvas, the Audio/ComicPages/ComicScript/Storyboards/Idea stages, and the Pipeline series/issue/manuscript-editor pages, including the `useLockToggle` volume lock and the `useAsyncAction` editorial review) and threaded a backward-compatible `options` arg into the affected API wrappers (arc generate/verify/resolve/derive, volume beats + episodes, season and issue CRUD, stage generate/extract/render/refine, manuscript fetch + completeness, and the audio line/music-library calls).
- **The Review Hub no longer files alerts for browser-extension errors.** Extensions (crypto wallets, password managers, ad blockers) inject scripts into the page, so anything they throw — "Failed to connect to MetaMask" and friends — used to surface as an actionable PortOS alert even though nothing in the app can fix it. Those errors are now identified by their provenance (the failing script lives at a `chrome-extension://` / `moz-extension://` / Safari-extension URL) and dropped both in the browser and on the server, with a narrow message check for wallet rejections that arrive with no stack at all. Any such alerts already sitting in your hub are dismissed once on upgrade, so you don't have to clear them by hand. This also stops extension noise from crowding out real errors: each end accepts at most one error per second, so an extension error used to silently swallow a genuine PortOS failure that happened a moment later.
- **Every toast crashed when PortOS was reached over plain HTTP.** Toast ids were minted with `crypto.randomUUID()`, which browsers only expose on secure origins — so over Tailscale on `http://`, any toast threw `crypto.randomUUID is not a function`, including the error toasts meant to tell you a request had failed. Ids now come from a shared `uuidv4()` helper that falls back to `crypto.getRandomValues` (available on insecure origins) and still yields a spec-valid v4. This is what produced the `crypto.randomUUID` alerts in the Review Hub — it was PortOS's own bug, not an extension, so it is deliberately still reported.
+- [issue-2669] The LoRAs and Media Models screens no longer double-report a failure — the custom-catch callers now pass `{ silent: true }` so only their own message fires, not the shared `request()` helper's default toast too. Swept the LoRAs/media-models area: the Civitai suggestions refresh, LoRA delete, and the Civitai API-key save/clear now show a single toast, and the two list loads (LoRAs, Media Models) that already render a persistent inline error panel no longer also fire a toast saying the same thing. Threaded a backward-compatible `options` arg into the affected API wrappers (`listLorasFull`, `getCivitaiSuggestions`, `deleteLoraFull`, `setCivitaiAuth`, `clearCivitaiAuth`, `listCachedModels`).
- [issue-2669] Sharing, Messages, and Calendar screens no longer show two stacked error toasts when a share/subscribe/export/save/sync action fails — the custom-catch callers now pass `{ silent: true }` so only their own toast fires, not the shared `request()` helper's default one too. Swept the Messages/calendar/sharing feature area (both ConfigTabs, InboxTab, ReviewTab, ShareToButton, and the Sharing page) and threaded a backward-compatible `options` arg into the affected API wrappers (`evaluateMessages`, `enableGmailApi`, `getGoogleAuthUrl`, `create/updateMessageAccount`, `create/updateCalendarAccount`, `updateSubcalendars`, `saveGoogleAuthCredentials`, `start/runGoogleAutoConfig`, `confirmDailyReviewEvent`).
- Creative Director projects that use the Antigravity provider no longer get stuck on "Planning." The agent now reliably receives its instructions instead of launching and sitting idle at an empty prompt (it waits for Antigravity's input box to be ready before sending, the same way the Claude provider does), so planning actually runs to completion.
- A Creative Director project no longer wedges in "Planning" when its agent is interrupted or crashes mid-run. The stuck run is now cleaned up as soon as the dead agent is detected, so the project can retry on its own instead of waiting for the next server restart.
diff --git a/client/src/pages/Loras.jsx b/client/src/pages/Loras.jsx
index b2cdf699af..575946ca92 100644
--- a/client/src/pages/Loras.jsx
+++ b/client/src/pages/Loras.jsx
@@ -107,7 +107,9 @@ export default function Loras() {
const refresh = useCallback(() => {
setError(null);
setLoading(true);
- listLorasFull()
+ // silent:true — the failure renders as a persistent inline error Banner;
+ // the default toast would say the same thing a second time.
+ listLorasFull({ silent: true })
.then(setLoras)
.catch((err) => setError(err?.message || 'Failed to load LoRAs'))
.finally(() => setLoading(false));
@@ -115,7 +117,7 @@ export default function Loras() {
const refreshSuggestions = useCallback(({ force = false } = {}) => {
setLoadingSuggestions(true);
- getCivitaiSuggestions({ force })
+ getCivitaiSuggestions({ force }, { silent: true })
.then(setSuggestions)
.catch((err) => toast.error(err?.message || 'Failed to load suggestions'))
.finally(() => setLoadingSuggestions(false));
@@ -219,7 +221,7 @@ export default function Loras() {
const handleDelete = async (filename) => {
setDeleting(filename);
- await deleteLoraFull(filename)
+ await deleteLoraFull(filename, { silent: true })
.then(() => {
toast.success('LoRA deleted');
setLoras((prev) => prev.filter((l) => l.filename !== filename));
@@ -922,7 +924,7 @@ function CivitaiAuthModal({ pendingUrl, message, auth, onClose, onSaved, onRetry
e?.preventDefault?.();
if (!apiKey.trim() || saving) return;
setSaving(true);
- await setCivitaiAuth(apiKey.trim())
+ await setCivitaiAuth(apiKey.trim(), { silent: true })
.then((updated) => {
toast.success('Civitai API key saved');
onSaved?.(updated);
@@ -940,7 +942,7 @@ function CivitaiAuthModal({ pendingUrl, message, auth, onClose, onSaved, onRetry
const handleClear = async () => {
setClearing(true);
- await clearCivitaiAuth()
+ await clearCivitaiAuth({ silent: true })
.then((updated) => {
toast.success(updated.hasKey ? 'Saved key cleared (env CIVITAI_API_KEY still active)' : 'Civitai API key cleared');
onSaved?.(updated);
diff --git a/client/src/pages/MediaModels.jsx b/client/src/pages/MediaModels.jsx
index b2d6014f62..1075ae9d11 100644
--- a/client/src/pages/MediaModels.jsx
+++ b/client/src/pages/MediaModels.jsx
@@ -43,7 +43,10 @@ export default function MediaModels() {
const refresh = useCallback(() => {
setError(null);
- listCachedModels()
+ // silent:true — the failure renders as the page's own full error state;
+ // the default toast would duplicate it. Mirrors handleAddFromHf, whose
+ // setAddError path is already silent.
+ listCachedModels({ silent: true })
.then(setData)
.catch(err => setError(err?.message || 'Failed to load media models'));
listMediaModelRegistry()
diff --git a/client/src/services/apiImageVideo.js b/client/src/services/apiImageVideo.js
index 0022057f67..c81f65ab9a 100644
--- a/client/src/services/apiImageVideo.js
+++ b/client/src/services/apiImageVideo.js
@@ -273,7 +273,7 @@ export const createBlankSketch = ({ silent = false } = {}) =>
request('/media/sketches', { method: 'POST', silent });
// Models management (HF cache + LoRAs)
-export const listCachedModels = () => request('/image-video/models');
+export const listCachedModels = (options = {}) => request('/image-video/models', options);
export const deleteCachedModel = (dirName, options = {}) => request(`/image-video/models/hf/${encodeURIComponent(dirName)}`, { method: 'DELETE', ...options });
export const deleteLora = (filename, options = {}) => request(`/image-video/models/lora/${encodeURIComponent(filename)}`, { method: 'DELETE', ...options });
@@ -334,7 +334,7 @@ export const removeCustomMediaModel = (id, { silent = false } = {}) => request(`
// LoRA manager — Civitai-aware list/install/patch/delete. Reads sidecar
// metadata so the manager UI can show trigger words, base model, recommended
// scale, preview thumbnail. Used by /media/loras and the Image Gen LoRA picker.
-export const listLorasFull = () => request('/loras');
+export const listLorasFull = (options = {}) => request('/loras', options);
// `silent: true` suppresses the auto-toast in apiCore so the page can route
// CIVITAI_AUTH errors into the in-UI key prompt instead of a fire-and-forget
// red toast the user can't act on.
@@ -431,8 +431,8 @@ export async function installLoraFromHuggingfaceStream({ url, family, onProgress
// Civitai LoRA suggestions per runner family. Cached server-side for 1h.
// Pass `force: true` to bust the cache and re-fetch from Civitai.
-export const getCivitaiSuggestions = ({ force = false } = {}) =>
- request(`/loras/suggestions${force ? '?force=1' : ''}`);
+export const getCivitaiSuggestions = ({ force = false } = {}, options = {}) =>
+ request(`/loras/suggestions${force ? '?force=1' : ''}`, options);
// Live keyword search + cursor pagination within one runner family. Backs the
// per-category search box and "Load more" button on /media/loras. `query`
@@ -452,14 +452,15 @@ export const searchCivitaiLoras = ({ runner, query = '', cursor = null, limit, s
// Civitai auth — read/save/clear the API key. The key never round-trips back
// to the client; the GET only returns `{ hasKey, source }`.
export const getCivitaiAuth = () => request('/loras/auth/civitai');
-export const setCivitaiAuth = (apiKey) => request('/loras/auth/civitai', {
+export const setCivitaiAuth = (apiKey, options = {}) => request('/loras/auth/civitai', {
method: 'POST',
body: JSON.stringify({ apiKey }),
+ ...options,
});
-export const clearCivitaiAuth = () => request('/loras/auth/civitai', { method: 'DELETE' });
+export const clearCivitaiAuth = (options = {}) => request('/loras/auth/civitai', { method: 'DELETE', ...options });
export const getLora = (filename) => request(`/loras/${encodeURIComponent(filename)}`);
export const patchLora = (filename, patch) => request(`/loras/${encodeURIComponent(filename)}`, {
method: 'PATCH',
body: JSON.stringify(patch),
});
-export const deleteLoraFull = (filename) => request(`/loras/${encodeURIComponent(filename)}`, { method: 'DELETE' });
+export const deleteLoraFull = (filename, options = {}) => request(`/loras/${encodeURIComponent(filename)}`, { method: 'DELETE', ...options });