Skip to content

feat: 게시글 AI 요약 Solar Pro 4 전환 및 디자인 변경 오류 수정 - #2317

Merged
taejinn merged 11 commits into
developfrom
feat/2316-article-summary-solar-open2
Aug 4, 2026
Merged

feat: 게시글 AI 요약 Solar Pro 4 전환 및 디자인 변경 오류 수정#2317
taejinn merged 11 commits into
developfrom
feat/2316-article-summary-solar-open2

Conversation

@taejinn

@taejinn taejinn commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

🚀 주요 변경 내용

  • 게시글 요약 모델을 solar-pro4로 변경하고, 모델 변경을 감지할 수 있도록 프롬프트 버전을 v11로 갱신했습니다.
  • 모델 변경으로 요약을 다시 만드는 동안에도 원문이 같은 기존 요약은 새 디자인으로 계속 보여주고, 원문이 바뀐 경우에는 기존 요약을 노출하지 않도록 수정했습니다.

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

Summary by CodeRabbit

  • New Features

    • Article AI summaries now use an updated AI model and prompt version for improved quality.
    • Summaries are now preserved when an article source remains unchanged, even if AI model settings are updated.
  • Tests

    • Added comprehensive test coverage for AI summary configuration and management logic.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f28f359-4a00-46d7-8117-b3a071276003

📥 Commits

Reviewing files that changed from the base of the PR and between 48b6804 and 2afd4f6.

📒 Files selected for processing (7)
  • src/main/java/in/koreatech/koin/domain/community/article/model/ArticleAiSummary.java
  • src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleAiSummaryProperties.java
  • src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleAiSummaryService.java
  • src/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageArticleSummaryClientTest.java
  • src/test/java/in/koreatech/koin/unit/domain/community/article/model/ArticleAiSummaryTest.java
  • src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryPropertiesTest.java
  • src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryServiceTest.java

📝 Walkthrough

Walkthrough

The PR updates article AI-summary defaults to solar-pro4 and v11. It preserves source-current summaries during model or prompt regeneration and adds tests for configuration, request generation, source matching, rendering, and state transitions.

Changes

Article summary regeneration

Layer / File(s) Summary
Summary configuration and request defaults
src/main/resources/application.yml, src/main/java/.../ArticleAiSummaryProperties.java, src/test/java/.../ArticleAiSummaryPropertiesTest.java, src/test/java/.../UpstageArticleSummaryClientTest.java
The default model changes to solar-pro4. The prompt version changes to v11. Tests verify the properties and generated request body.
Source matching and content preservation
src/main/java/.../ArticleAiSummary.java, src/test/java/.../ArticleAiSummaryTest.java
ArticleAiSummary adds source matching through hasSummaryForSource. Same-source regeneration retains summary content and its timestamp. Different-source regeneration clears both values.
Display and regeneration flow
src/main/java/.../ArticleAiSummaryService.java, src/test/java/.../ArticleAiSummaryServiceTest.java
The service displays summaries when the source matches. It schedules regeneration when model or prompt metadata is stale, while retaining and rendering the existing summary.

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
Loading

Possibly related issues

Possibly related PRs

Suggested labels: 버그

Suggested reviewers: dh2906, dhkimgit, janoogwan

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Solar Pro 4 migration and the fix for summary display errors during design changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/2316-article-summary-solar-open2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

Unit Test Results

779 tests   776 ✔️  1m 25s ⏱️
188 suites      3 💤
188 files        0

Results for commit 2afd4f6.

♻️ This comment has been updated with latest results.

@taejinn taejinn changed the title feat: 게시글 AI 요약에 Solar Open 2 적용 feat: 게시글 AI 요약에 Solar Pro 4 적용 Aug 2, 2026
@taejinn taejinn self-assigned this Aug 3, 2026
@taejinn
taejinn marked this pull request as ready for review August 3, 2026 08:27
@taejinn
taejinn requested review from DHkimgit and dh2906 August 3, 2026 08:27

@coderabbitai coderabbitai 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.

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 win

Add coverage for the changed model and prompt defaults.

This test verifies only the retry limit. Add assertions for getModel() returning solar-pro4 and getPromptVersion() returning v11. 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 win

Extract the shared head/tail truncation logic into one utility.

ArticleSummaryPromptBuilder.truncateSection() and UpstageDocumentParseClient.truncate() implement the identical algorithm: the same TRUNCATION_MARKER text 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: extract truncateSection into a shared utility (for example a small TextTruncationUtils class or static helper) that both classes call.
  • src/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageDocumentParseClient.java#L265-278: replace truncate with a call to the same shared utility, passing MAX_PARSED_TEXT_LENGTH as 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

📥 Commits

Reviewing files that changed from the base of the PR and between 82865aa and 48b6804.

📒 Files selected for processing (11)
  • src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleAiSummaryProperties.java
  • src/main/java/in/koreatech/koin/domain/community/article/service/summary/ArticleSummaryPromptBuilder.java
  • src/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageArticleSummaryClient.java
  • src/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageChatTokenRateLimiter.java
  • src/main/java/in/koreatech/koin/infrastructure/upstage/client/UpstageDocumentParseClient.java
  • src/main/resources/application.yml
  • src/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageArticleSummaryClientTest.java
  • src/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageChatTokenRateLimiterTest.java
  • src/test/java/in/koreatech/koin/infrastructure/upstage/client/UpstageDocumentParseClientTest.java
  • src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleAiSummaryPropertiesTest.java
  • src/test/java/in/koreatech/koin/unit/domain/community/article/service/summary/ArticleSummaryPromptBuilderTest.java

@taejinn
taejinn removed the request for review from Soundbar91 August 3, 2026 10:07
@taejinn
taejinn marked this pull request as draft August 3, 2026 10:07
@taejinn taejinn changed the title feat: 게시글 AI 요약에 Solar Pro 4 적용 feat: 게시글 AI 요약 Solar Pro 4 전환 및 기존 요약 노출 유지 Aug 4, 2026
@taejinn taejinn changed the title feat: 게시글 AI 요약 Solar Pro 4 전환 및 기존 요약 노출 유지 feat: 게시글 AI 요약 Solar Pro 4 전환 및 디자인 변경 오류 수정 Aug 4, 2026
@taejinn
taejinn marked this pull request as ready for review August 4, 2026 10:12
@github-actions
github-actions Bot requested a review from kih1015 August 4, 2026 10:12
@taejinn
taejinn removed the request for review from kih1015 August 4, 2026 10:12

@dh2906 dh2906 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

굿굿!

@taejinn
taejinn merged commit c2e70d2 into develop Aug 4, 2026
9 checks passed
@taejinn
taejinn deleted the feat/2316-article-summary-solar-open2 branch August 4, 2026 10:29
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