{"record":{"id":"5f211c9e303dc6cb","repo":"bytedance/deer-flow","slug":"failed-to-load-suggestions-config-response-stat","errorCode":null,"errorMessage":"Failed to load suggestions config: ${response.statusText}","messagePattern":"Failed to load suggestions config: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"frontend/src/core/suggestions/api.ts","lineNumber":18,"sourceCode":"import { fetch } from \"@/core/api/fetcher\";\nimport { getBackendBaseURL } from \"@/core/config\";\n\nexport const DEFAULT_MAX_SUGGESTIONS = 3;\n\nexport interface SuggestionsConfigResponse {\n  enabled: boolean;\n  max_suggestions: number;\n}\n\nexport async function loadSuggestionsConfig(): Promise<SuggestionsConfigResponse> {\n  const response = await fetch(`${getBackendBaseURL()}/api/suggestions/config`);\n  if (!response.ok) {\n    if (response.status === 404) {\n      // Fallback to true if the backend is older\n      return { enabled: true, max_suggestions: DEFAULT_MAX_SUGGESTIONS };\n    }\n    throw new Error(\n      `Failed to load suggestions config: ${response.statusText}`,\n    );\n  }\n  return response.json() as Promise<SuggestionsConfigResponse>;\n}\n","sourceCodeStart":1,"sourceCodeEnd":24,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/frontend/src/core/suggestions/api.ts#L1-L24","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Treat this as non-fatal: fall back to {enabled: false, max_suggestions: DEFAULT} and hide suggestions UI","curl /api/suggestions/config to see the actual status and error body","Check config.yaml suggestions section matches config.example.yaml schema","Retry once after Gateway /health is green if 502 was returned"],"exampleFix":"// before\nconst cfg = await loadSuggestionsConfig();\n\n// after\nconst cfg = await loadSuggestionsConfig().catch(() => ({\n  enabled: false,\n  max_suggestions: DEFAULT_MAX_SUGGESTIONS,\n}));","handlingStrategy":"fallback","validationCode":null,"typeGuard":"export function isSuggestionsConfigError(e: unknown): e is Error {\n  return e instanceof Error && e.message.startsWith('Failed to load suggestions config:');\n}","tryCatchPattern":"try {\n  return await loadSuggestionsConfig();\n} catch (e) {\n  if (isSuggestionsConfigError(e)) {\n    return {enabled: false, max_suggestions: DEFAULT_MAX_SUGGESTIONS};\n  }\n  throw e;\n}","preventionTips":["Never block app start on suggestions config","Keep the 404 legacy fallback for older backends","Mirror config.example.yaml structure when editing suggestions settings"],"tags":["suggestions","config","http","fallback","frontend"],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}