Skip to content

Skip the refs/notes/ai fetch for missing source notes on the http backend - #2100

Open
scouredimage wants to merge 1 commit into
git-ai-project:mainfrom
scouredimage:fix/skip-notes-refs-fetch-on-http-backend
Open

Skip the refs/notes/ai fetch for missing source notes on the http backend#2100
scouredimage wants to merge 1 commit into
git-ai-project:mainfrom
scouredimage:fix/skip-notes-refs-fetch-on-http-backend

Conversation

@scouredimage

Copy link
Copy Markdown
Contributor

Fixes #2099 (first suggested fix there); related to #2093 and a follow-up to #1975.

Problem

On http-backend deployments, fetch_missing_notes_for_commits warms the local cache from the server (#1975) — but whenever the backend legitimately lacks a note (the common case: fresh commits that never had notes), it falls through to the per-remote refs/notes/ai git fetch. On the http backend that ref is never pushed, so the fetch cannot succeed by construction; it only costs a full negotiation per remote (measured at 1–3 minutes on large monorepos, sometimes failing outright on SSH auth) while daemon op-processing blocks behind it.

Production symptom (#2099): git push / gt submit stall for minutes; killing the daemon makes the same push instant. Daemon timelines show fetching authorship notes immediately preceding every slow push.

Fix

When the http backend is enabled, its answer is final: warm the cache from the server, and if notes are still missing, report them missing (same loud error contract, SHAs named) without attempting the refs fetch. The git_notes backend path is unchanged.

Test

fetch_missing_notes_skips_refs_fetch_on_http_backend (TDD — failed before the fix): the repo's origin is a real local remote that does carry the note in refs/notes/ai, while the mocked http backend lacks it. Pre-fix, the fall-through fetch created the tracking ref and returned Ok; post-fix no tracking ref is created and the error names the missing SHA. The #1975 regression test (backend has the note → cached) and the missing-everywhere error-contract test still pass.

Pre-existing on main, unrelated to this change: 5 lib test failures (test_run_command_capture_with_timeout_reports_partial_output, check_for_update_available_returns_update_ready_when_cache_has_pending_update, test_run_logged_command_with_timeout_reports_partial_output, test_load_ai_touched_files_for_specific_commits, conflict_resolution_note_read_errors_are_not_silently_ignored) fail identically on clean origin/main in this environment.

🤖 Generated with Claude Code

…kend

On the http notes backend the server is the sole source of truth:
refs/notes/ai is never pushed there, so the git refs fetch in
fetch_missing_notes_for_commits cannot produce the missing notes by
construction. It still ran whenever the backend lacked a note (the
common case: fresh commits that never had notes), costing a full
negotiation per remote — minutes on large repos — while daemon
op-processing blocked behind it. Users observed multi-minute
git push / gt submit stalls that disappear when the daemon is killed.

With the http backend enabled, treat the backend's answer as final:
warm the cache from the server, and if notes are still missing report
them missing without falling through to the per-remote refs fetch.
The git_notes backend path is unchanged, and the error contract
(missing SHAs named loudly) is preserved.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@scouredimage
scouredimage marked this pull request as ready for review August 5, 2026 02:34

@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: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

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.

Push-time authorship-notes fetch blocks git push for minutes (killing the daemon makes pushes instant); pure-cost fetch on HTTP notes backend

1 participant