feat: 게시글 AI 요약 Solar Pro 4 전환 및 디자인 변경 오류 수정 - #2317
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe PR updates article AI-summary defaults to ChangesArticle summary regeneration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ArticleAiSummaryService
participant ArticleAiSummary
participant ArticleSummaryContentRenderer
ArticleAiSummaryService->>ArticleAiSummary: check source fingerprint
ArticleAiSummaryService->>ArticleAiSummary: schedule regeneration for stale model or prompt
ArticleAiSummaryService->>ArticleSummaryContentRenderer: render existing summary
ArticleSummaryContentRenderer-->>ArticleAiSummaryService: return rendered summary
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryPropertiesTest.java (1)
11-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the changed model and prompt defaults.
This test verifies only the retry limit. Add assertions for
getModel()returningsolar-pro4andgetPromptVersion()returningv11. Otherwise, a regression in either default can pass the test.Proposed test addition
+ `@Test` + void 기본_모델과_프롬프트_버전을_사용한다() { + ArticleAiSummaryProperties properties = new ArticleAiSummaryProperties(); + + assertThat(properties.getModel()).isEqualTo("solar-pro4"); + assertThat(properties.getPromptVersion()).isEqualTo("v11"); + }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryPropertiesTest.java` around lines 11 - 16, Extend the existing ArticleAiSummaryProperties test to assert that a newly constructed properties instance returns "solar-pro4" from getModel() and "v11" from getPromptVersion(), alongside the existing retry-limit assertion.src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleSummaryPromptBuilder.java (1)
1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the shared head/tail truncation logic into one utility.
ArticleSummaryPromptBuilder.truncateSection()andUpstageDocumentParseClient.truncate()implement the identical algorithm: the sameTRUNCATION_MARKERtext and the same 3/4-leading/1/4-trailing split formula. Duplicating this logic in two classes risks silent divergence if either copy is tuned later (marker text, split ratio) without updating the other.
src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleSummaryPromptBuilder.java#L180-197: extracttruncateSectioninto a shared utility (for example a smallTextTruncationUtilsclass or static helper) that both classes call.src/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageDocumentParseClient.java#L265-278: replacetruncatewith a call to the same shared utility, passingMAX_PARSED_TEXT_LENGTHas the limit.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleSummaryPromptBuilder.java` at line 1, Extract the duplicated head/tail truncation algorithm, including its shared marker and 3/4-leading/1/4-trailing split, into a reusable utility. Update ArticleSummaryPromptBuilder.truncateSection() and UpstageDocumentParseClient.truncate() to delegate to that utility, passing MAX_PARSED_TEXT_LENGTH from the latter, and remove the duplicate implementations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageChatTokenRateLimiter.java`:
- Around line 39-90: The synchronized await method must not sleep while holding
the limiter lock. In UpstageChatTokenRateLimiter.await, after calculating
remainingResetMillis, immediately throw the retryable
ArticleSummaryExternalApiException with Duration.ofMillis(remainingResetMillis);
remove the sleeper.sleep retry path and its post-sleep refresh/throw logic,
while preserving interrupt handling only if it remains necessary.
---
Nitpick comments:
In
`@src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleSummaryPromptBuilder.java`:
- Line 1: Extract the duplicated head/tail truncation algorithm, including its
shared marker and 3/4-leading/1/4-trailing split, into a reusable utility.
Update ArticleSummaryPromptBuilder.truncateSection() and
UpstageDocumentParseClient.truncate() to delegate to that utility, passing
MAX_PARSED_TEXT_LENGTH from the latter, and remove the duplicate
implementations.
In
`@src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryPropertiesTest.java`:
- Around line 11-16: Extend the existing ArticleAiSummaryProperties test to
assert that a newly constructed properties instance returns "solar-pro4" from
getModel() and "v11" from getPromptVersion(), alongside the existing retry-limit
assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 639cf717-805e-4c3f-927f-51259016123c
📒 Files selected for processing (11)
src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleAiSummaryProperties.javasrc/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleSummaryPromptBuilder.javasrc/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageArticleSummaryClient.javasrc/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageChatTokenRateLimiter.javasrc/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageDocumentParseClient.javasrc/main/resources/application.ymlsrc/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageArticleSummaryClientTest.javasrc/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageChatTokenRateLimiterTest.javasrc/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageDocumentParseClientTest.javasrc/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryPropertiesTest.javasrc/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleSummaryPromptBuilderTest.java
This reverts commit d9078b4.
🚀 주요 변경 내용
solar-pro4로 변경하고, 모델 변경을 감지할 수 있도록 프롬프트 버전을v11로 갱신했습니다.💬 참고 사항
ARTICLE_AI_SUMMARY_MODEL또는ARTICLE_AI_SUMMARY_PROMPT_VERSION이 고정되어 있다면 각각solar-pro4,v11로 변경해야 합니다.solar-pro4-260806모델의 JSON Schema 응답과 HTTP 200을 확인했습니다.✅ Checklist (완료 조건)
Summary by CodeRabbit
New Features
Tests