Skip to content

fix: report-chat 타임아웃으로 인한 오탐 실패 토스트 수정 - #50

Merged
jeongmin1999 merged 1 commit into
mainfrom
fix/report-chat-timeout
Jul 4, 2026
Merged

jeongmin1999 merged 1 commit into
mainfrom
fix/report-chat-timeout

Conversation

@gpffh20

@gpffh20 gpffh20 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

문제

AI 리포트 챗봇에 메시지를 보내면 서버(AI 서비스)는 200 OK로 정상 응답하지만, 화면에는 "메시지 전송에 실패했습니다" 토스트가 뜨는 문제가 있었습니다.

원인

  • AI 서비스는 여러 도구(문헌 검색 등)를 순차 호출하며 답변을 생성하는데, 이 과정이 30초 이상 걸릴 수 있습니다.
  • 반면 프론트엔드의 공용 axios 클라이언트(src/api/client.ts)는 모든 요청에 15초 타임아웃을 적용하고 있어, AI 응답이 오기 전에 요청이 클라이언트 측에서 강제 중단(ECONNABORTED)됩니다.
  • ReportChatPanel.tsx의 에러 처리가 모든 에러를 구분 없이 잡아 동일한 실패 토스트를 띄우다 보니, 실제로는 AI가 정상 처리 중이었음에도 실패로 표시됐습니다.
  • BE→AI 서비스 간 타임아웃은 60초로 이미 충분히 여유 있어, 병목은 FE 쪽 15초 타임아웃이었습니다.

수정 내용

  • src/api/reports.ts: sendChatMessage 요청에 개별 타임아웃 65초를 지정 (BE의 AI 서비스 타임아웃 60초 기준)
  • src/components/common/ReportChatPanel.tsx: axios.isAxiosError(error) && error.code === 'ECONNABORTED'로 timeout 에러를 구분해, timeout일 때는 "AI 응답이 지연되고 있습니다. 잠시 후 새로고침해 확인해주세요" 메시지로 다르게 표시

확인

  • npx tsc --noEmit 통과

AI report-chat responses can take 30s+ (multi-tool agent chain), but the
shared axios client used a 15s timeout for every request. The frontend
aborted before the AI service replied and showed a generic failure toast
even though the backend later completed with 200 OK.
@jeongmin1999
jeongmin1999 self-requested a review July 4, 2026 11:24
@jeongmin1999
jeongmin1999 merged commit 0280ff3 into main Jul 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants