Skip to content

Conversation

@khaong
Copy link
Contributor

@khaong khaong commented Feb 2, 2026

Summary

  • Add automatic AI summary generation for checkpoints at commit time (manual-commit strategy only)
  • Summary generation is opt-in via strategy_options.summarize.enabled configuration
  • Uses checkpoint-scoped transcript (not entire session) for more focused summaries
  • Non-blocking: failures are logged but don't prevent commits

Changes

Configuration (config.go)

  • Add SummarizeOptions struct and GetSummarizeOptions() helper
  • Reads from nested strategy_options.summarize.enabled in settings

Shared Helper (summarize/summarize.go)

  • Add GenerateFromTranscript() function as shared helper
  • Used by both explain --generate and auto-summarize at commit time
  • Reduces code duplication between explain.go and manual_commit_condensation.go

Checkpoint Package

  • Add Summary field to WriteCommittedOptions to allow strategies to pass pre-generated summaries

Strategy Integration (manual_commit_condensation.go)

  • Add summary generation to CondenseSession() when enabled
  • Scopes transcript using TranscriptLinesAtStart metadata
  • Logs success/failure without blocking checkpoint creation

Documentation

  • Add strategy_options.summarize.enabled to README configuration table
  • Add "Auto-Summarization" section with configuration example and requirements

Breaking Change

The settings key has been renamed from strategy_options.summarise to strategy_options.summarize (US English spelling). Update any existing configuration files accordingly.

Test plan

  • Unit tests for GetSummarizeOptions() with various config shapes
  • Unit tests for GenerateFromTranscript() with mock generator
  • All existing tests pass
  • Manual test: enable summarize, make changes, commit, verify summary in metadata

Linear

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 summarise to summarize, which can break existing settings until updated.

Overview
Adds opt-in auto-summarization for manual-commit checkpoints: during CondenseSession, the strategy now scopes the transcript to the checkpoint portion and (when strategy_options.summarize.enabled is 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 Summary to WriteCommittedOptions and writing it into metadata.json, and refactors entire explain --generate to use the new shared summarize.GenerateFromTranscript helper.

Renames/cleans up summarization plumbing: the summarise package/spelling is renamed to summarize, transcript condensing is improved (filtering verbose skill injections and minimizing details for noisy tools like Skill/Read/WebFetch), and docs are updated to document strategy_options.summarize.enabled and the new settings package access pattern.

Written by Cursor Bugbot for commit e855fa2. This will update automatically on new commits. Configure here.

khaong and others added 7 commits February 1, 2026 14:38
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
Copilot AI review requested due to automatic review settings February 2, 2026 06:23
Copy link
Contributor

Copilot AI left a 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:

  1. Be preserved from the first session (like InitialAttribution)
  2. Be replaced with the latest session's summary (current behavior)
  3. 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
		}

khaong and others added 3 commits February 2, 2026 18:10
- 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
@khaong khaong marked this pull request as ready for review February 3, 2026 04:11
@khaong khaong requested a review from a team as a code owner February 3, 2026 04:11
@khaong khaong requested a review from Copilot February 3, 2026 04:12
Copy link
Contributor

Copilot AI left a 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.

Copy link

@cursor cursor bot left a 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.

khaong and others added 3 commits February 3, 2026 16:08
- 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
@khaong khaong enabled auto-merge February 3, 2026 05:51
@khaong khaong disabled auto-merge February 4, 2026 04:50
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
@khaong khaong enabled auto-merge February 4, 2026 05:04
@khaong khaong changed the title feat: auto-summarise checkpoints at commit time feat: auto-summarize checkpoints at commit time Feb 4, 2026
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>
@khaong khaong merged commit 4f4f61a into main Feb 4, 2026
4 checks passed
@khaong khaong deleted the alex/ent-96-auto-summaries branch February 4, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants