bytedance/deer-flow · info

Failed to load suggestions config: ${response.statusText}

Error message

Failed to load suggestions config: ${response.statusText}

What it means

Thrown when GET /api/suggestions/config returns non-2xx and is not 404 (404 intentionally falls back to defaults for older backends). This endpoint reports whether proactive suggestions are enabled and the cap; failures beyond 404 mean the suggestions router is present but erroring (500) or the proxy chain is broken (502).

Source

Thrown at frontend/src/core/suggestions/api.ts:18

import { fetch } from "@/core/api/fetcher";
import { getBackendBaseURL } from "@/core/config";

export const DEFAULT_MAX_SUGGESTIONS = 3;

export interface SuggestionsConfigResponse {
  enabled: boolean;
  max_suggestions: number;
}

export async function loadSuggestionsConfig(): Promise<SuggestionsConfigResponse> {
  const response = await fetch(`${getBackendBaseURL()}/api/suggestions/config`);
  if (!response.ok) {
    if (response.status === 404) {
      // Fallback to true if the backend is older
      return { enabled: true, max_suggestions: DEFAULT_MAX_SUGGESTIONS };
    }
    throw new Error(
      `Failed to load suggestions config: ${response.statusText}`,
    );
  }
  return response.json() as Promise<SuggestionsConfigResponse>;
}

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Treat this as non-fatal: fall back to {enabled: false, max_suggestions: DEFAULT} and hide suggestions UI
  2. curl /api/suggestions/config to see the actual status and error body
  3. Check config.yaml suggestions section matches config.example.yaml schema
  4. Retry once after Gateway /health is green if 502 was returned

Example fix

// before
const cfg = await loadSuggestionsConfig();

// after
const cfg = await loadSuggestionsConfig().catch(() => ({
  enabled: false,
  max_suggestions: DEFAULT_MAX_SUGGESTIONS,
}));
Defensive patterns

Strategy: fallback

Type guard

export function isSuggestionsConfigError(e: unknown): e is Error {
  return e instanceof Error && e.message.startsWith('Failed to load suggestions config:');
}

Try / catch

try {
  return await loadSuggestionsConfig();
} catch (e) {
  if (isSuggestionsConfigError(e)) {
    return {enabled: false, max_suggestions: DEFAULT_MAX_SUGGESTIONS};
  }
  throw e;
}

Prevention

When it happens

Trigger: Backend suggestions feature partially disabled causing a handler exception (500); Gateway restarting behind nginx (502); a backend build where the route exists but its config read fails.

Common situations: Disabling suggestions in config.yaml in a way the router doesn't expect (bad key/type); version skew where frontend expects the route but backend has a broken variant; transient restarts.

Related errors


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