bytedance/deer-flow · warning

Failed to load workspace changes.

Error message

Failed to load workspace changes.

What it means

fetchWorkspaceChanges GETs /api/threads/{threadId}/runs/{runId}/workspace-changes (with include_diff flag) and throws when the response is not ok, using the body's detail or the fallback text when the body is not JSON.

Source

Thrown at frontend/src/core/workspace-changes/api.ts:30

  runId: string;
  includeFiles?: boolean;
  includeDiff?: boolean;
}): Promise<WorkspaceChangesResponse> {
  const query = new URLSearchParams({
    include_files: includeFiles ? "true" : "false",
    include_diff: includeDiff ? "true" : "false",
  });
  const response = await fetch(
    `${getBackendBaseURL()}/api/threads/${encodeURIComponent(
      threadId,
    )}/runs/${encodeURIComponent(runId)}/workspace-changes?${query}`,
  );

  if (!response.ok) {
    const error = await response
      .json()
      .catch(() => ({ detail: "Failed to load workspace changes." }));
    throw new Error(error.detail ?? "Failed to load workspace changes.");
  }

  return response.json();
}

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Check the workspace-changes request status in the Network tab.
  2. 404/410: the run's change data is gone — re-run the agent or reload the thread; the panel can show an empty state.
  3. 401: re-auth and refetch.
  4. 5xx/timeout: retry with include_diff=false first (cheaper), then inspect gateway logs for the diff builder.

Example fix

// before: full diff always requested
const changes = await fetchWorkspaceChanges(threadId, runId, true);

// after: fetch metadata first, diff on demand
const meta = await fetchWorkspaceChanges(threadId, runId, false);
const withDiff = selectedFile ? await fetchWorkspaceChanges(threadId, runId, true) : meta;
Defensive patterns

Strategy: fallback

Validate before calling

if (!runId) { /* no run selected: don't fetch */ }

Type guard

function hasRunRef(threadId?: string, runId?: string): boolean { return Boolean(threadId && runId); }

Try / catch

try { const changes = await fetchWorkspaceChanges(threadId, runId, includeDiff); } catch (e) { if (isGone(e) || isNotFound(e)) { setPanelEmptyState(); } else { toast('Could not load workspace changes'); retryOnce(); } }

Prevention

When it happens

Trigger: Requesting workspace changes for a run id the gateway no longer retains (404 after run-state pruning), a thread/run mismatch (400/404), expired session (401), or a 500 when diff generation fails server-side.

Common situations: Opening the workspace-changes panel on an old run after gateway restart cleared in-memory run state; session expiry in a long-lived tab; very large diffs timing out.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/b53b106c2482b176. Report an issue: GitHub.