Skip to content

add model name to blame#1668

Open
acunniffe wants to merge 1 commit into
mainfrom
feat/blame-with-model
Open

add model name to blame#1668
acunniffe wants to merge 1 commit into
mainfrom
feat/blame-with-model

Conversation

@acunniffe

@acunniffe acunniffe commented Jun 27, 2026

Copy link
Copy Markdown
Collaborator

Several users have been confused by models not showing up in blame output. They do save in the note, but we have not been showing them in the blame.

Also improved performance by cutting duplicate note reads per hunk

@acunniffe acunniffe requested a review from svarlamov June 27, 2026 03:17

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Open in Devin Review

Comment thread src/commands/blame.rs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Model name missing from blame output when --show-prompt flag is used

The agent model name is omitted from the rendered blame line (format!("{} [{}]", prompt.agent_id.tool, short_hash) at src/commands/blame.rs:1832) despite the width calculation including it, so --show-prompt output shows only the tool name with excess padding instead of the intended "tool model [hash]" format.

Impact: Users running git-ai blame --show-prompt see the agent name without the model, contradicting the PR's goal of displaying both.

Width calculation was updated but the parallel rendering site was not

The output_default_format function has two nearly-identical show_prompt branches:

  1. Width calculation at src/commands/blame.rs:1776-1780 (correctly updated):
format!(
    "{} [{}]",
    format_agent_author(&prompt.agent_id.tool, &prompt.agent_id.model),
    short_hash
)
  1. Actual rendering at src/commands/blame.rs:1830-1832 (not updated):
format!("{} [{}]", prompt.agent_id.tool, short_hash)

The width loop at line 1778 computes max_author_width using the full format_agent_author output (e.g. "cursor sonnet-4-6 [abc1234]"), but the rendering loop at line 1832 produces only "cursor [abc1234]". This results in (a) model info missing from --show-prompt output and (b) extra whitespace padding in the author column.

(Refers to line 1832)

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread src/commands/blame.rs
return cache;
}

let notes = crate::git::notes_api::read_notes_batch(self, &unique).unwrap_or_default();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Batched note loading drops HTTP fetch-and-cache step present in old per-commit path

The old code called read_authorship_v3 per commit, which for the HTTP backend tried the local cache and then fell back directly to local git notes. The new read_notes_batch (src/git/notes_api.rs:57-94) adds an intermediate step (http_fetch_and_cache_notes) that actively fetches from the remote HTTP backend before falling back to local git notes. This is a behavioral change (the batched path is actually more thorough) but likely an improvement rather than a regression — commits that exist on the remote but not in the local cache will now be found. However, this could cause unexpected network calls in scenarios where the old code never hit the network for blame operations.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread src/commands/blame.rs
} else {
// Strip a redundant "claude-" prefix (e.g. "claude-sonnet-4-6" -> "sonnet-4-6")
// to keep the label compact.
let model = model.strip_prefix("claude-").unwrap_or(model);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 format_agent_author strips 'claude-' prefix unconditionally from model strings

The format_agent_author function at src/commands/blame.rs:1084 strips a leading claude- prefix from any model string regardless of tool name. This means if an agent tool named 'windsurf' happens to report a model like 'claude-3.5-sonnet', it would display as 'windsurf 3.5-sonnet'. The test at line 2308 (format_agent_author("amp", "anthropic/claude-opus")) shows that only a leading claude- is stripped, and since Anthropic model IDs typically start with claude-, this will commonly trigger for non-Claude tools that use Claude models. This seems intentional per the test but is worth a design review since it could confuse users who see a truncated model name on a non-Claude-branded tool.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant