Skip to content

Conversation

@btucker
Copy link
Owner

@btucker btucker commented Jan 11, 2026

No description provided.

btucker and others added 8 commits January 7, 2026 21:41
Replace custom hash-based line indexing with GitPython's native
repo.blame() called on each session branch. This simplifies the
implementation significantly while improving accuracy.

Changes:
- Remove hash_line(), build_line_grep_index(), lookup_line_with_grep()
- Remove dependency on separate agentgit-index branch
- Add build_session_index() using native git blame per branch
- Add find_earliest_session() to find oldest commit by timestamp
- Add SessionBlameEntry NamedTuple for cleaner data handling
- Add 15 unit tests for blame functionality

The new approach uses git's Myers diff algorithm for line tracking
instead of custom 3-line window hashes, eliminating index staleness
issues and reducing code by ~40% (575 -> 364 lines).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The blame implementation now uses git's native blame on each session
branch instead of the previously documented hash-based index approach.
Updated the "How Blame Works" section to accurately describe the
simpler, more git-native implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The blame implementation was refactored to use native git blame instead
of a custom hash-based index. These tests referenced removed functions
(hash_line, build_line_grep_index, lookup_line_with_grep, normalize_session_path)
that no longer exist.

The new tests for the native git blame approach are in tests/cmd/test_blame.py.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Commit message improvements:
- Use contextual summary from previous assistant message as subject line
- Add previous_message_text field to AssistantContext for richer context
- Structure commit body with Context, Thinking, and truncated User Prompt
- Update blame to prefer informative subject lines over generic ones

Fix conversation rounds grouping bug:
- Tool-result-only user entries no longer break conversation round chains
- Previously, entries like tool_result would set current_prompt=None,
  orphaning all subsequent operations including file changes
- Now tool-result entries are correctly added to the current round

Additional improvements:
- Add has_file_operations() utility for fast transcript scanning
- Add agentgit_build_conversation_rounds hook to web plugin
- Fix session_id extraction for web sessions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a session contains operations for files that no longer exist
(deleted, renamed, etc.), catch FileNotFoundError and OSError in
addition to GitCommandError when adding files to the index.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Major refactoring that simplifies agentgit's git output model:

- One commit per user prompt instead of per operation/scene/round
- Delete old build methods (build, build_from_prompt_responses,
  build_from_conversation_rounds, build_from_scenes)
- Delete Scene, ConversationRound, SourceCommit dataclasses
- Delete old plugin hooks for scene/round building
- Filter system prompts (slash commands, task notifications,
  command output) from becoming commits
- Remove separate "Initial state (pre-session)" commits - file
  initial state now included in first prompt commit that edits it

Also improves agit sessions command:
- Stable numbering (oldest=1, newest=highest)
- Display newest first while preserving stable numbers
- Create session/N refs for easy checkout (git checkout session/1)

Removes ~4600 lines of code while maintaining functionality.
All 462 tests pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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