Kevesebb push, ugyanannyi kontroll: az AI-ágens helyi mentési pontjai, egy összevont feltöltés és a változatlan beolvasztási kapu / Fewer pushes, the same control: the AI agent's local checkpoints, one combined push and the unchanged merge gate (image text in Hungarian)

An English version of this article follows below. Jump to the English version.

A GitHub október elején részletesen leírta, hogyan kellett újraterveznie a saját git-infrastruktúráját, mert az AI-ágensek megjelenésével a feltöltések és az automatikus ellenőrzések száma egy év alatt a többszörösére nőtt. Ők ezt a terhelést a szolgáltatói oldalon kezelik. Akinek viszont saját git-szervere, saját futtatógépei vagy kvótához kötött felhős kerete van, annak ugyanez a terhelés a saját számláján és a saját várakozási sorában jelenik meg. Ebben a cikkben azt nézem meg, hogyan érdemes az ágenst irányítani úgy, hogy kevesebbet terheljen, miközben a kódáttekintés, az automatikus ellenőrzés, a védett ágak, az auditnapló és a verziótörténet ugyanúgy működik, mint eddig.

1. Amit a GitHub mért

A kiindulópont Brian Celenza cikke a GitHub mérnöki blogján (Building Git infrastructure for agent-scale development, 2026. október 6.). A számok a GitHub teljes platformjára vonatkoznak, és szerintem éppen ezért érdemes komolyan venni őket: nem egy csapat tapasztalatai, hanem egy év alatt lezajlott, platformszintű elmozdulás.

  • A havi git-események száma 2025 szeptembere és 2026 augusztusa között több mint a duplájára nőtt, havi 218,2 milliárdról 473,3 milliárdra.
  • A feltöltések (push) száma éves összevetésben 4,9-szeresére nőtt, havi 0,69 milliárdról 3,35 milliárdra.
  • Csak szeptemberben 7,38 milliárd commit készült a GitHubon, a cikk szóhasználatával fejlesztőktől és ágensektől, ami több mint ötszöröse az egy évvel korábbinak.
  • A pull requestek (PR, beolvasztási kérelem) beolvasztása közel négyszeresére nőtt.
  • A GitHub Actions szeptemberben 3,26 milliárd alkalommal futott, több mint négyszer annyiszor, mint egy évvel korábban.
  • A legforgalmasabb tároló augusztusban nagyjából egymilliárd kérést kapott.

A cikk egy mondata különösen fontos ehhez a témához: "An agent in a tight loop commits or checkpoints after nearly every action." Vagyis egy szoros ciklusban dolgozó ágens szinte minden lépés után commitol vagy mentési pontot készít. A GitHub erre architektúrával válaszolt: szétválasztották a tartós tárolást a kiszolgáló számítási kapacitástól, a koordinációt a hivatkozás (ref) frissítésére szűkítették ("The part of a push that truly needs agreement is the reference update itself."), a karbantartást pedig levették a kiszolgálási útvonalról. Belső teljesítménymérésükben ("In internal benchmarks") ez akár 35-ször nagyobb írási átbocsátást adott. Ezt a számot felső értékként olvasom: belső benchmark, nem éles üzemi mérés, és a körülményeit a cikk nem részletezi.

Egy fontos keretezés: a GitHub-cikk a GitHub saját, szolgáltatói infrastruktúrájáról szól. Nem ír arról, mibe kerül mindez egy saját üzemeltetésű git-szervernek vagy egy kvótás felhős keretnek, és nem ad tanácsot a fejlesztői oldalra. Az, hogy ebből mi következik a felhasználói oldalon, az én következtetésem, és a cikk további részében így is jelölöm.

2. Hol keletkezik a terhelés

A legfontosabb felismerés számomra az, hogy a commit és a push két teljesen különböző súlyú művelet. A commit (helyi mentési pont) a fejlesztő gépén történik, a szerver nem is tud róla. A push (feltöltés a közös tárolóba) viszont szerveroldali írás, és ami utána jön, az sokszorosa magának az írásnak. A GitHub cikke ezt így fogalmazza meg: "Each push multiplies into thousands of reads." Egy feltöltés tehát olvasások ezreivé sokszorozódik, mert a folyamatos integráció (CI, az automatikus fordítás és tesztelés) és a kódszkennelés ugyanazt az ág legfrissebb állapotát percenként akár több ezerszer is letölti.

A saját infrastruktúrán ez a lánc nagyjából így néz ki: a push frissíti a hivatkozást, lefutnak a szerveroldali horgok (hookok, eseményre induló szkriptek), kimennek az értesítések, elindulnak a hozzá kötött workflow-k (automatizált munkafolyamat-leírások), a futtatógépek letöltik a tárolót, és közben az ágens vagy egy eszköz lekérdezi az állapotot. A költség tehát nem commitonként, hanem feltöltésenként és az általa elindított ellenőrzésenként jelentkezik. A felhős számlázás is ezt követi: a GitHub Actions díjszabása szerint a beépített keret havi 2 000 perc (Free), 3 000 perc (Pro és Team), illetve 50 000 perc (Enterprise Cloud), a kétmagos Linux futtatógép percdíja a mai árlista szerint 0,006 USD. Saját futtatógépnél nincs percdíj, ott a megtakarítás kapacitásban és várakozási időben jelenik meg.

Hogy egy saját üzemeltetésű GitLab, Gitea vagy GitHub Enterprise Server egy feltöltésre mekkora processzor- és lemezterheléssel reagál, arra nem találtam nyilvános, hivatkozható mérést. Ez termékenként és konfigurációnként más. Ezért ebben a cikkben a mechanizmusra építek, nem egy kitalált szorzóra.

Egy feltöltés útja: helyi commitok, egy push, ref-frissítés, majd olvasások, CI-futások és kódszkennelés sokszorozódása / The path of a push (diagram labels in Hungarian): local commits, one push, a reference (ref) update, then reads, CI runs and code scans multiplying
Egy feltöltés útja. A helyi commitok nem terhelik a szervert; a push egyetlen írás, amely olvasások, CI-futások és szkennelések sokaságát indítja el.

3. Az ágens szokásai, az én olvasatomban

A GitHub-cikk az ágensek viselkedéséről lényegében annyit mond, hogy szinte minden lépés után commitolnak, és hogy ágensek ezrei a saját águkon tartós írási terhelést adnak. A többi az én olvasatom arról, hogy a mechanizmusok alapján mely szokások drágák. Ezekre a cikk nem ad számot, és nem is állítja őket.

  • Commit után azonnal push. Ha az ágens minden mentési pontot rögtön fel is tölt, a commitok gyakorisága egy az egyben a szerverre kerül, és minden feltöltés újabb ellenőrzési kört indíthat.
  • Javítgatás feltöltésekkel. Bukik a teszt, az ágens kijavít egy sort és újra feltölt, majd megint. Mindegyik kör teljes futás, és a korábbiak tovább futnak, ha semmi nem szakítja meg őket.
  • Történet-újraírás kényszerített feltöltéssel. A PR feje megváltozik, új ellenőrzés indul, a régi pedig fölöslegesen fut tovább.
  • Állapot lekérdezgetése ciklusban. Az ágens percenként többször megkérdezi, kész-e a CI. Ez a GitHubon a REST API kéréskorlátjába ütközik (felhasználónként óránként 5 000 kérés, a workflow-k saját tokenjénél tárolónként óránként 1 000), saját szerveren pedig egyszerűen terhelés.
  • Teljes ellenőrzés minden apró változásra. Egy dokumentációs javítás ugyanazt a teljes fordítást és tesztsort indítja, mint egy adatbázis-migráció.

Ebből számomra az következik, hogy a legtöbb fölösleges terhelés nem az ágens munkájából, hanem a munka és az ellenőrzés összemosásából fakad. Az ágens a mentést és az ellenőrzés kérését ugyanazzal a mozdulattal végzi. Ha ezt a kettőt szétválasztom, a terhelés nagy része eltűnik anélkül, hogy bármelyik kontrollhoz hozzányúlnék.

4. Amit nem adok fel

A GitHub-cikk egyértelmű abban, hogy a skálázás nem mehet a kontrollok rovására: "A maintainer needs branch protections and required reviews so an unreviewed change never reaches the default branch." és "A security team needs audit logs and repository visibility to investigate a suspicious access event." Ezzel teljesen egyetértek, és az alábbi ajánlások mind ebből a keretből indulnak.

Az én megközelítésem lényege: a terhelés a feltöltésnél és az ellenőrzés indításánál keletkezik, az elszámoltathatóság viszont a pull requestnél és a beolvasztásnál él. Ki mit változtatott, ki hagyta jóvá, mely ellenőrzések futottak le, mi került a fő ágra: ez a PR, a kódáttekintés, a kötelező ellenőrzések és a beolvasztási commit láncán látszik, nem az ágens húsz köztes mentési pontján. Ezért a köztes állapotok maradhatnak helyben, vagy összevonhatók, anélkül hogy az auditnyom sérülne. Amihez viszont nem nyúlok:

  • védett ágak: kötelező kódáttekintés, kötelező ellenőrzések, a kényszerített feltöltés tiltása a közös ágakon;
  • az ágens azonosíthatósága: külön technikai fiók vagy kötelező társszerző-jelölés, hogy a PR-ből látsszon, mi készült AI-segítséggel;
  • az auditnapló és a CI-naplók megőrzése a belső szabályzat szerinti ideig;
  • a biztonsági ellenőrzések (statikus kódelemzés, titok- és függőségszkennelés, licencellenőrzés) a beolvasztási kapun;
  • a beolvasztás emberi döntés marad, ágens nem olvaszt be védett ágra.

Az auditálhatóság általános oldaláról a governance-ről szóló szeptemberi cikkemben írtam részletesebben; itt csak annyit emelek ki, hogy a verziótörténet is auditforrás. Egy tiszta, logikai egységekből álló történet nem gyengíti, hanem erősíti az auditot.

5. Ajánlások

Az ajánlások hatására egyik általam olvasott forrás sem ad számszerű, felhasználói oldali mérést. Ezért mindegyiknél a mechanizmust írom le: mit csökkent, és mi marad változatlan.

5.1 Helyi mentés, ritka feltöltés

Az ágens commitoljon gyakran, mert a mentési pont a visszafordíthatóság eszköze, és ez helyben ingyen van. Feltölteni viszont csak egy kész, helyben tesztelt logikai egységet érdemes. Feltöltés előtt a köztes, "wip" és javító commitokat összevonom néhány értelmes commitba. Az interaktív git rebase -i ágensnek nem való, helyette a git reset --soft az alapra és egy új commit, vagy a beolvasztáskori összevonás (squash merge) a járható út.

Egy kockázatot ki kell mondani: a fel nem töltött munka nincs biztonsági mentésben. Ha elvész a gép vagy a munkakönyvtár, elvész a munka is. Erre két megoldást látok: egy külön, ellenőrzés nélküli munkaág-mintára (például wip/**) naponta vagy munkamenetenként feltöltött mentés, vagy helyi mentés. A lényeg, hogy a mentés ne kérjen ellenőrzést.

5.2 Ellenőrzés a PR-re, nem minden feltöltésre

A workflow-kat a pull request eseményeire kötöm, nem minden ágra történő feltöltésre. Így a feltöltés mentés marad, az ellenőrzés pedig akkor indul, amikor van mit átnézni. Ugyanide tartozik a piszkozat (draft) PR. A GitHub dokumentációja szerint "Drafts are useful when you want to share work-in-progress without formally requesting reviews.", és "Draft pull requests cannot be merged". Azt viszont a dokumentáció nem mondja ki, hogy piszkozaton ne futna CI: ezt nekem kell beállítanom, például egy feltétellel, amely a drága feladatokat csak a nem piszkozat PR-en és a "kész az átnézésre" eseményen futtatja. A kötelező kódáttekintést piszkozat amúgy sem elégítheti ki, tehát kontroll itt nem vész el.

5.3 Az elavult futások megszakítása

A GitHub Actions alapviselkedése az, hogy a futások párhuzamosan mennek: "The default behavior of GitHub Actions is to allow multiple jobs or workflow runs to run concurrently." Ha az ágens tíz percen belül ötször tölt fel ugyanarra a PR-re, öt teljes futás indul, holott csak az utolsó eredménye számít. Egy ágenként egyedi párhuzamossági csoport és a cancel-in-progress beállítás megszakítja az elavultakat. A kiadási ágakon ezt nem teszem, és a dokumentáció példája is pontosan így zárja ki őket. A kontroll szempontjából semmi nem vész el: a végső állapot ellenőrzése mindig lefut. Egy megkötést viszont csak másnap tanultam meg, a saját káromon: az ág szerinti csoportkulcs a PR-eseményekre jó, a védett ágra érkező feltöltéseknél minden futásnak saját csoport kell, különben egy biztonsági ellenőrzés csendben kimaradhat (lásd a 10. szakaszt).

5.4 Útvonalszűrés a beragadás csapdája nélkül

Kézenfekvő, hogy egy csak dokumentációt érintő PR ne indítson teljes fordítást és tesztsort. Az útvonalszűrésnek viszont van egy csapdája, amelybe könnyű belesétálni. A GitHub dokumentációja szerint a szűrés miatt kihagyott workflow ellenőrzése függőben marad, és "A pull request that requires those checks to be successful will be blocked from merging." Ha tehát a kötelező ellenőrzés workflow-ját szűröm, a PR beragad. Az én megoldásom: legyen egy mindig lefutó, olcsó kapu-feladat, ez a kötelező ellenőrzés, és ez dönti el a függő feladatok eredményéből, hogy átmehet-e a PR. A drága feladatok így kimaradhatnak, a kapu pedig mindig jelent.

5.5 Klónozás és lekérdezés

A klónozásnál a GitHub egy korábbi blogbejegyzése ad világos iránymutatást. A csak a fát és a történetet letöltő, a fájltartalmakat igény szerint pótló (blobless) klónról azt írják: "These clones are best for developers and build environments that span multiple builds." A sekély (shallow) klónt viszont csak eldobható, egyszer használatos fordítási környezetekre javasolják: "we do not recommend shallow clones except for builds that delete the repository immediately afterwards", mert "calculating a shallow fetch is computationally more expensive compared to a full fetch." Ebből az én szabályom: az ágens tartós munkaklónja blobless legyen, a sekély letöltés csak a CI egyszer használatos klónjában. Ha több ágens dolgozik ugyanazon a tárolón ugyanazon a gépen, a git worktree közös objektumtárral dolgozik, így nem kell minden ágensnek újra klónoznia a szerverről.

A lekérdezésnél a GitHub REST API ajánlásai egyértelműek: "You should subscribe to webhook events instead of polling the API for data." Vagyis lekérdezgetés helyett eseményértesítésre (webhook) kell feliratkozni. Ha mégis lekérdezni kell, a feltételes kérés 304-es válasza nem fogyasztja az elsődleges kéréskorlátot, és a másodlagos korlát elkerüléséhez a kéréseket sorban, nem párhuzamosan kell küldeni. Az ágensnek ezt utasításban kell megmondani, mert magától hajlamos ciklusban kérdezgetni.

Saját szervernél a háttérkarbantartás állapota is számít. A GitHub egy monorepó-karbantartásról szóló bejegyzésében azt írja, hogy egy karbantartási stratégia cseréjével "we reduced the amount of time it took to serve any fetch of that repository by around 80%." Ez a GitHub saját esete, nem egy általam állítható felhasználói szám, de jól mutatja, hogy a karbantartást, ahogy a mostani cikkük is mondja, érdemes a kiszolgálási útvonalon kívül, rendszeresen futtatni.

5.6 Beolvasztási sor: mérlegelve

A beolvasztási sor (merge queue) sorba állítja a PR-eket, és a kötelező ellenőrzéseket a legfrissebb alapon futtatja, így nem kell a szerzőnek újra és újra frissítenie az ágát. A GitHub dokumentációja szerint ehhez a workflow-nak a merge_group eseményre is reagálnia kell. Ez nem csodaszer: PR-enként egy további ellenőrzési kört jelent. Az én olvasatomban akkor éri meg, ha sok ágens dolgozik ugyanarra a fő ágra, és a "frissítsd az ágat, futtasd újra" körök amúgy is többszörös futást okoznak. Kis csapatnál, ritka beolvasztásnál nem feltétlenül kell.

Puha és kemény kontrollok rétegei: ágens-utasítás, helyi pre-push hook, szerveroldali szabályok és a változatlan beolvasztási kapu / Layers of soft and hard controls (diagram labels in Hungarian): the agent instructions, a local pre-push hook, server-side rules and the unchanged merge gate
Három réteg. Az ágens-utasítás puha kontroll, a helyi hook már megállít, de megkerülhető; a szerveroldali szabályok és a beolvasztási kapu a kemény kontroll, ezekhez nem nyúlok.

6. A gyakorlatban: utasítás, hook, workflow

Három rétegben gondolkodom. Az első az ágens utasítása (Claude Code esetén a CLAUDE.md, más eszközöknél például az AGENTS.md). Ez puha kontroll: az ágens jellemzően követi, de garancia nincs rá. A második a helyi pre-push hook, amely feltöltés előtt megállít, de a --no-verify kapcsolóval megkerülhető, ezért nem biztonsági eszköz. A harmadik a szerveroldali beállítás (workflow-trigger, párhuzamossági csoport, védett ág, kvóta), ez a kemény kontroll. Mindhárom kell, mert egyik sem helyettesíti a másikat. Az AI-asszisztált full-stack szállításról szóló cikkemben is arra jutottam, hogy az ágens fegyelme a keretek minőségén múlik, nem a jó szándékán.

Egy rövid szabálykészlet az ágens utasításába (az ágens-utasításokat angolul tartom):

## Git and CI discipline (agent instructions)

1. Commit often locally, push rarely. Checkpoint commits stay on this machine.
   Push only a finished, locally tested unit of work, never after every edit.
2. Before pushing, squash checkpoint, WIP and fixup commits into one or a few
   logical commits with meaningful messages.
3. Open new work as a draft pull request. Mark it ready for review only after
   the local test suite passes.
4. Never force-push to shared branches. If a history rewrite on your own
   feature branch is unavoidable, use --force-with-lease and say why in the PR.
5. Do not poll CI or the API in a loop. Check the status once, wait several
   minutes before the next check, and after two failed CI runs stop and report
   instead of pushing another blind fix.
6. Never bypass hooks (no --no-verify), never disable required checks, never
   merge to a protected branch. Merging is a human decision.
7. Mark AI-assisted work: keep the Co-Authored-By trailer and fill in the
   "AI-assisted" field of the PR template.

A helyi kapu vázlata. Ez egy kiindulópont, nem kipróbált, kész eszköz: a saját környezetben tesztelni kell, és a hibaüzenetei szándékosan mondják ki, hogy az ágens ne próbálkozzon automatikusan újra.

#!/usr/bin/env bash
# .git/hooks/pre-push (or the directory set in core.hooksPath)
# Sketch: block WIP commits and silent force-pushes, run cheap checks.
# Client-side only: --no-verify bypasses it, server-side rules still apply.
set -euo pipefail
zero() { [[ "$1" =~ ^0+$ ]]; }

while read -r local_ref local_sha remote_ref remote_sha; do
  zero "$local_sha" && continue                 # branch deletion
  range="$local_sha"
  zero "$remote_sha" || range="$remote_sha..$local_sha"

  if git log --format=%s "$range" | grep -qiE '^(wip|fixup!|squash!|checkpoint)'; then
    echo "pre-push: WIP/fixup commits found. Squash them first, then push once." >&2
    exit 1
  fi
  if ! zero "$remote_sha" && ! git merge-base --is-ancestor "$remote_sha" "$local_sha"; then
    [ "${ALLOW_FORCE_PUSH:-0}" = "1" ] || {
      echo "pre-push: non-fast-forward push blocked. Do not retry automatically." >&2
      exit 1
    }
  fi
done

# Cheap local gate: whatever fails here would fail in CI as well.
make lint test-fast || { echo "pre-push: local checks failed, fix before pushing." >&2; exit 1; }

És a CI-oldal vázlata GitHub Actionsre. Az ellenőrzés csak PR-eseményre és a beolvasztási sorra fut, az elavult PR-futásokat megszakítja (más futást soha), a drága feladat piszkozaton kimarad, és egy mindig lefutó kapu-feladat a kötelező ellenőrzés, hogy a PR ne ragadjon függő állapotban. GitLabon és Giteán hasonló eszközök vannak (megszakítható feladatok, szabályalapú indítás, beolvasztási vonatok), de a pontos szintaxis és a támogatás verziófüggő, ezt mindig a használt verzió dokumentációjában ellenőrzöm.

# .github/workflows/pr-checks.yml (sketch)
name: pr-checks
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
  merge_group:                      # required when a merge queue is used
# no "on: push" for feature branches: pushing work is a backup, not a check request

concurrency:
  # pull_request: one group per PR, a newer push cancels the outdated run.
  # anything else (merge_group, a push to a protected branch): one group per
  # commit, so no run is cancelled or pushed out of the pending slot.
  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  test:
    # expensive work only when someone will actually review the result
    if: github.event_name == 'merge_group' || github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 1            # throwaway CI clone: shallow is acceptable here
      - run: make test

  required-gate:                    # this job is the required status check
    if: always()                    # always reports, so the PR never hangs in "Pending"
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - run: |
          case "${{ needs.test.result }}" in
            success|skipped) exit 0 ;;
            *) echo "test result: ${{ needs.test.result }}"; exit 1 ;;
          esac

7. Egy illusztratív számítás

Illusztráció, nem mérés. Az alábbi bemeneti számok feltételezések, nem saját mérés és nem egy konkrét szervezet adatai. A célja kizárólag a mechanizmus nagyságrendjének szemléltetése; egyetlen nyilvános forrás sem ad mért értéket arra, mennyit hoznak ezek az ellenszerek.

A modell egyszerű, lineáris képlet: havi CI-perc = feltöltések száma × feltöltésenként futó feladatpercek × a megszakítás után megmaradó arány. Feltételezések: 50 fejlesztő, mindegyik mellett egy ágens, havi 22 munkanap, minden feltöltés teljes, háromfeladatos ellenőrzést indít (kódstílus-ellenőrzés 2 perc, egységteszt 6 perc, fordítás és csomagolás 8 perc, összesen 16 feladatperc, Linux), a percdíj a már idézett 0,006 USD.

  • Fegyelem nélkül: fejlesztőnként napi 25 feltöltés, azaz 50 × 25 × 22 = 27 500 feltöltés havonta, 27 500 × 16 = 440 000 perc, nagyjából 2 640 USD havonta.
  • Fegyelemmel: napi 4 feltöltés (a mentési pontok helyben maradnak), az útvonalszűrés miatt átlagosan 12 feladatperc, a megszakítás a futások 15%-át szünteti meg: 50 × 4 × 22 = 4 400 feltöltés, 4 400 × 12 × 0,85 = 44 880 perc, nagyjából 269 USD havonta.

A két állapot aránya ebben a modellben nagyjából tízszeres, de ez teljes egészében a feltételezett bemenetekből jön. A tanulság nem a szám, hanem a szerkezet: a feltöltések száma az első szorzó, minden más csak utána jön. Egy Team csomag 3 000 perces beépített kerete ebben a nagyságrendben elhanyagolható, tehát a példa lényegében a túllépési díjat mutatja. Saját futtatógépnél ugyanez a különbség nem számlában, hanem kapacitásban és várakozási sorban jelenik meg.

Illusztratív modell: havi CI-percek fegyelem nélkül és fegyelemmel, a feltöltésszám mint első szorzó, illusztráció, nem mérés felirattal / An illustrative model (diagram labels in Hungarian): monthly CI minutes without and with discipline, with the number of pushes as the first multiplier, under a banner reading
Illusztráció, nem mérés. A feltételezett bemenetekkel számolt havi CI-percek, és a képlet, amelyben a feltöltések száma az első szorzó.

8. Mit érdemes mérni

A fenti modell helyett mindenki a saját számait tudja megnézni. Ezeket a mérőszámokat javaslom, mielőtt bármit átállítanék, és utána negyedévente:

  • Feltöltés fejlesztőnként és naponta: a terhelés első szorzója; webhookból, auditnaplóból vagy API-ból.
  • Workflow-futás feltöltésenként: megmutatja, mennyi ellenőrzést indít egy feltöltés.
  • CI-perc beolvasztott PR-enként: a hasznos munkára vetített költség; a számlázási felületről, mert a nyers használati adatok nem mindig egyeznek a számlázottal.
  • Sikertelen futások aránya: ha magas, az ágens a CI-n javítgat ahelyett, hogy helyben tesztelne.
  • Megszakított futások aránya: itt a magas érték a párhuzamossági csoport működését jelzi, nem hibát.
  • Várakozási idő a futtatógépre (95. percentilis): saját futtatógépeknél a legfontosabb kapacitásjel.
  • Idő a beolvasztásig (medián): ellenőrzi, hogy a fegyelem nem lassította-e a szállítást.
  • Függőben ragadt kötelező ellenőrzések: az útvonalszűrés csapdájának jelzője.
  • Kvóta-kihasználtság: felhasznált perc a keret arányában, 80%-nál riasztással; túllépésnél szerintem eszkaláció kell, nem automatikus tiltás.

A bevezetés sorrendjében is a legkisebb kockázattal kezdeném: először mérés, aztán az elavult futások megszakítása, aztán a PR-eseményre kötött ellenőrzés a mentési ággal, utána az útvonalszűrés a kapu-feladattal, majd a helyi hook és az ágens-utasítás, és a beolvasztási sor csak akkor, ha az újrafuttatási körök mérhetően fájnak. Ez nem új gondolat: a CI-ről 2016-ban írt cikkemben is a gyors, helyi visszajelzés és a megbízható közös ellenőrzés egyensúlyáról volt szó. Az ágensek csak felnagyították a tétet.

9. Összefoglalás

Ajánlás Mit csökkent Mi marad változatlan Hol állítom
Helyi mentés, ritka feltöltés, összevonásFeltöltések és az általuk indított futások számaPR, kódáttekintés, beolvasztási commitÁgens-utasítás, pre-push hook
Ellenőrzés PR-eseményre, piszkozat PRFutások a még nem átnézhető munkánKötelező ellenőrzések a beolvasztás előttWorkflow-trigger
Elavult futások megszakításaPárhuzamosan futó, már érdektelen futásokA végső állapot ellenőrzése; védett ági futás sosem szakad megPárhuzamossági csoport
Útvonalszűrés kapu-feladattalDrága feladatok irreleváns változásraA kötelező ellenőrzés mindig jelentWorkflow, védett ág
Blobless munkaklón, sekély csak CI-banÁtvitt adat, drága sekély letöltésekTeljes történet a fejlesztőnélKlónozási beállítás, git worktree
Webhook, feltételes kérésAPI-lekérdezések, kéréskorlátÁllapotinformációÁgens-utasítás, integráció
Beolvasztási sor (mérlegelve)"Frissítsd és futtasd újra" körökKötelező ellenőrzés a legfrissebb alaponVédett ág, merge_group

A GitHub számai szerintem világosan mutatják, hogy az ágensek nem kicsit, hanem nagyságrendben változtatják meg a git-infrastruktúra terhelését. A GitHub ezt architektúrával oldja meg, amire egy saját szervert üzemeltető csapatnak ritkán van módja. Neki a másik oldal marad: az ágens munkamódja. Az én tanulságom az, hogy ehhez nem kell egyetlen kontrollt sem lazítani. Elég szétválasztani a mentést az ellenőrzés kérésétől, és a feltöltést újra annak tekinteni, ami: egy kész munkadarab átadásának, nem egy gondolat elmentésének.

10. Utóirat: másnap reggel, a saját forkomon

A cikk megjelenése utáni reggelen a saját projektemen futottam bele abba, amiről írtam. Előző este az ágenseim egy sűrűn javított PR-sorozaton dolgoztak: több javító feltöltés, és néhány kézi újrafuttatás, mert a csomagletöltés a futtatógépen időnként időtúllépéssel elakadt. Reggelre egyetlen ellenőrzés sem indult el, sem a nyitott PR-eken, sem a fő ágra történt beolvasztás után. A GitHub állapotoldala zöld volt, a PR bezárása és újranyitása sem segített, a perckeret nem fogyott el. Az Actions fülön egy figyelmeztetés magyarázta a helyzetet: "GitHub disabled workflows on this forked repository because of its Actions usage."

Ezt saját megfigyelésként írom le. A GitHub dokumentációjában nem találtam leírást arról, hogy egy forkon milyen használat mellett kapcsolja le a workflow-kat, ezért nem általánosítok minden forkra. A dokumentáció annyit mond, hogy forkon az ütemezett workflow-k alapból nem futnak, és maga is azt ajánlja, hogy a forkon szükségtelen workflow-kat kapcsoljuk ki. Az én workflow-im között nem volt ütemezett, párhuzamossági csoport viszont sem: minden javító feltöltés mellett az előző fej teljes futása is végigment. Amit az 5.3 szakaszban ajánlottam, az nálam nem volt bekapcsolva.

10.1 A javítás, amely majdnem biztonsági rést nyitott

A javítás kézenfekvő volt: párhuzamossági csoport, megszakítás csak PR-eseményre. Az első változatban a csoportkulcs, ahogy a 6. szakasz eredeti vázlatában is, az ág volt. A változtatást egy ágens átnézte és rendben találta. Egy automatikus, commit-szintű biztonsági átnézés viszont megfogta, és igaza volt. A dokumentáció szerint egy csoportban egyszerre legfeljebb egy futás mehet, és alapból legfeljebb egy várakozhat: "By default, any existing `pending` job or workflow in the same concurrency group will be canceled and the new queued job or workflow will take its place." Ez a cancel-in-progress beállítástól független, az csak annyit tesz hozzá, hogy a már futót is megszakítja.

Ha a fő ágra érkező feltöltések egy közös csoportba kerülnek, három gyors beolvasztásnál a középső futása várakozás közben kiszorul, és soha nem indul el. A titokkereső ellenőrzésem feltöltéskor az előző és az új fej közötti commitokat vizsgálja, a következő futás alapja viszont már a kiszorított feltöltés feje. A középső beolvasztás commitjait így senki nem vizsgálja meg: a kapu nem bukik el, egyszerűen kimarad, és éppen akkor, amikor a legtöbbet töltenek fel. Szerintem ez a legrosszabb fajta hiba, mert csendes, és biztonsági irányban nyit.

A javítás: PR-eseménynél a csoport a PR száma, és a régebbi futás megszakad; védett ágra érkező feltöltésnél a csoport a commit azonosítója, vagyis minden futásnak saját csoportja van, nincs kit kiszorítani. A 6. szakasz vázlatát ennek megfelelően javítottam. Az eredeti vázlat csak PR- és beolvasztási sor eseményre futott, ott ez a csapda nem jelentkezett, de amint valaki a védett ágra feltöltés-triggert ad hozzá, ahogy én is, az ág szerinti kulcs bajt okoz. Második védelemként a feltöltéskori titokkeresés alapja az utolsó ténylegesen ellenőrzött commit legyen, ne az esemény előző feje, és a PR-szintű ellenőrzés vizsgálja végig a PR összes commitját; a feltöltéskori futás csak háttérháló.

10.2 Amit ebből megtartok

  • A terhelést csökkentő beállítás is kontroll. Minden, ami arról dönt, hogy egy ellenőrzés lefut-e (párhuzamossági csoport, megszakítás, útvonalszűrő, feltétel), ugyanúgy átnézést és tesztet kíván, mint maga a kapu. Az "optimalizálás" címke nem mentesít. Minden ilyen változtatásnál felteszem a kérdést: ha ez a futás kimarad, lehet-e olyan commit, amelyet egyetlen futás sem látott?
  • A független rétegek értéke. Az ágensi átnézés azt nézte, hogy a változtatás azt teszi-e, amit szeretnék. A gépi biztonsági átnézés azt, hogy mit vesz el a lefedettségből. Egyik sem helyettesíti a másikat.
  • A hiányra is kell riasztás. Mindkét hiba csendes volt: semmi nem bukott el, csak nem futott le. A 8. szakasz listáját kiegészítem egy csend-figyelővel: ha egy nyitott PR-en vagy a fő ág legfrissebb commitján néhány perc után sincs egyetlen ellenőrzés sem, az riasztás, és a workflow-k állapotát is figyelem, nem csak az eredményüket. Ez a figyelő ne az Actions saját ütemezőjén fusson, hiszen ha az Actions áll, az sem fut.
  • A CI platformfüggőség. Egy egyoldalú döntés leállíthatja. Ha a kötelező ellenőrzések nem érhetők el, a beolvasztás vár, vagy helyi ellenőrzéssel megy, de ellenőrzés nélkül nem.

Számomra a legtanulságosabb, hogy a cikk ajánlásai közül éppen a legegyszerűbbet nem alkalmaztam, és amikor pótoltam, abban is elsőre hibáztam. Az ágensek tempója nemcsak a terhelést nagyítja fel, hanem minden apró konfigurációs döntés következményét is.

A cikkben szereplő mért számok kizárólag a hivatkozott nyilvános forrásokból származnak (GitHub Blog, GitHub Docs, 2026. október 8-i olvasás; az árak és korlátok változhatnak). Saját mérést és saját tárolóstatisztikát nem közlök; a 7. szakasz számai feltételezésen alapuló illusztrációk. A 10. szakasz saját megfigyelés a saját forkomon (2026. október 9.), nem mérés; a dokumentáció idézete aznapi olvasás.

Van kérdésed, vagy beszélgetnél a témáról? Írj emailben: info@jonasgergo.hu, vagy keress meg LinkedInen.


Back to the articles

English version

Author: Jónás Gergő | Date: 8 October 2026 (updated: 9 October 2026) | Source: Own analysis, GitHub Blog, GitHub Docs

In early October GitHub described in detail how it had to redesign its own git infrastructure, because with the arrival of AI agents the number of pushes and automated checks grew several times over within a single year. They handle this load on the provider side. But anyone who runs their own git server, their own runners or a quota-bound cloud allowance sees the same load on their own bill and in their own queue. In this article I look at how to steer the agent so that it causes less load, while code review, automated checks, protected branches, the audit log and version history work exactly as before.

1. What GitHub measured

The starting point is Brian Celenza's article on the GitHub engineering blog (Building Git infrastructure for agent-scale development, 6 October 2026). The numbers apply to GitHub's entire platform, and in my view that is exactly why they deserve to be taken seriously: they are not one team's experience but a platform-wide shift that happened within a single year.

  • The number of git events per month more than doubled between September 2025 and August 2026, from 218.2 billion to 473.3 billion per month.
  • The number of pushes grew 4.9 times year over year, from 0.69 billion to 3.35 billion per month.
  • In September alone, 7.38 billion commits were made on GitHub, in the article's wording by developers and agents, more than five times as many as a year earlier.
  • Pull request (PR) merges grew nearly fourfold.
  • GitHub Actions ran 3.26 billion times in September, more than four times as often as a year earlier.
  • The busiest repository received roughly one billion requests in August.

One sentence in the article is especially relevant to this topic: "An agent in a tight loop commits or checkpoints after nearly every action." GitHub answered this with architecture: they separated durable storage from serving compute, narrowed coordination down to the reference (ref) update ("The part of a push that truly needs agreement is the reference update itself."), and moved maintenance off the serving path. In their internal performance testing ("In internal benchmarks") this delivered up to 35 times higher write throughput. I read this number as an upper bound: an internal benchmark, not a production measurement, and the article does not describe its conditions.

An important framing: the GitHub article is about GitHub's own infrastructure as a service provider. It does not say what all this costs a self-hosted git server or a quota-bound cloud allowance, and it gives no advice for the developer side. What follows from it on the user side is my own conclusion, and I mark it as such in the rest of the article.

2. Where the load comes from

The most important insight for me is that a commit and a push are operations of completely different weight. A commit (a local checkpoint) happens on the developer's machine; the server does not even know about it. A push (an upload to the shared repository), on the other hand, is a server-side write, and what follows it is many times the write itself. GitHub's article puts it this way: "Each push multiplies into thousands of reads." A single push multiplies into thousands of reads, because continuous integration (CI, automated building and testing) and code scanning may fetch the latest state of the same branch even thousands of times per minute.

On self-hosted infrastructure the chain looks roughly like this: the push updates the reference, server-side hooks (scripts triggered by events) run, notifications go out, the workflows (automated pipeline definitions) attached to it start, the runners fetch the repository, and meanwhile the agent or a tool polls the status. So the cost arises not per commit but per push and per check that the push triggers. Cloud billing follows the same logic: according to the GitHub Actions pricing, the included allowance is 2,000 minutes per month (Free), 3,000 minutes (Pro and Team) and 50,000 minutes (Enterprise Cloud), and the per-minute rate of a two-core Linux runner is 0.006 USD according to today's price list. Self-hosted runners have no per-minute charge; there the savings show up in capacity and waiting time.

I found no public, citable measurement of how much CPU and disk load a self-hosted GitLab, Gitea or GitHub Enterprise Server produces in response to a push. This varies by product and configuration. That is why in this article I build on the mechanism, not on a made-up multiplier.

The path of a push (diagram labels in Hungarian): local commits, one push, a reference (ref) update, then reads, CI runs and code scans multiplying
The path of a push. Local commits do not load the server; the push is a single write that sets off a multitude of reads, CI runs and scans.

3. The agent's habits, in my reading

About agent behaviour, the GitHub article essentially says only that agents commit after nearly every step, and that thousands of agents working on their own branches produce a sustained write load. The rest is my reading of which habits are expensive, based on the mechanisms. The article gives no numbers for these and does not claim them either.

  • Push right after every commit. If the agent uploads every checkpoint immediately, the commit frequency lands on the server one to one, and every push can start another round of checks.
  • Fixing things by pushing. A test fails, the agent fixes one line and pushes again, then again. Each round is a full run, and the earlier ones keep running if nothing cancels them.
  • Rewriting history with force pushes. The head of the PR changes, a new check starts, and the old one keeps running needlessly.
  • Polling status in a loop. The agent asks several times a minute whether CI is done. On GitHub this runs into the REST API rate limit (5,000 requests per hour per user, and 1,000 per hour per repository for the workflows' own token); on your own server it is simply load.
  • A full check for every tiny change. A documentation fix triggers the same full build and test suite as a database migration.

From this I conclude that most of the unnecessary load comes not from the agent's work but from mixing up work and verification. The agent saves its work and requests a check with the same move. If I separate the two, most of the load disappears without my touching any control.

4. What I do not give up

The GitHub article is clear that scaling must not come at the expense of controls: "A maintainer needs branch protections and required reviews so an unreviewed change never reaches the default branch." and "A security team needs audit logs and repository visibility to investigate a suspicious access event." I agree completely, and all the recommendations below start from this frame.

The core of my approach: the load arises at the push and when checks are triggered, while accountability lives in the pull request and the merge. Who changed what, who approved it, which checks ran, what landed on the main branch: this is visible in the chain of the PR, the code review, the required checks and the merge commit, not in the agent's twenty intermediate checkpoints. That is why intermediate states can stay local, or be squashed, without harming the audit trail. What I do not touch:

  • protected branches: required code review, required checks, no force pushes on shared branches;
  • agent identifiability: a separate technical account or a mandatory co-author trailer, so that the PR shows what was made with AI assistance;
  • retention of the audit log and the CI logs for the period set by internal policy;
  • security checks (static code analysis, secret and dependency scanning, license checks) at the merge gate;
  • merging remains a human decision; no agent merges into a protected branch.

I wrote about the general side of auditability in more detail in my September article on governance (in Hungarian); here I only point out that version history is also an audit source. A clean history made of logical units does not weaken the audit, it strengthens it.

5. Recommendations

None of the sources I read gives a numerical, user-side measurement of the effect of these recommendations. So for each one I describe the mechanism: what it reduces and what stays unchanged.

5.1 Local checkpoints, infrequent pushes

The agent should commit often, because a checkpoint is the tool of reversibility, and locally it is free. But it is only worth pushing a finished, locally tested logical unit. Before pushing, I squash the intermediate, "wip" and fixup commits into a few meaningful commits. Interactive git rebase -i is not suited to an agent; the workable route instead is git reset --soft to the base followed by a new commit, or squashing at merge time (squash merge).

One risk has to be stated: unpushed work is not backed up. If the machine or the working directory is lost, the work is lost too. I see two solutions: a backup pushed daily or per session to a separate work branch pattern without checks (for example wip/**), or a local backup. The point is that the backup must not request a check.

5.2 Checks on the PR, not on every push

I bind workflows to pull request events, not to every push to any branch. That way a push stays a backup, and the check starts when there is something to review. Draft PRs belong here too. According to GitHub's documentation, "Drafts are useful when you want to share work-in-progress without formally requesting reviews.", and "Draft pull requests cannot be merged". The documentation does not say, however, that CI does not run on drafts: I have to configure that myself, for example with a condition that runs the expensive jobs only on non-draft PRs and on the "ready for review" event. A draft cannot satisfy required code review anyway, so no control is lost here.

5.3 Cancelling outdated runs

The default behaviour of GitHub Actions is that runs proceed in parallel: "The default behavior of GitHub Actions is to allow multiple jobs or workflow runs to run concurrently." If the agent pushes five times to the same PR within ten minutes, five full runs start, although only the result of the last one matters. A per-branch concurrency group and the cancel-in-progress setting cancel the outdated ones. I do not do this on release branches, and the documentation's example excludes them in exactly this way. From a control point of view nothing is lost: the check of the final state always runs. One constraint, however, I only learned the next day, the hard way: a per-branch group key is fine for PR events, but pushes to a protected branch need a group of their own for every run, otherwise a security check can be skipped silently (see section 10).

5.4 Path filtering without the stuck-check trap

It is obvious that a PR touching only documentation should not trigger a full build and test suite. Path filtering, however, has a trap that is easy to walk into. According to GitHub's documentation, the check of a workflow skipped because of filtering stays pending, and "A pull request that requires those checks to be successful will be blocked from merging." So if I filter the workflow of the required check, the PR gets stuck. My solution: a cheap gate job that always runs is the required check, and it decides from the results of the dependent jobs whether the PR may pass. The expensive jobs can then be skipped, and the gate always reports.

5.5 Cloning and polling

For cloning, an earlier GitHub blog post gives clear guidance. About the blobless clone, which downloads only the trees and the history and fetches file contents on demand, they write: "These clones are best for developers and build environments that span multiple builds." The shallow clone, by contrast, they recommend only for throwaway, single-use build environments: "we do not recommend shallow clones except for builds that delete the repository immediately afterwards", because "calculating a shallow fetch is computationally more expensive compared to a full fetch." My rule from this: the agent's long-lived working clone should be blobless, and shallow fetches belong only in the single-use CI clone. If several agents work on the same repository on the same machine, git worktree works with a shared object store, so not every agent has to clone again from the server.

For polling, GitHub's REST API recommendations are unambiguous: "You should subscribe to webhook events instead of polling the API for data." In other words, subscribe to event notifications (webhooks) instead of querying again and again. If polling is unavoidable, a 304 response to a conditional request does not count against the primary rate limit, and to avoid the secondary limit requests should be sent one after another, not in parallel. The agent has to be told this in its instructions, because left to itself it tends to ask in a loop.

On a self-hosted server the state of background maintenance matters as well. In a post on monorepo maintenance GitHub writes that by changing a maintenance strategy "we reduced the amount of time it took to serve any fetch of that repository by around 80%." This is GitHub's own case, not a user-side number I could claim, but it shows well that maintenance, as their current article also says, is worth running regularly and off the serving path.

5.6 Merge queue: a judgement call

A merge queue lines up PRs and runs the required checks on the latest base, so the author does not have to update their branch again and again. According to GitHub's documentation, the workflow must also respond to the merge_group event for this. It is not a silver bullet: it means one additional round of checks per PR. In my reading it pays off when many agents work against the same main branch and the "update your branch, run it again" rounds cause multiple runs anyway. For a small team with infrequent merges it is not necessarily needed.

Layers of soft and hard controls (diagram labels in Hungarian): the agent instructions, a local pre-push hook, server-side rules and the unchanged merge gate
Three layers. The agent instructions are a soft control. The local hook does stop a push, but it can be bypassed. The server-side rules and the merge gate are the hard controls, and I do not touch them.

6. In practice: instructions, hook, workflow

I think in three layers. The first is the agent's instructions (CLAUDE.md for Claude Code, for example AGENTS.md for other tools). This is a soft control: the agent typically follows it, but there is no guarantee. The second is the local pre-push hook, which stops a push before it happens but can be bypassed with the --no-verify flag, so it is not a security tool. The third is the server-side configuration (workflow triggers, concurrency group, protected branch, quota); this is the hard control. All three are needed, because none of them replaces the others. In my article on AI-assisted full-stack delivery (in Hungarian) I also concluded that an agent's discipline depends on the quality of its guardrails, not on its good intentions.

A short rule set for the agent's instructions (I keep agent instructions in English):

## Git and CI discipline (agent instructions)

1. Commit often locally, push rarely. Checkpoint commits stay on this machine.
   Push only a finished, locally tested unit of work, never after every edit.
2. Before pushing, squash checkpoint, WIP and fixup commits into one or a few
   logical commits with meaningful messages.
3. Open new work as a draft pull request. Mark it ready for review only after
   the local test suite passes.
4. Never force-push to shared branches. If a history rewrite on your own
   feature branch is unavoidable, use --force-with-lease and say why in the PR.
5. Do not poll CI or the API in a loop. Check the status once, wait several
   minutes before the next check, and after two failed CI runs stop and report
   instead of pushing another blind fix.
6. Never bypass hooks (no --no-verify), never disable required checks, never
   merge to a protected branch. Merging is a human decision.
7. Mark AI-assisted work: keep the Co-Authored-By trailer and fill in the
   "AI-assisted" field of the PR template.

A sketch of the local gate. It is a starting point, not a tried and finished tool: it has to be tested in your own environment, and its error messages deliberately tell the agent not to retry automatically.

#!/usr/bin/env bash
# .git/hooks/pre-push (or the directory set in core.hooksPath)
# Sketch: block WIP commits and silent force-pushes, run cheap checks.
# Client-side only: --no-verify bypasses it, server-side rules still apply.
set -euo pipefail
zero() { [[ "$1" =~ ^0+$ ]]; }

while read -r local_ref local_sha remote_ref remote_sha; do
  zero "$local_sha" && continue                 # branch deletion
  range="$local_sha"
  zero "$remote_sha" || range="$remote_sha..$local_sha"

  if git log --format=%s "$range" | grep -qiE '^(wip|fixup!|squash!|checkpoint)'; then
    echo "pre-push: WIP/fixup commits found. Squash them first, then push once." >&2
    exit 1
  fi
  if ! zero "$remote_sha" && ! git merge-base --is-ancestor "$remote_sha" "$local_sha"; then
    [ "${ALLOW_FORCE_PUSH:-0}" = "1" ] || {
      echo "pre-push: non-fast-forward push blocked. Do not retry automatically." >&2
      exit 1
    }
  fi
done

# Cheap local gate: whatever fails here would fail in CI as well.
make lint test-fast || { echo "pre-push: local checks failed, fix before pushing." >&2; exit 1; }

And a sketch of the CI side for GitHub Actions. The check runs only on PR events and on the merge queue, it cancels outdated PR runs (and nothing else), the expensive job is skipped on drafts, and an always-running gate job is the required check, so that the PR never hangs in a pending state. GitLab and Gitea have similar tools (interruptible jobs, rule-based triggering, merge trains), but the exact syntax and support depend on the version, so I always check this in the documentation of the version in use.

# .github/workflows/pr-checks.yml (sketch)
name: pr-checks
on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
  merge_group:                      # required when a merge queue is used
# no "on: push" for feature branches: pushing work is a backup, not a check request

concurrency:
  # pull_request: one group per PR, a newer push cancels the outdated run.
  # anything else (merge_group, a push to a protected branch): one group per
  # commit, so no run is cancelled or pushed out of the pending slot.
  group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.sha }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
  test:
    # expensive work only when someone will actually review the result
    if: github.event_name == 'merge_group' || github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 1            # throwaway CI clone: shallow is acceptable here
      - run: make test

  required-gate:                    # this job is the required status check
    if: always()                    # always reports, so the PR never hangs in "Pending"
    needs: [test]
    runs-on: ubuntu-latest
    steps:
      - run: |
          case "${{ needs.test.result }}" in
            success|skipped) exit 0 ;;
            *) echo "test result: ${{ needs.test.result }}"; exit 1 ;;
          esac

7. An illustrative calculation

Illustration, not a measurement. The input numbers below are assumptions, not my own measurement and not data from any specific organization. Their sole purpose is to illustrate the order of magnitude of the mechanism; no public source gives a measured value for how much these countermeasures deliver.

The model is a simple, linear formula: monthly CI minutes = number of pushes × job minutes per push × the share remaining after cancellation. Assumptions: 50 developers, each with one agent, 22 working days a month, every push triggers a full three-job check (linting 2 minutes, unit tests 6 minutes, build and packaging 8 minutes, 16 job minutes in total, Linux), and the per-minute rate is the 0.006 USD already quoted.

  • Without discipline: 25 pushes per developer per day, i.e. 50 × 25 × 22 = 27,500 pushes a month, 27,500 × 16 = 440,000 minutes, roughly 2,640 USD a month.
  • With discipline: 4 pushes a day (the checkpoints stay local), 12 job minutes on average thanks to path filtering, and cancellation eliminates 15% of the runs: 50 × 4 × 22 = 4,400 pushes, 4,400 × 12 × 0.85 = 44,880 minutes, roughly 269 USD a month.

In this model the ratio between the two states is roughly tenfold, but that comes entirely from the assumed inputs. The lesson is not the number but the structure: the number of pushes is the first multiplier, and everything else comes after it. The 3,000-minute included allowance of a Team plan is negligible at this scale, so the example essentially shows the overage charge. With self-hosted runners the same difference shows up not on a bill but in capacity and in the queue.

An illustrative model (diagram labels in Hungarian): monthly CI minutes without and with discipline, with the number of pushes as the first multiplier, under a banner reading
An illustration, not a measurement: monthly CI minutes calculated from assumed inputs, and the formula in which the number of pushes is the first multiplier.

8. What is worth measuring

Instead of the model above, everyone can look at their own numbers. I suggest these metrics before changing anything, and quarterly afterwards:

  • Pushes per developer per day: the first multiplier of the load; from webhooks, the audit log or the API.
  • Workflow runs per push: shows how many checks a single push triggers.
  • CI minutes per merged PR: the cost relative to useful work; taken from the billing interface, because raw usage data does not always match what is billed.
  • Failed run rate: if it is high, the agent is fixing things on CI instead of testing locally.
  • Cancelled run rate: here a high value indicates that the concurrency group is working, not an error.
  • Runner queue time (95th percentile): the most important capacity signal for self-hosted runners.
  • Time to merge (median): checks that the discipline has not slowed down delivery.
  • Required checks stuck in pending: the indicator of the path-filtering trap.
  • Quota utilization: minutes used relative to the allowance, with an alert at 80%; on an overrun I think escalation is needed, not an automatic block.

For the rollout order I would also start with the lowest risk: first measurement, then cancelling outdated runs, then PR-event-bound checks together with the backup branch, then path filtering with the gate job, then the local hook and the agent instructions, and the merge queue only if the rerun rounds measurably hurt. This is not a new idea: in my 2016 article on CI (in Hungarian) I also wrote about the balance between fast local feedback and reliable shared checks. Agents have only raised the stakes.

9. Summary

Recommendation What it reduces What stays unchanged Where I configure it
Local checkpoints, infrequent pushes, squashingNumber of pushes and of the runs they triggerPR, code review, merge commitAgent instructions, pre-push hook
Checks on PR events, draft PRsRuns on work that is not yet ready for reviewRequired checks before mergingWorkflow trigger
Cancelling outdated runsParallel runs that no longer matterThe check of the final state; a protected-branch run is never cancelledConcurrency group
Path filtering with a gate jobExpensive jobs on irrelevant changesThe required check always reportsWorkflow, protected branch
Blobless working clone, shallow only in CITransferred data, expensive shallow fetchesFull history on the developer's sideClone settings, git worktree
Webhooks, conditional requestsAPI polling, rate limitStatus informationAgent instructions, integration
Merge queue (weighed case by case)"Update and rerun" roundsRequired check on the latest baseProtected branch, merge_group

In my view GitHub's numbers show clearly that agents change the load on git infrastructure not slightly but by orders of magnitude. GitHub solves this with architecture, which a team running its own server rarely has the means to do. What remains for such a team is the other side: the agent's way of working. My takeaway is that this does not require loosening a single control. It is enough to separate saving from requesting a check, and to treat a push again as what it is: the handover of a finished piece of work, not the saving of a thought.

10. Postscript: the next morning, on my own fork

The morning after this article appeared, I ran into what I had written about on my own project. The evening before, my agents had been working on a series of heavily revised PRs: several fix pushes, and a few manual re-runs, because the package download on the runner kept timing out. By the morning not a single check had started, neither on the open PRs nor after a merge to the main branch. GitHub's status page was green, closing and reopening the PR did not help, and the minute quota was not used up. A banner on the Actions tab explained the situation: "GitHub disabled workflows on this forked repository because of its Actions usage."

I describe this as my own observation. I found no description in GitHub's documentation of the usage at which workflows are switched off on a fork, so I do not generalise it to every fork. The documentation says that scheduled workflows do not run on a fork by default, and it recommends disabling workflows a fork does not need. None of my workflows was scheduled, but none had a concurrency group either: next to every fix push, the full run of the previous head also ran to the end. What I recommended in section 5.3 was not switched on in my own repository.

10.1 The fix that almost opened a security gap

The fix was obvious: a concurrency group, cancellation for PR events only. In the first version the group key was the branch, as in the original sketch in section 6. An agent reviewed the change and found it fine. An automated, commit-level security review caught it, and it was right. According to the documentation, at most one run can be running in a group, and by default at most one can wait: "By default, any existing `pending` job or workflow in the same concurrency group will be canceled and the new queued job or workflow will take its place." This is independent of cancel-in-progress, which only adds that the running one is cancelled as well.

If pushes to the main branch share one group, three quick merges push the middle run out of the pending slot, and it never starts. My secret scan examines the commits between the previous and the new head on a push, but the next run's base is already the head of the displaced push. Nobody examines the middle merge's commits: the gate does not fail, it is simply skipped, and exactly when people push the most. In my view this is the worst kind of defect, because it is silent and it opens in the security direction.

The fix: on a PR event the group is the PR number, and the older run is cancelled; on a push to a protected branch the group is the commit id, so every run has a group of its own and there is nothing to displace. I corrected the sketch in section 6 accordingly. The original sketch ran only on PR and merge queue events, where this trap does not appear, but as soon as someone adds a push trigger for the protected branch, as I had, the per-branch key causes trouble. As a second line of defence, the push-time secret scan should diff against the last commit that was actually scanned, not the event's previous head, and the PR-level check should examine every commit of the PR; the push-time run is only a safety net.

10.2 What I keep from this

  • A setting that reduces load is a control too. Everything that decides whether a check runs (concurrency group, cancellation, path filter, condition) needs review and testing just like the gate itself. The "optimisation" label is no exemption. For every such change I ask: if this run is skipped, can there be a commit that no run has seen?
  • The value of independent layers. The agent's review checked whether the change does what I want. The automated security review checked what it takes away from coverage. Neither replaces the other.
  • Absence needs an alarm as well. Both failures were silent: nothing failed, it just did not run. I add a silence monitor to the list in section 8: if an open PR or the latest commit of the main branch has no check at all after a few minutes, that is an alarm, and I watch the state of the workflows, not only their results. This monitor should not run on the Actions scheduler itself, because if Actions is down, it does not run either.
  • CI is a platform dependency. A one-sided decision can stop it. If the required checks are unavailable, the merge waits or goes ahead with a local check, but never without a check.

What I find most instructive is that of all the recommendations in this article I had not applied the simplest one, and when I made up for it, I got that wrong at first too. The pace of agents magnifies not only the load, but the consequences of every small configuration decision.

The measured numbers in this article come exclusively from the cited public sources (GitHub Blog, GitHub Docs, read on 8 October 2026; prices and limits may change). I do not publish my own measurements or my own repository statistics; the numbers in section 7 are illustrations based on assumptions. Section 10 is my own observation on my own fork (9 October 2026), not a measurement; the documentation quote was read that day.

Questions, or want to talk it through? Write to info@jonasgergo.hu, or find me on LinkedIn.