Skip to content

feat: add AI-Agent and AI-Model trailers (GIT-73)#47

Merged
TonyCasey merged 1 commit intomainfrom
git-73
Feb 13, 2026
Merged

feat: add AI-Agent and AI-Model trailers (GIT-73)#47
TonyCasey merged 1 commit intomainfrom
git-73

Conversation

@TonyCasey
Copy link
Copy Markdown
Owner

Summary

  • Wire AI-Agent and AI-Model trailers through the full remember flow (CLI, MCP, MemoryService)
  • Update prepare-commit-msg hook to v2 with $GIT_MEM_MODEL detection and in-place upgrade from v1
  • Env var detection: $GIT_MEM_AGENT / $CLAUDE_CODE for agent, $GIT_MEM_MODEL for model
  • All new fields optional — zero breaking changes

Showcase

This commit itself demonstrates all 6 trailer types visible on GitHub:
AI-Decision, AI-Confidence, AI-Memory-Id, AI-Tags, AI-Agent, AI-Model

Plus a git note on refs/notes/mem with the full JSON memory.

Test plan

  • 2 new MemoryService tests (agent/model trailers written, not written when absent)
  • 4 new hook tests (AI-Model set, not set, both trailers, v1→v2 upgrade)
  • All 372 tests pass
  • Type-check and lint clean

Closes GIT-73

🤖 Generated with Claude Code

…GIT-73)

Wire agent/model metadata through CLI, MCP, and MemoryService so that
remember writes AI-Agent and AI-Model commit trailers alongside the
existing AI-Decision/Gotcha/Convention/Fact trailers.

Update prepare-commit-msg hook to v2: detects $GIT_MEM_MODEL and writes
AI-Model trailer next to AI-Agent. Adds in-place upgrade path from v1.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AI-Decision: AI-Agent and AI-Model trailers now written by remember (CLI/MCP) and prepare-commit-msg hook v2
AI-Confidence: high
AI-Memory-Id: a05acad7-6869-4ff6-b64a-faf56da4cc98
AI-Tags: trailers, git-hooks, showcase
AI-Agent: Claude-Code
AI-Model: claude-opus-4-6
Copilot AI review requested due to automatic review settings February 13, 2026 14:48
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown

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 PR adds support for AI-Agent and AI-Model trailers throughout the git-mem codebase, enabling tracking of which AI agent and model created each memory. The implementation maintains backward compatibility by making both fields optional and provides consistent environment variable detection across all entry points.

Changes:

  • Add AI-Agent and AI-Model trailer support to domain entities, service layer, CLI, MCP, and git hooks
  • Upgrade prepare-commit-msg hook from v1 to v2 with automatic in-place upgrade logic
  • Add comprehensive test coverage for new trailer functionality and hook upgrade behavior

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/domain/entities/ITrailer.ts Adds MODEL: 'AI-Model' constant to AI_TRAILER_KEYS
src/domain/entities/IMemoryEntity.ts Adds optional agent and model fields to ICreateMemoryOptions interface
src/application/services/MemoryService.ts Updates buildTrailers to accept options parameter and conditionally write agent/model trailers
src/cli.ts Adds --agent and --model CLI flags with environment variable defaults
src/commands/remember.ts Implements agent/model resolution with fallback chain: explicit flag > GIT_MEM_AGENT/GIT_MEM_MODEL > CLAUDE_CODE
src/mcp/tools/remember.ts Adds agent/model parameters to MCP remember tool with same resolution logic
src/hooks/prepare-commit-msg.ts Upgrades hook to v2 with AI-Model support, adds fingerprint prefix detection for version upgrades, and implements in-place upgrade from v1
tests/unit/application/services/MemoryService.test.ts Adds tests verifying agent/model trailers are written when provided and omitted when not provided
tests/unit/hooks/prepare-commit-msg.test.ts Updates fingerprint expectations to v2, adds v1→v2 upgrade test, and adds tests for AI-Model trailer behavior with/without GIT_MEM_MODEL

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TonyCasey TonyCasey merged commit 63e9856 into main Feb 13, 2026
8 checks passed
@TonyCasey TonyCasey deleted the git-73 branch February 13, 2026 17:06
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