-
-
Notifications
You must be signed in to change notification settings - Fork 18
feat(changelog): Add AI-powered summaries for verbose changelog sections #688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
BYK
wants to merge
10
commits into
master
Choose a base branch
from
byk/feat/changelog-ai-summary
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
54efab4 to
2d363db
Compare
Add optional AI-powered summarization for changelog sections using GitHub
Models API. Uses your existing GitHub token—no additional API keys required.
Features:
- Summarizes sections with >5 items into concise prose (40-60% compression)
- Uses GPT-4o-mini by default via GitHub Models API
- Configurable model selection (GPT-4o, Llama, etc.)
- Graceful degradation if token unavailable
- Eval tests using vitest-evals for quality validation
Configuration:
aiSummaries:
enabled: true
kickInThreshold: 5
model: openai/gpt-4o-mini
2d363db to
0a7d479
Compare
- Change default model to mistral-ai/ministral-3b (71-87% compression) - Add local fallback using Falconsai/text_summarization (~60MB) - Fallback activates when no GITHUB_TOKEN available - Support local: prefix for explicit local model selection - Update README with before/after example and model options - Update tests to cover both API and local paths (20 tests)
- Move manual test script to proper Vitest integration test - Tests real changelog sections from Sentry 25.12.0 release - Validates compression ratio and threshold behavior - Skips automatically if GITHUB_TOKEN not available
GPT-4o-mini produces higher quality summaries with better readability compared to Ministral-3b.
Adds topLevel config option to control executive summary generation: - 'always' or true: Always generate top-level summary - 'never' or false: Never generate top-level summary - 'threshold' (default): Only generate if total items > kickInThreshold The top-level summary creates a single paragraph (up to 5 sentences) summarizing the entire release, ideal for large releases. Also adds summarizeChangelog() and shouldGenerateTopLevel() functions with full test coverage (34 tests).
- Add tests for summarizeChangelog with Craft 2.16.0 and Sentry 25.12.0 - Add tests for shouldGenerateTopLevel with all mode combinations - Update README with both section and top-level summary examples - Total: 16 integration tests, 34 unit tests (700 tests overall)
- Update prompts to avoid promotional language (no 'enhanced', 'improved', etc.) - Add formatSummaryWithDetails() for wrapping original items in <details> - Add 6 new unit tests for formatSummaryWithDetails - Update README with neutral tone examples and details block demo - Total: 40 unit tests, 16 integration tests (706 tests overall)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds AI-powered summarization for changelog sections. Uses GitHub Models API by default, with a local fallback when no token is available.
Features
<details>blockGITHUB_TOKENorghCLIExamples
Example 1: Craft 2.16.0 (Small Release)
Input (6 items):
Output (with expandable details):
Top-Level Summary (with
topLevel: "always"):Example 2: Sentry 25.12.0 (Large Release)
Real-world test with Sentry 25.12.0 (31 items across 3 sections):
Section Summaries
ACI Section (neutral tone):
Agents Section:
Top-Level Summary (106 words)
Sections with ≤5 items are left unchanged.
Configuration
Top-Level Summary Options
"always"ortrue"never"orfalse"threshold"(default)Available Models
GitHub Models (requires GITHUB_TOKEN):
Local (no token needed):
Details Block
When AI summarization is applied, the original items are preserved in an expandable
<details>block:This allows users to expand and see the full details when needed.
Authentication
Uses your GitHub token automatically:
GITHUB_TOKENenvironment variable, orgh auth token(GitHub CLI)Falls back to local model if no token available.
Files Changed
src/utils/ai-summary.tssrc/__tests__/ai-summary.test.tssrc/__tests__/ai-summary.integration.test.tssrc/__tests__/ai-summary.eval.tssrc/schemas/projectConfig.schema.tsREADME.mdCommands
Model Selection Journey
We tested various local models before settling on the current hybrid approach:
Conclusion: Small local LLMs (<2GB) struggle with true abstractive summarization. GitHub Models API provides superior quality; local model serves as a reasonable fallback.