Repository navigation
Closed
Labels
Description
Problem
Agents that commit and push their own work (auto_sync_enabled=0) get no git maintenance, no git-health measurements and no bloat alert. Their .git grows without bound and nothing reports it.
The base image turns git's own auto-maintenance off (docker/base-image/Dockerfile:64-76, maintenance.auto=false, gc.auto=0), on the stated basis that the agent server's registered maintenance pass owns repo maintenance. That pass only runs inside the auto-sync cycle:
_maybe_run_git_maintenanceis called only after a successful push (docker/base-image/agent_server/routers/git.py:1484)._collect_git_object_stats/_git_dir_bytes, which feedagent_sync_state.git_dir_bytes / pack_count / loose_objects / maintenance_failures, are also only called in the sync cycle (routers/git.py:1384-1385,1487-1489).- With auto-sync off the loop logs
auto-sync: off (auto_sync_enabled=0), skipping cycle(agent_server/auto_sync.py:171) and returns before either.
So for these agents:
- nothing ever repacks the repo;
- the four git-health columns stay NULL;
- the
git_bloatalert insync_health_service.py(.git≥GIT_DIR_ALERT_BYTES, or 3 consecutive maintenance failures) can never fire.
Evidence (eu2, dev 01707a1e)
- All 13 self-pushing agents (
oracle-*,cleon,cornelius-oracle) haveagent_sync_state.git_dir_bytes / pack_count / loose_objects= NULL andlast_sync_status=never. oracle-2-marketsreached 48,773 loose objects / ~19.8 GB of loose data (about +1,150 objects/day) with no alert. Its.gitwas ~23 GB against the 10 GiB alert threshold.- The host disk reached 94–95% used. It was recovered only by manual out-of-band
git gc.
Proposed fix
- Decouple maintenance from push. On every auto-sync tick, including when auto-sync is off, take the repo lock, run the existing
_reap_stale_git_litter+_collect_git_object_stats+_maybe_run_git_maintenance, and write the stats tosync-state.json. Then skip the sync steps as today. Thresholds, backoff, timeout (GIT_MAINTENANCE_TIMEOUT_SECONDS) and the repo lock are unchanged. - Canary invariant — measurement blindness. A running agent with a git repo whose
agent_sync_stategit stats are NULL, or older than 24 h. This would have caught the current state on day one. - Canary invariant — maintenance not keeping up.
loose_objectsabove a multiple ofGIT_MAINTENANCE_LOOSE_THRESHOLD(e.g. 3×), orpack_countabove a multiple of the pack threshold. Fire while the condition persists. The existinggit_bloatalert is edge-triggered and fires once per crossing.
Notes
- Do not re-enable git's own auto-maintenance as the fix. On eu2 a repo-local
maintenance.auto=truewas killed every minute by the status poll's 30 s fetch timeout (separate issue) and twice left a staleobjects/maintenance.lockthat disables auto-maintenance silently and permanently. - The platform repack uses
git repack, which takes nomaintenance.lock, so it has no stale-lock failure mode. - Open question: whether a 4–5 GB repack fits the 1800 s default on a busy host. Unmeasured;
GIT_MAINTENANCE_TIMEOUT_SECONDScovers it if not.
Activity
obasilakis commentedon Oct 27, 2026
/claim
github-actions commentedon Oct 27, 2026
@obasilakis This issue is already assigned to obasilakis. Use
/unclaimfirst if you want to take over.fix(git): run git maintenance and git-health stats on every auto-sync…
fix(git): flag the raw `rebase --abort` children too; restore sys.mod…
fix: platform git children never start git auto-maintenance (#4001) (#…