[DIT-229] 텍스트 기반 대화형 회고 플로우 구현 - #295
Conversation
There was a problem hiding this comment.
💡 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") |
There was a problem hiding this comment.
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 👍 / 👎.
| .takeWhile { | ||
| used += it.content.length | ||
| used <= maxContextCharacters |
There was a problem hiding this comment.
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 👍 / 👎.
변경 내용
변경 이유
고정된 질문 순서 없이 사용자가 오늘의 업무 경험을 자유롭게 입력하고, 이미 수집한 내용을 반복하지 않는 대화형 회고 경험을 제공하기 위함입니다. V1은 유지하고 V2를 별도 API와 데이터 구조로 분리해 기존 회고 흐름에 미치는 영향을 최소화했습니다.
영향 범위
검증