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
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: silence duplicate error toasts in the digital-twin tabs (#2669)
[._.]/ Adam Eivy4ac3e3f5201a
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.mdindex e6c47772d1..a1c638efa2 100644--- a/.changelog/NEXT.md+++ b/.changelog/NEXT.md@@ -36,6 +36,7 @@- **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] The Digital Twin screens no longer double-report a failure. A failed "Check for contradictions" on the Overview tab showed a toast *and* the same message inline in the results panel — it now reports once, inline. Resetting a Taste section that failed to reset no longer claims "Section reset" on top of the error toast; the success message is only shown when the reset actually succeeded.- [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/components/digital-twin/tabs/OverviewTab.jsx b/client/src/components/digital-twin/tabs/OverviewTab.jsxindex 4edc977a67..d3da52ac3d 100644--- a/client/src/components/digital-twin/tabs/OverviewTab.jsx+++ b/client/src/components/digital-twin/tabs/OverviewTab.jsx@@ -87,9 +87,12 @@ export default function OverviewTab({ status, settings, onRefresh }) {return;}setCheckingContradictions(true);+ // silent: the failure is surfaced inline below (contradictions.error), so+ // letting request() toast as well would double-report the same error.const result = await api.detectSoulContradictions(selectedProvider.providerId,- selectedProvider.model+ selectedProvider.model,+ { silent: true }).catch(e => ({ error: e.message }));setContradictions(result);setCheckingContradictions(false);diff --git a/client/src/components/digital-twin/tabs/TasteTab.jsx b/client/src/components/digital-twin/tabs/TasteTab.jsxindex f6a6c8ffb7..ff142a6c93 100644--- a/client/src/components/digital-twin/tabs/TasteTab.jsx+++ b/client/src/components/digital-twin/tabs/TasteTab.jsx@@ -197,7 +197,10 @@ export default function TasteTab({ onRefresh }) {};const handleResetSection = async (sectionId) => {- await api.resetTasteSection(sectionId).catch(() => null);+ // request() owns the failure toast; bail before the success toast so a+ // failed reset doesn't report "Section reset" on top of that error.+ const ok = await api.resetTasteSection(sectionId).then(() => true).catch(() => false);+ if (!ok) return;toast.success('Section reset');await loadProfile();setReviewSection(null);diff --git a/client/src/services/apiDigitalTwin.js b/client/src/services/apiDigitalTwin.jsindex 7542d310bd..6705205e18 100644--- a/client/src/services/apiDigitalTwin.js+++ b/client/src/services/apiDigitalTwin.js@@ -126,9 +126,10 @@ export const setActiveDigitalTwinPersona = (personaId) => request('/digital-twin// Digital Twin - Validation & Analysisexport const getDigitalTwinCompleteness = () => request('/digital-twin/validate/completeness');-export const detectDigitalTwinContradictions = (providerId, model) => request('/digital-twin/validate/contradictions', {+export const detectDigitalTwinContradictions = (providerId, model, options = {}) => request('/digital-twin/validate/contradictions', {method: 'POST',- body: JSON.stringify({ providerId, model })+ body: JSON.stringify({ providerId, model }),+ ...options});export const generateDigitalTwinTests = (providerId, model, options = {}) => request('/digital-twin/tests/generate', {method: 'POST',diff --git a/client/src/services/apiDigitalTwin.test.js b/client/src/services/apiDigitalTwin.test.jsnew file mode 100644index 0000000000..738b14e40d--- /dev/null+++ b/client/src/services/apiDigitalTwin.test.js@@ -0,0 +1,42 @@+import { describe, it, expect, vi, beforeEach } from 'vitest';++vi.mock('./apiCore.js', () => ({+ request: vi.fn(),+}));++let request;+let detectDigitalTwinContradictions;++beforeEach(async () => {+ vi.resetModules();+ ({ request } = await import('./apiCore.js'));+ ({ detectDigitalTwinContradictions } = await import('./apiDigitalTwin.js'));+ request.mockReset();+});++describe('detectDigitalTwinContradictions', () => {+ // OverviewTab renders the failure inline (contradictions.error), so it needs a+ // way to suppress request()'s own toast — otherwise one failure reports twice.+ it('forwards caller options (e.g. silent) into the request', async () => {+ request.mockResolvedValue({ issues: [] });++ await detectDigitalTwinContradictions('openai', 'gpt-4', { silent: true });++ const [path, options] = request.mock.calls[0];+ expect(path).toBe('/digital-twin/validate/contradictions');+ expect(options.silent).toBe(true);+ // Options must not clobber the request shape.+ expect(options.method).toBe('POST');+ expect(JSON.parse(options.body)).toEqual({ providerId: 'openai', model: 'gpt-4' });+ });++ it('stays callable without options (back-compat) and then toasts by default', async () => {+ request.mockResolvedValue({ issues: [] });++ await detectDigitalTwinContradictions('openai', 'gpt-4');++ const [, options] = request.mock.calls[0];+ expect(options.silent).toBeUndefined();+ expect(options.method).toBe('POST');+ });+});