deerflow2/web/src/core/api
Willem Jiang 6686a531bd fix: improve config loading resilience for non-localhost access (#510) (#658)
* fix: improve config loading resilience for non-localhost access (#510)

- Add DEFAULT_CONFIG fallback to always return valid config even if fetch fails
- Implement retry logic with exponential backoff (max 2 retries) to handle transient failures
- Add 5-second fetch timeout to prevent hanging on unreachable backends
- Improve error logging with clear messages about config fetch status
- Always return DeerFlowConfig (never null) to prevent UI rendering issues
- Add safety checks in input-box component to verify reasoning models before access
- Improve type safety: verify array length before accessing array indices
- Add comprehensive documentation in .env.example with examples for different deployment scenarios
- Document NEXT_PUBLIC_API_URL variable behavior and fallback mechanism

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: add nullish coalescing to prevent TypeScript error in input-box

- Add ?? operator to handle potential undefined value when accessing reasoning[0]
- Fixes TS2322 error: Type 'string | undefined' is not assignable to type 'string | number | Date'

---------

Co-authored-by: Willem Jiang <143703838+willem-bd@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-26 07:34:12 +08:00
..
chat.ts fix: add max_clarification_rounds parameter passing from frontend to backend (#616) 2025-10-14 17:56:20 +08:00
hooks.ts fix: improve config loading resilience for non-localhost access (#510) (#658) 2025-10-26 07:34:12 +08:00
index.ts feat: implement enhance prompt (#294) 2025-06-08 19:41:59 +08:00
mcp.ts improve: add abort btn to abort the mcp add request. (#284) 2025-06-26 08:51:46 +08:00
podcast.ts feat: implement MCP UIs 2025-04-24 15:41:33 +08:00
prompt-enhancer.ts feat: implement enhance prompt (#294) 2025-06-08 19:41:59 +08:00
rag.ts feat: add deep think feature (#311) 2025-06-14 13:12:43 +08:00
resolve-service-url.ts feat: implement MCP UIs 2025-04-24 15:41:33 +08:00
types.ts feat: add deep think feature (#311) 2025-06-14 13:12:43 +08:00