Skip the refs/notes/ai fetch for missing source notes on the http backend - #2100
Open
scouredimage wants to merge 1 commit into
Open
Conversation
…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
marked this pull request as ready for review
August 5, 2026 02:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2099 (first suggested fix there); related to #2093 and a follow-up to #1975.
Problem
On http-backend deployments,
fetch_missing_notes_for_commitswarms 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-remoterefs/notes/aigit 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 submitstall for minutes; killing the daemon makes the same push instant. Daemon timelines showfetching authorship notesimmediately 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_notesbackend 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 inrefs/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 cleanorigin/mainin this environment.🤖 Generated with Claude Code