Skip to content

the warm-up cold check re-probes every repo's default branch after 1 h, so a project load pays a full git ls-remote sweep #438

Backlog

Description

@aitrawog

Category

category:runtime

Type

type:fix

Remedy / files the remedy will touch

spec/refs/git_client.go WarmUp: its cold check requires cached(g.defaultBranches, u, DefaultBranchTTL) (a fresh IN-MEMORY answer, 1 h) while accepting an age-less persisted latest_tags entry (g.persistedTags[u].Value != ""). Make the default-branch half consult persistedDefaultBranches the same way, or move the sweep off the load path; add a test that a fresh process with a >1 h-old persisted cache reports NO repo cold.

Cited design decision or org-rulebook rule (or none)

AGENTS.md R1 (a measured anomaly is fixed or filed); the 1 h TTL is DefaultRefsCacheTTL in spec/refs/git_client.go.

Measured on a real host (2026-11-24), while another session ran charly task verify and a third an image/model pull:

$ /usr/bin/time -v ./charly/bin/charly config ollama-cdi
        User time (seconds): 184.80
      System time (seconds): 55.81
Elapsed (wall clock) time: 30:45.61

and the same run's stderr: charly: fetching git metadata for 32 repo(s) (first run — may take a moment)... followed by charly: git metadata cached (32 repo(s)). — the "first run" message on a host that has been running charly all day.

Mechanism (spec/refs/git_client.go, WarmUp): the cold test is

have := (cached(g.latestTags, u, LatestTagTTL) != "" || g.persistedTags[u].Value != "") &&
        cached(g.defaultBranches, u, DefaultBranchTTL) != ""

The first conjunct deliberately treats a PERSISTED latest-tag entry as prefetch-warm at any age; the second has no persisted twin and needs an in-memory answer younger than DefaultRefsCacheTTL (1 h). load() does fill g.defaultBranches from the file, but with the PERSISTED resolved times — so once those are an hour old, every repo is cold again and the next project load probes the whole corpus.

Under cache: git: bypass: true the cost is paid on EVERY load, because every version-less resolution re-probes on demand as well; that is how the same host measured ~60 s warm and 30 min under network contention. The bypass is host state (and its stale re-assertion is fixed by v0.2026328.1009); this issue is the sweep itself.

Proposed remedy: give the default-branch half the same persisted fallback as the tags half (or key the sweep on the persisted entry and let the on-demand path carry freshness, which it already does), and pin it with a test: a fresh GitClient over a >1 h-old persisted cache reports zero cold repos.

Agent: ollama-vision-models · Claude Code session c765900b-523f-458a-b38f-a0f925f2a9b9
Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

Activity

  1. added
    category:runtime
    type:fix
    on Nov 24, 2026
  2. aitrawog commented on Nov 24, 2026

    @aitrawog
    ContributorAuthor

    STATUS

    STATUS — correcting my own measurement, because the filed claim overstates the cost.

    I re-read the warm-up path after filing. The sweep is a ONE-PER-TTL-EXPIRY cost per host, not a per-load one: the batch prefetch SAVES fresh timestamps, so once the first load after the 1 h expiry has re-probed, every subsequent load in the next hour is warm (WarmUp returns early with no message). My 30-minute sample was taken while the persisted cache was BYPASSED (cache: git: bypass: true, since fixed by bypassOwned in v0.2026328.1009) and two other sessions were resolving the same corpus — under the bypass every resolution is fresh and the sweep is paid every run, which is not the unbypassed steady state.

    So the honest statement of the defect is narrower: once per DefaultRefsCacheTTL (1 h) per host, the first project load re-probes every repo whose refs are version-less, ~5 s warm / minutes under network contention, and the asymmetry with the tags half (which accepts an age-less persisted entry) is what makes that hour a hard cliff rather than a gradual refresh.

    That still looks worth fixing, but the fix is a design choice, not a bug repair: (a) let the default-branch half take the persisted fallback as the tags half does — which also REMOVES the batch and turns the post-expiry load into sequential on-demand probes, i.e. slower unless paired with (b); or (b) refresh the batch in the background so no load blocks on it; or (c) lengthen the default-branch TTL / refresh it on a separate cadence. I am NOT landing any of those under this issue without an operator decision, because all three change the ref-cache freshness contract.

    Status change: none to the code; the issue stays open as the design question above.

    Agent: ollama-vision-models · Claude Code session c765900b-523f-458a-b38f-a0f925f2a9b9
    Assisted-by: Claude Code ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:runtimetype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions