Skip to content

Add model information to commit message attribution #191

@itdove

Description

@itdove

Description

Currently, all commits include generic attribution regardless of which Claude model was used:

Co-Authored-By: Claude <noreply@anthropic.com>

Since DevAIFlow now supports multiple Claude models (Opus 4.6, Sonnet 4.5, Haiku 4.5) via model profiles (vertex, ollama-local, etc.), the attribution should reflect which specific model contributed to the code.

Current Behavior

All commits use the same generic attribution:

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Proposed Behavior

Commits should include the specific model that was used:

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Or for other models:

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

Benefits

  • Transparency: Clear attribution of which AI model contributed
  • Accuracy: Especially important when different models (Opus vs Sonnet vs Haiku) have different capabilities
  • Analytics: Teams can track which models were used for different types of work
  • Historical context: Future developers can understand what AI assistance was available at the time

Implementation Considerations

  1. Model Profile Mapping: The Session.model_profile field stores profile names (e.g., "vertex", "ollama-local"), not model names. Need to:

    • Map profile → actual model name (e.g., "vertex" → "Claude Opus 4.6")
    • Handle custom profiles or unknown profiles gracefully
  2. Fallback Handling: When model info is unavailable:

    • Keep existing generic "Claude" attribution
    • Don't break commits if model detection fails
  3. Location: Modify _generate_commit_message() in devflow/cli/commands/complete_command.py to:

    • Access session's model_profile
    • Resolve to actual model name
    • Include in Co-Authored-By line
  4. Format Options:

    • Option A: Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
    • Option B: Co-Authored-By: Claude (Sonnet 4.5) <noreply@anthropic.com>
    • Option C: Keep generic "Claude" but add comment with model

Related

  • Model name included in Co-Authored-By line for commits
  • Falls back to generic 'Claude' when model info unavailable
  • Handles all supported model profiles (vertex, ollama-local, etc.)
  • Existing tests still pass
  • New tests validate model attribution

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions