Skip to content

[DIT-229] 텍스트 기반 대화형 회고 플로우 구현 - #295

Merged
hyoj-dev merged 1 commit into
developfrom
feat/chatbot-flow
Aug 9, 2026
Merged

[DIT-229] 텍스트 기반 대화형 회고 플로우 구현#295
hyoj-dev merged 1 commit into
developfrom
feat/chatbot-flow

Conversation

@hyoj-dev

@hyoj-dev hyoj-dev commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

변경 내용

  • 기존 Q1~Q4 고정 질문과 분리된 회고 V2 대화 API를 추가했습니다.
  • 최초 안내 메시지만 title/body로 제공하고 이후 대화는 content로 반환합니다.
  • FACT, FEEL, STRENGTH, BLOCK, PROCESS, LEARN, ACTION 분석 항목과 EMPTY/PARTIAL/ENOUGH 상태를 저장합니다.
  • 회고 관련성을 RETROSPECTIVE, BRIDGEABLE, OFF_TOPIC, SERVICE_HELP로 분류하고 무관 메시지를 결과 근거에서 제외합니다.
  • 직무·연차와 전체 대화 문맥을 반영해 경험 인정, 핵심 해석, 질문 하나로 구성된 AI 응답을 생성합니다.
  • clientMessageId 기반 멱등 처리, 동시 요청 차단, AI 실패 상태 저장 및 재시도를 구현했습니다.
  • 대화 종료와 결과 생성을 분리하고 readyToComplete는 내부 계산값으로만 반환합니다.
  • V46 DB 마이그레이션, REST Docs, 개발 서버 점검 스크립트를 추가했습니다.

변경 이유

고정된 질문 순서 없이 사용자가 오늘의 업무 경험을 자유롭게 입력하고, 이미 수집한 내용을 반복하지 않는 대화형 회고 경험을 제공하기 위함입니다. V1은 유지하고 V2를 별도 API와 데이터 구조로 분리해 기존 회고 흐름에 미치는 영향을 최소화했습니다.

영향 범위

  • 신규 API
    • POST /api/v2/retrospectives
    • POST /api/v2/retrospectives/{retrospectiveId}/messages
    • GET /api/v2/retrospectives/{retrospectiveId}/conversation
    • POST /api/v2/retrospectives/{retrospectiveId}/finish
  • 신규 PromptType: CONVERSATION_V2
  • 신규 Flyway 마이그레이션: V46
  • 기존 V1 API 동작 유지
  • 실제 회고 결과 생성, STT, 파일 첨부, 앱 UI 연동은 이번 범위에서 제외

검증

  • 전체 테스트 790개 통과
  • pre-push clean test 통과
  • spotlessCheck 통과
  • REST Docs 빌드 성공
  • PowerShell 개발 서버 테스트 스크립트 구문 검사 통과

@hyoj-dev hyoj-dev changed the title [회고 V2] 텍스트 기반 대화형 회고 플로우 구현 [DIT-229] 텍스트 기반 대화형 회고 플로우 구현 Aug 9, 2026
@hyoj-dev
hyoj-dev marked this pull request as ready for review August 9, 2026 15:41
@hyoj-dev
hyoj-dev merged commit a5f6ae2 into develop Aug 9, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2500adb86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


fun findById(id: UUID): ChatMessage?

@Query("SELECT m FROM ChatMessage m WHERE m.retrospective.id = :retrospectiveId ORDER BY m.createdAt ASC")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve message order when timestamps collide

When multiple messages are created in the same second, this query has no deterministic tie-breaker. V46 defines chat_messages.created_at as a plain MySQL DATETIME, which stores no fractional seconds, so the intro and a quickly submitted first user message can share the same value and be returned in UUID/storage order. Both the conversation response and the AI context can consequently place the user message before the intro; store higher-precision timestamps or add an explicit sequence/order key.

Useful? React with 👍 / 👎.

Comment on lines +405 to +407
.takeWhile {
used += it.content.length
used <= maxContextCharacters

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Retain the current message when trimming context

If the newest user message alone exceeds retrospective.v2.max-context-characters (30,000 by default), the first takeWhile predicate fails and the entire context becomes empty. Because the request has no content-length validation and currentMessageId does not carry the text itself, OpenAI is then asked to answer a message it never received, producing an unrelated response while the original message has already been persisted. Always retain or truncate the current message, or reject oversized input before creating the turn.

Useful? React with 👍 / 👎.

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.

1 participant