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

refactor: silence double error toasts in Creative Director area (#2669)

[._.]/ Adam Eivy0fa38820a095
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index c0d9174ab2..09220bbf75 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -48,6 +48,7 @@
- [issue-2733] **Taste "Go deeper" now tells the truth when the AI provider is the thing that failed.** A provider timeout, a rejected API key, or a model that answered with nothing came back looking exactly like "there's nothing to ask you" — so you were told to go complete more identity documents, while the real reason flashed past in a second toast. The two outcomes are now distinguished at the source: a provider failure reports once, naming the actual reason, and the identity-documents hint is finally reserved for a genuine lack of context (completing what [issue-2669] started, which could only separate outright request failures). A missing AI provider or an unsupported section now say so in their own words instead of borrowing that hint, and an empty answer from a provider is treated as the failure it is rather than being reported as a completed call. If the live status channel happens to be disconnected, the reason is reported directly instead of going quiet.
- Saving Digital Twin settings no longer leaves the Save button stuck on "Saving..." forever when the save fails — it re-enables so you can retry.
- [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`).
+- [issue-2669] Creative Director screens no longer stack two error toasts when a project action fails. Swept the Creative Director feature area (index + detail pages, Overview and Plan tabs) so every custom-catch caller passes `{ silent: true }` — starting, pausing, resuming, deleting, creating, smoke-testing, saving a directive, re-planning, and toggling a project's audio all now show a single error toast instead of the caller's plus the shared `request()` helper's. Threaded a backward-compatible `options` arg into the affected `apiCreativeDirector.js` wrappers (`listCreativeDirectorProjects`, `createCreativeDirectorProject`, `deleteCreativeDirectorProject`, `start/pause/resumeCreativeDirectorProject`, `createSmokeTestCreativeDirectorProject`, `setCreativeDirectorDirective`, `replanCreativeDirectorProject`).
- 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.
- The Creative Director "Runs" tab now shows why a run failed (e.g. "interrupted by restart") instead of leaving failed runs blank with no explanation.
diff --git a/client/src/components/creative-director/OverviewTab.jsx b/client/src/components/creative-director/OverviewTab.jsx
index b5b06dc1e1..0af86dace7 100644
--- a/client/src/components/creative-director/OverviewTab.jsx
+++ b/client/src/components/creative-director/OverviewTab.jsx
@@ -67,7 +67,7 @@ export default function OverviewTab({ project, onProjectUpdate, onAsyncWorkQueue
setSaving(true);
savingRef.current = true;
const requestProjectId = project.id;
- updateCreativeDirectorProject(requestProjectId, { disableAudio: next })
+ updateCreativeDirectorProject(requestProjectId, { disableAudio: next }, { silent: true })
.then(() => {
if (projectIdRef.current === requestProjectId) {
onProjectUpdate?.({ disableAudio: next });
diff --git a/client/src/components/creative-director/PlanTab.jsx b/client/src/components/creative-director/PlanTab.jsx
index e4489b787c..7451038058 100644
--- a/client/src/components/creative-director/PlanTab.jsx
+++ b/client/src/components/creative-director/PlanTab.jsx
@@ -88,7 +88,7 @@ export default function PlanTab({ project, onProjectUpdate }) {
goal: draft.goal.trim(),
deliverables: draft.deliverables || [],
constraints: draft.constraints || {},
- }).catch((e) => { toast.error(e.message || 'Failed to save directive'); return null; });
+ }, { silent: true }).catch((e) => { toast.error(e.message || 'Failed to save directive'); return null; });
setSavingDirective(false);
if (!updated) return;
onProjectUpdate?.(updated);
@@ -109,7 +109,7 @@ export default function PlanTab({ project, onProjectUpdate }) {
const handleReplan = async () => {
setReplanning(true);
- const updated = await replanCreativeDirectorProject(project.id)
+ const updated = await replanCreativeDirectorProject(project.id, { silent: true })
.catch((e) => { toast.error(e.message || 'Failed to re-plan'); return null; });
setReplanning(false);
if (!updated) return;
diff --git a/client/src/components/creative-director/PlanTab.test.jsx b/client/src/components/creative-director/PlanTab.test.jsx
index 60cbdd5060..45df2d8dd1 100644
--- a/client/src/components/creative-director/PlanTab.test.jsx
+++ b/client/src/components/creative-director/PlanTab.test.jsx
@@ -147,7 +147,7 @@ describe('blocked-step triage', () => {
renderTab(blockedProject(), onProjectUpdate);
await waitFor(() => expect(getCreativeToolCatalog).toHaveBeenCalled());
fireEvent.click(screen.getByRole('button', { name: /Request re-plan/i }));
- await waitFor(() => expect(replanCreativeDirectorProject).toHaveBeenCalledWith('cd-1'));
+ await waitFor(() => expect(replanCreativeDirectorProject).toHaveBeenCalledWith('cd-1', { silent: true }));
await waitFor(() => expect(onProjectUpdate).toHaveBeenCalledWith({ id: 'cd-1', status: 'planning', plan: null }));
});
diff --git a/client/src/pages/CreativeDirector.jsx b/client/src/pages/CreativeDirector.jsx
index c6883dca8d..fed70b0f02 100644
--- a/client/src/pages/CreativeDirector.jsx
+++ b/client/src/pages/CreativeDirector.jsx
@@ -73,7 +73,7 @@ export default function CreativeDirector() {
});
const fetchProjects = useCallback(() => {
- listCreativeDirectorProjects()
+ listCreativeDirectorProjects({ silent: true })
.then((data) => { setProjects(data || []); setLoading(false); })
.catch((err) => {
toast.error(err?.message || 'Failed to load Creative Director projects');
@@ -134,7 +134,7 @@ export default function CreativeDirector() {
...(remixIds.length ? { catalogIngredientIds: remixIds } : {}),
};
try {
- const created = await createCreativeDirectorProject(payload);
+ const created = await createCreativeDirectorProject(payload, { silent: true });
setProjects((prev) => [...prev, created]);
setShowForm(false);
setForm((f) => ({ ...f, name: '', styleSpec: '', userStory: '', startingImageFile: '' }));
@@ -190,7 +190,7 @@ export default function CreativeDirector() {
deliverables: directiveDraft.deliverables || [],
constraints: directiveDraft.constraints || {},
},
- }).catch((err) => { toast.error(err.message || 'Failed to create directive project'); return null; });
+ }, { silent: true }).catch((err) => { toast.error(err.message || 'Failed to create directive project'); return null; });
setCreatingDirective(false);
if (!created) return;
setProjects((prev) => [created, ...prev]);
@@ -204,7 +204,7 @@ export default function CreativeDirector() {
// server's authoritative status within 5s if anything diverges.
const handleStart = async (id) => {
try {
- await startCreativeDirectorProject(id);
+ await startCreativeDirectorProject(id, { silent: true });
setProjects((prev) => prev.map((p) => p.id === id ? { ...p, status: p.treatment ? 'rendering' : 'planning' } : p));
toast.success('Pipeline started');
} catch (err) {
@@ -214,7 +214,7 @@ export default function CreativeDirector() {
const handlePause = async (id) => {
try {
- await pauseCreativeDirectorProject(id);
+ await pauseCreativeDirectorProject(id, { silent: true });
setProjects((prev) => prev.map((p) => p.id === id ? { ...p, status: 'paused' } : p));
toast.success('Paused');
} catch (err) {
@@ -226,7 +226,7 @@ export default function CreativeDirector() {
// No confirmation modal yet — destructive but reversible if you re-create.
// Future: inline two-click confirm pattern.
try {
- await deleteCreativeDirectorProject(id);
+ await deleteCreativeDirectorProject(id, { silent: true });
setProjects((prev) => prev.filter((p) => p.id !== id));
toast.success('Deleted');
} catch (err) {
@@ -248,7 +248,7 @@ export default function CreativeDirector() {
<>
<button
onClick={async () => {
- const created = await createSmokeTestCreativeDirectorProject().catch((e) => {
+ const created = await createSmokeTestCreativeDirectorProject({ silent: true }).catch((e) => {
toast.error(e?.message || 'Smoke test failed to start');
return null;
});
diff --git a/client/src/pages/CreativeDirectorDetail.jsx b/client/src/pages/CreativeDirectorDetail.jsx
index eaabecda09..8ed30f6d53 100644
--- a/client/src/pages/CreativeDirectorDetail.jsx
+++ b/client/src/pages/CreativeDirectorDetail.jsx
@@ -162,9 +162,9 @@ export default function CreativeDirectorDetail() {
: kind === 'start' ? (project?.treatment ? 'rendering' : 'planning')
: null;
try {
- if (kind === 'start') await startCreativeDirectorProject(id);
- else if (kind === 'pause') await pauseCreativeDirectorProject(id);
- else if (kind === 'resume') await resumeCreativeDirectorProject(id);
+ if (kind === 'start') await startCreativeDirectorProject(id, { silent: true });
+ else if (kind === 'pause') await pauseCreativeDirectorProject(id, { silent: true });
+ else if (kind === 'resume') await resumeCreativeDirectorProject(id, { silent: true });
toast.success(successMessages[kind] || kind);
if (optimisticStatus) setProject((p) => p ? { ...p, status: optimisticStatus } : p);
} catch (err) {
diff --git a/client/src/services/apiCreativeDirector.js b/client/src/services/apiCreativeDirector.js
index ab99740f6b..5e664956d6 100644
--- a/client/src/services/apiCreativeDirector.js
+++ b/client/src/services/apiCreativeDirector.js
@@ -1,35 +1,41 @@
import { request } from './apiCore.js';
-export const listCreativeDirectorProjects = () => request('/creative-director');
+export const listCreativeDirectorProjects = (options = {}) => request('/creative-director', options);
// Pass `{ slim: true }` to receive only the fields a polling consumer needs
// (status / per-scene status / finalVideoId / failureReason / updatedAt) —
// drops the `runs[]` history and the full treatment text. Useful
// for 4s-poll surfaces like the Pipeline EpisodeVideoStage.
export const getCreativeDirectorProject = (id, { slim = false } = {}) =>
request(`/creative-director/${encodeURIComponent(id)}${slim ? '?slim=1' : ''}`);
-export const createCreativeDirectorProject = (data) => request('/creative-director', {
+export const createCreativeDirectorProject = (data, options = {}) => request('/creative-director', {
method: 'POST',
body: JSON.stringify(data),
+ ...options,
});
export const updateCreativeDirectorProject = (id, patch, options = {}) => request(`/creative-director/${encodeURIComponent(id)}`, {
method: 'PATCH',
body: JSON.stringify(patch),
...options,
});
-export const deleteCreativeDirectorProject = (id) => request(`/creative-director/${encodeURIComponent(id)}`, {
+export const deleteCreativeDirectorProject = (id, options = {}) => request(`/creative-director/${encodeURIComponent(id)}`, {
method: 'DELETE',
+ ...options,
});
-export const startCreativeDirectorProject = (id) => request(`/creative-director/${encodeURIComponent(id)}/start`, {
+export const startCreativeDirectorProject = (id, options = {}) => request(`/creative-director/${encodeURIComponent(id)}/start`, {
method: 'POST',
+ ...options,
});
-export const pauseCreativeDirectorProject = (id) => request(`/creative-director/${encodeURIComponent(id)}/pause`, {
+export const pauseCreativeDirectorProject = (id, options = {}) => request(`/creative-director/${encodeURIComponent(id)}/pause`, {
method: 'POST',
+ ...options,
});
-export const resumeCreativeDirectorProject = (id) => request(`/creative-director/${encodeURIComponent(id)}/resume`, {
+export const resumeCreativeDirectorProject = (id, options = {}) => request(`/creative-director/${encodeURIComponent(id)}/resume`, {
method: 'POST',
+ ...options,
});
-export const createSmokeTestCreativeDirectorProject = () => request('/creative-director/smoke-test', {
+export const createSmokeTestCreativeDirectorProject = (options = {}) => request('/creative-director/smoke-test', {
method: 'POST',
+ ...options,
});
// Creative tool catalog (CDO Phase 4, #2186) — `{ tools: [{ id, description,
// costClass, longRunning, destructive }], mode, budget }`. The Plan board
@@ -40,14 +46,16 @@ export const getCreativeToolCatalog = (options = {}) => request('/creative-direc
// Attach/replace a directive on an existing project ("convert to directive").
// Clears any prior plan so the planner re-derives one; returns the updated
// project for reactive state swap.
-export const setCreativeDirectorDirective = (id, directive) => request(`/creative-director/${encodeURIComponent(id)}/directive`, {
+export const setCreativeDirectorDirective = (id, directive, options = {}) => request(`/creative-director/${encodeURIComponent(id)}/directive`, {
method: 'POST',
body: JSON.stringify(directive),
+ ...options,
});
// Request a fresh plan (drops the current plan, re-runs the planner). Blocked-step
// triage "re-plan" action.
-export const replanCreativeDirectorProject = (id) => request(`/creative-director/${encodeURIComponent(id)}/replan`, {
+export const replanCreativeDirectorProject = (id, options = {}) => request(`/creative-director/${encodeURIComponent(id)}/replan`, {
method: 'POST',
+ ...options,
});
// Blocked-step triage: `skip` a step or `retry` (reset a blocked/failed step to
// pending — also the "approve" affordance for a gate-blocked step). Returns the