Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes loss of attribution summary information when a single checkpoint is associated with multiple sessions, and adds diagnostic persistence for prompt-level attribution inputs.
Changes:
- Adds a post-commit step to compute and persist a combined (multi-session) attribution value at the checkpoint root.
- Persists raw per-prompt attribution data into session metadata for debugging attribution issues.
- Preserves any previously-written
combined_attributionwhen rewriting the root checkpoint summary.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/entire/cli/strategy/manual_commit_hooks.go |
Updates PostCommit to compute/store combined attribution for multi-session checkpoints. |
cmd/entire/cli/strategy/manual_commit_condensation.go |
Serializes prompt attribution details into WriteCommittedOptions for persistence. |
cmd/entire/cli/checkpoint/v2_committed.go |
Writes prompt_attributions into v2 session committed metadata. |
cmd/entire/cli/checkpoint/committed.go |
Writes prompt_attributions, preserves combined_attribution in root summary, and adds an update method to patch root metadata after sessions are written. |
cmd/entire/cli/checkpoint/checkpoint.go |
Extends committed metadata schemas/options with prompt_attributions and root combined_attribution. |
Wrap errors returned from checkpoint.GitStore methods (ReadCommitted, UpdateCheckpointSummary) with fmt.Errorf to satisfy the wrapcheck linter. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…multi-session test Fixes all 4 issues from Copilot and Cursor Bugbot review: 1. Fix misplaced doc comment — marshalPromptAttributions and buildSessionMetrics now have their own correctly positioned doc comments 2. Log warning on marshal failure in marshalPromptAttributions instead of silently returning nil 3. Add ReadSessionMetadata to GitStore — lightweight method that reads only session metadata.json (no transcript/prompt blobs). Used by updateCombinedAttributionForCheckpoint to avoid expensive reads 4. Add TestUpdateCombinedAttribution_MultiSession verifying combined_attribution is computed and persisted across 2 sessions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@BugBot review |
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
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.
Fix multi-session attribution summary loss
When multiple agent sessions contribute to the same checkpoint (same base commit), per-session
InitialAttribution data was being lost during condensation — the root CheckpointSummary only reflected
the latest session's attribution, not the aggregate across all sessions.
This PR fixes the problem with three changes:
sessions in a checkpoint
session's InitialAttribution, aggregates the line counts (agent lines, human added/modified/removed,
total committed), and writes the result back to the root metadata
condensations
transcript or prompt blobs
needed
metadata.json
lines
Note
Medium Risk
Updates checkpoint metadata schema and post-commit behavior to persist new diagnostic attribution data and to mutate root checkpoint metadata after writes; errors could affect checkpoint history or attribution reporting for existing multi-session checkpoints.
Overview
Fixes multi-session attribution loss by introducing a root-level
combined_attributionfield onCheckpointSummaryand updating it after all sessions are condensed.Adds a cheap
ReadSessionMetadatapath plusUpdateCheckpointSummaryto recompute/sum per-sessioninitial_attributionand persist the aggregate without rewriting session content; root summary writes now preserve any existingcombined_attributioninstead of dropping it.Also persists raw per-prompt attribution diagnostics by JSON-encoding
PromptAttributionsinto sessionmetadata.json(prompt_attributions), and wires this through both v1 and v2 committed checkpoint writers. Includes a regression test covering multi-session combined attribution persistence.Written by Cursor Bugbot for commit 44bde7b. Configure here.