Skip to content

fix(git): an agent with no repository stops filing a "could not check its git remotes" alert (#2930) - #2931

Merged
vybe merged 1 commit into
devfrom
fix/2930-git-sweep-no-repo
Sep 21, 2026
Merged

vybe merged 1 commit into
devfrom
fix/2930-git-sweep-no-repo

Conversation

@obasilakis

Copy link
Copy Markdown
Contributor

Summary

  • On a fresh install every local:-template agent filed a "Trinity could not check this agent's git remotes" operator alert — three of them (acme-scout, acme-sage, acme-scribe) waiting on the Overview tab of a brand-new instance, each also lighting the yellow "1 item needs attention" banner.
  • The cause is that root_readable fails on existence as readily as on permissions, and those agents have no repository at all. The alert then blamed agent_full_capabilities=off withholding DAC_OVERRIDE; on the instance this was found on the setting was unset (defaults to true) and the container held DAC_OVERRIDE, so a first-time operator was told to loosen a security setting that was never involved.

Changes

The sweep script reports two more facts and token_scrub splits them:

  • root_traversable — can this exec enter ROOT at all? That is the capability question, and it is asked about ROOT rather than about the repo on purpose: a missing DAC_OVERRIDE fails the -d .git test too, which is what made "absent" and "unreachable" indistinguishable in the first place.
  • git_present — is there a repository here?

Traversable + absent → no alarm, one debug line. Every other shape alarms exactly as before, so the ent#615 property this must not trade away is intact: an all-zero report from a tree the sweep could not see is still never an all-clear. A report carrying neither flag parses both as 0 and routes to the alarm — the pre-#2930 behaviour.

Test Plan

  • pytest tests/unit/test_ent615_token_free_remotes.py — 96 pass (8 new)
  • Shell-level, running the real script: a repo-less directory (root_traversable=1, git_present=0), a real repo (both 1), an unreadable one (root_traversable=0) — the two positive controls included, so neither assertion can pass against a hard-coded flag
  • Consumer-level: absent → no alarm; unreachable ROOT → alarm; present-but-unreadable → alarm; old flagless report → alarm
  • Manual: a fresh install's starter fleet shows zero operator-queue items from this sweep (the pre-fix behaviour was reproduced on a fresh DigitalOcean v0.9.5 droplet; the droplet has since been destroyed)

Notes

Found while verifying #2899 on a fresh install. The sweep and its alert come from abilityai/trinity-enterprise#615 (PR #2757) — @AndriiPasternak31, worth your eyes since it is your area.

Fixes #2930

🤖 Generated with Claude Code

… its git remotes" alert (#2930)

The ent#615 sweep decided "could I see this tree?" with one flag, `root_readable`,
set by `[ -d .git ] && [ -r ] && [ -x ]`. That fails on EXISTENCE as readily as on
permissions, and an agent created from a `local:` template has no repository at
all — so every stock starter (`acme-scout`/`sage`/`scribe`) filed an operator alert
on every fresh install, and the alert told a first-time operator that the cause was
`agent_full_capabilities=off` withholding DAC_OVERRIDE. On the instance this was
found on, that setting was unset (defaults to true) and the container held
DAC_OVERRIDE: the named cause was not the cause.

The sweep now reports two more facts, and the caller splits them:

* `root_traversable` — can this exec enter ROOT at all? The capability question,
  asked about ROOT rather than about the repo, because a missing DAC_OVERRIDE
  fails the `-d .git` test too and makes "absent" and "unreachable" identical.
* `git_present` — is there a repository here? "Nothing to sweep" is not a finding.

Traversable + absent → no alarm, one debug line. Everything else alarms exactly as
before, so the ent#615 property is untouched: an all-zero report from a tree the
sweep could not see is still never an all-clear. A report carrying neither flag
parses both as 0 and routes to the alarm, which is the pre-#2930 behaviour.

Tests: the real script against a repo-less directory, a real repo, and an
unreadable one (positive controls on both flags), plus the four consumer shapes —
absent, unreachable ROOT, present-but-unreadable, and an old flagless report.

Fixes #2930

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@vybe vybe 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.

merge-train: batch validated on train/20260921-1418 (#2934).

@vybe
vybe merged commit c01ce9c into dev Sep 21, 2026
25 checks passed
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.

2 participants