add model name to blame#1668
Conversation
There was a problem hiding this comment.
🟡 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:
- 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
)- 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)
Was this helpful? React with 👍 or 👎 to provide feedback.
| return cache; | ||
| } | ||
|
|
||
| let notes = crate::git::notes_api::read_notes_batch(self, &unique).unwrap_or_default(); |
There was a problem hiding this comment.
🚩 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| } 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); |
There was a problem hiding this comment.
🚩 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
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