-
Notifications
You must be signed in to change notification settings - Fork 125
feat: auto-summarize checkpoints at commit time #133
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
Conversation
Add SummariseOptions struct and GetSummariseOptions() helper to parse the nested strategy_options.summarise configuration. Returns Enabled: false by default if not configured. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 262159058f4e
Simplify generateCheckpointSummary by delegating to the shared helper. No functional change. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 5b5a73f2998f
Extract core summary generation logic into a reusable function. Used by both 'explain --generate' and auto-summarise at commit time. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 1900c8c6134b
Allow strategies to pass a Summary when writing committed checkpoints. The summary is stored in metadata.json alongside other checkpoint data. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e34f7839a1bf
Generate AI summaries during CondenseSession when summarise.enabled is true. Uses checkpoint-scoped transcript (via TranscriptLinesAtStart) to summarise only the work done in this checkpoint. Summary generation is non-blocking - failures are logged but don't prevent checkpoint creation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e34f7839a1bf
Document the strategy_options.summarise.enabled setting and its requirements. Notes that it's currently manual-commit only and uses Claude CLI. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: e34f7839a1bf
… prior to Stop hook firing Entire-Checkpoint: e34f7839a1bf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds automatic AI summary generation for checkpoints at commit time in the manual-commit strategy. The feature is opt-in via configuration and non-blocking (failures don't prevent commits).
Changes:
- Adds a shared
GenerateFromTranscript()helper function for summary generation, refactoring common logic from the explain command - Integrates auto-summarisation into the manual-commit strategy's checkpoint condensation flow with configuration-based enablement
- Extends checkpoint metadata to include optional AI-generated summaries
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/summarise/summarise.go | Adds shared GenerateFromTranscript() function to reduce duplication between explain and auto-summarise features |
| cmd/entire/cli/summarise/summarise_test.go | Adds comprehensive unit tests for the new helper function with mock generators |
| cmd/entire/cli/strategy/manual_commit_condensation.go | Integrates summary generation into checkpoint condensation with scoped transcripts; adds configuration reading logic |
| cmd/entire/cli/explain.go | Refactors to use the new shared GenerateFromTranscript() helper instead of duplicated logic |
| cmd/entire/cli/config.go | Adds SummariseOptions struct and GetSummariseOptions() helper for reading summarise configuration |
| cmd/entire/cli/config_test.go | Adds tests for various configuration scenarios of the summarise feature |
| cmd/entire/cli/checkpoint/checkpoint.go | Adds Summary field to WriteCommittedOptions to allow strategies to pass pre-generated summaries |
| cmd/entire/cli/checkpoint/committed.go | Includes summary in checkpoint metadata serialization |
| README.md | Documents the new auto-summarisation feature with configuration examples and requirements |
Comments suppressed due to low confidence (1)
cmd/entire/cli/checkpoint/committed.go:386
- When merging multi-session checkpoints, the Summary from the new session overwrites any existing summary without preserving the previous one. This is different from how InitialAttribution is handled (lines 383-386), where the existing attribution is preserved.
Consider whether the Summary should:
- Be preserved from the first session (like InitialAttribution)
- Be replaced with the latest session's summary (current behavior)
- Somehow combine/merge summaries from both sessions
The current behavior means only the most recent session's summary will be retained in multi-session checkpoints. If this is intentional, consider adding a comment explaining the design choice.
Summary: opts.Summary,
}
// Merge with existing metadata if present (multi-session checkpoint)
if existingMetadata != nil {
// Get existing session count (default to 1 for backwards compat)
existingCount := existingMetadata.SessionCount
if existingCount == 0 {
existingCount = 1
}
metadata.SessionCount = existingCount + 1
// Merge session IDs
existingIDs := existingMetadata.SessionIDs
if len(existingIDs) == 0 {
// Backwards compat: old metadata only had SessionID
existingIDs = []string{existingMetadata.SessionID}
}
metadata.SessionIDs = append(metadata.SessionIDs[:0], existingIDs...)
metadata.SessionIDs = append(metadata.SessionIDs, opts.SessionID)
// Merge agents (deduplicated, preserving order)
existingAgents := existingMetadata.Agents
if len(existingAgents) == 0 && existingMetadata.Agent != "" {
// Backwards compat: old metadata only had Agent
existingAgents = []agent.AgentType{existingMetadata.Agent}
}
metadata.Agents = mergeAgents(existingAgents, opts.Agent)
// Keep Agent as the first agent for backwards compat
if len(metadata.Agents) > 0 {
metadata.Agent = metadata.Agents[0]
}
// Merge files touched (deduplicated)
metadata.FilesTouched = mergeFilesTouched(existingMetadata.FilesTouched, opts.FilesTouched)
// Sum checkpoint counts
metadata.CheckpointsCount = existingMetadata.CheckpointsCount + opts.CheckpointsCount
// Keep existing attribution - we calculated this for the first session based on all commits in the shadow branch already
if existingMetadata.InitialAttribution != nil {
metadata.InitialAttribution = existingMetadata.InitialAttribution
}
- Remove unused GetSummariseOptions() from config.go (the strategy package reads settings directly to avoid import cycles, matching push_sessions pattern) - Remove corresponding tests from config_test.go - Fix context propagation: use summariseCtx instead of context.Background() in GenerateFromTranscript call Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 1e4398fcb1d4
- Add minimalDetailTools map for tools that should show only essential details (Skill, Read, WebFetch) - shows identifier only, not full content - Filter out skill content injections from user messages (messages starting with "Base directory for this skill:") - Add Skill, URL, Prompt fields to ToolInput for better tool detail extraction Skill is a special case - it injects content as a text block in user messages, unlike Read/WebFetch which use tool_result blocks (already filtered). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 742d862e8d6a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
- Fix context chain: derive summariseCtx from logCtx instead of context.Background() to maintain logging context propagation - Add documentation for Summary field explaining when it may be nil - Expand skill content filtering comment with origin and rationale - Remove "manual-commit only" restriction from README docs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: 5c5cb639eac4
Rename summarise package to summarize and update all related identifiers, comments, and settings keys to use US English spelling. Breaking change: settings key changed from strategy_options.summarise to strategy_options.summarize. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Entire-Checkpoint: eaaad03dd419
Create a new `settings` package that both `cli` and `strategy` packages can import without creating import cycles. This replaces the duplicated settings loading code in manual_commit_condensation.go. Also update CLAUDE.md with guidance on using the settings package. Remaining cleanup tracked in ENT-220. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
strategy_options.summarize.enabledconfigurationChanges
Configuration (
config.go)SummarizeOptionsstruct andGetSummarizeOptions()helperstrategy_options.summarize.enabledin settingsShared Helper (
summarize/summarize.go)GenerateFromTranscript()function as shared helperexplain --generateand auto-summarize at commit timeCheckpoint Package
Summaryfield toWriteCommittedOptionsto allow strategies to pass pre-generated summariesStrategy Integration (
manual_commit_condensation.go)CondenseSession()when enabledTranscriptLinesAtStartmetadataDocumentation
strategy_options.summarize.enabledto README configuration tableBreaking Change
The settings key has been renamed from
strategy_options.summarisetostrategy_options.summarize(US English spelling). Update any existing configuration files accordingly.Test plan
GetSummarizeOptions()with various config shapesGenerateFromTranscript()with mock generatorLinear
Closes ENT-96
🤖 Generated with Claude Code
Note
Medium Risk
Adds an opt-in commit-time flow that shells out to the Claude CLI and persists new summary data into checkpoint metadata; failures are non-blocking but touch strategy condensation and metadata formats. Also renames the config key/package from
summarisetosummarize, which can break existing settings until updated.Overview
Adds opt-in auto-summarization for
manual-commitcheckpoints: duringCondenseSession, the strategy now scopes the transcript to the checkpoint portion and (whenstrategy_options.summarize.enabledis true) generates an AI summary and persists it into committed checkpoint metadata; generation is non-blocking and only logs warnings on failure.Extends checkpoint metadata to carry summaries by adding
SummarytoWriteCommittedOptionsand writing it intometadata.json, and refactorsentire explain --generateto use the new sharedsummarize.GenerateFromTranscripthelper.Renames/cleans up summarization plumbing: the
summarisepackage/spelling is renamed tosummarize, transcript condensing is improved (filtering verbose skill injections and minimizing details for noisy tools likeSkill/Read/WebFetch), and docs are updated to documentstrategy_options.summarize.enabledand the newsettingspackage access pattern.Written by Cursor Bugbot for commit e855fa2. This will update automatically on new commits. Configure here.