Repository navigation
fix(agent-dev): add-git-sync hooks stand down on a Trinity-deployed agent (trinity-enterprise#708) - #24
fix(agent-dev): add-git-sync hooks stand down on a Trinity-deployed agent (trinity-enterprise#708)#24dolho wants to merge 1 commit into
Conversation
…gent (trinity-enterprise#708) Ruling on trinity-enterprise#708 (2026-09-25): on a deployed agent the platform's auto-sync heartbeat owns commit/push durability; the hooks are for local sessions. Both used to run git add -A on the same tree. - Every hook script (Stop, Stop local-only, SessionStart, PreCompact) exits before touching git when TRINITY_BACKEND_URL and AGENT_NAME are both set, the Trinity agent container's own environment. The check lives in the scripts, so a repo carrying them behaves correctly wherever it runs; re-running the skill updates older installs. - The .gitignore block drops the .claude/settings.json + negation pair. Trinity no longer ignores that file (ent#708), so the escape hatch has nothing left to escape. - The installer says plainly when it runs inside a Trinity container. - add-git-sync 1.4; agent-dev 1.16.6. Closes Abilityai/trinity-skills#1 once mirrored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/review ReportBranch:
Execution coverage (Step 2.5)
Critical findingsNone. Informational findings[I1] Residual:
After this PR the hooks exit immediately inside a Trinity container, so onboarding advertises the one place they no longer act. [I2] Version collision with #23 (confidence 8/10)
[I3] No automated test for the stand-down (confidence 7/10) Clean categories
Low confidence (appendix)
Summary
🤖 Generated with Claude Code |
… addressing, settings.json committable, working-branch default, skill-manager fence Platform range dev 1a1deb2b..863240f3 (ops feed to 0378f2550 + 47 commits read source-direct). - create-agent 2.1.2: custom 1.15 + review 1.9 — .claude/settings.json is no longer gitignored or required-ignored (ent#708 content guard); playbook-gap escalation via ask_operator/get_my_ask (ent#611); token tiers for the working-branch default (ent#705); report `to` role (ent#606); report guard matches the #2975 refusal wording - trinity 2.11.2: onboard 6.4 (settings.json scaffold + escape hatch removed, create_agent `kind` + git_mode, autonomy person-only #2996, claude-opus-5-5 CLI floor, ask_operator, chain depth #2806), loop 1.10 (timeout is the owner's act), sync 2.7.2, connect 1.7 (JWT-only key minting), README - agent-dev 1.16.6: create-playbook 2.18 (no respond_to_operator_queue — person-only; get_my_ask; report `to`), add-pipeline 1.8 (tick/recover via ask_operator/get_my_ask, depth refusal halts), add-orchestrator 1.32 (reconcile-skill-map enforces the ent#596 fence + set:<name> ent#530; orchestrate notify-as-role + depth + start_agent lines; sync-fleet-to-head null counts unknown #2105), agent-fleet-analysis 2.5 Open PRs #21-#24 untouched; #24 also sets agent-dev 1.16.6 — rebase to 1.16.7 on merge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
obasilakis
left a comment
There was a problem hiding this comment.
main already ships this fix in 06679ae ("Trinity 1.0.0 truth sync"), which guards all four hook templates with [ -d /opt/trinity/hooks ]. This PR now conflicts in SKILL.md and plugin.json (1.16.6 here vs 1.23.1 on main), and the four templates merge cleanly, so a naive merge leaves each script with two guards.
Notes on the delta:
-
.gitignore. The PR drops the.claude/settings.json+!.claude/settings.jsonpair.mainkeeps both on purpose: Trinity versions before 1.0 still ignore and untrack that file, which holds the hook registration. An agent installed from this PR and deployed to a pre-1.0 instance loses its hooks on the next platform push. Needs a team call on whether pre-1.0 is still supported. -
Detection. The PR keys on
TRINITY_BACKEND_URL+AGENT_NAME.TRINITY_BACKEND_URLis set only when an MCP key exists (crud.py:2200-2207,lifecycle.py:1754-1757), never on the system agent (system_agent_service.py:413,pull_mode.py:119-125), and it is a container env var not written to any profile, so an SSH-started session likely does not see it./opt/trinity/hookscomes from the base image (docker/base-image/Dockerfile:234) and is present in every container. -
Installer notice. The step 1 "this is a Trinity-deployed agent" note is the one piece
mainlacks. Worth keeping, switched to the/opt/trinity/hookscheck.
Shell behaviour verified: all four templates pass bash -n; with both vars set HEAD and remote are unchanged; with one, none, or an empty TRINITY_BACKEND_URL they commit and push as before.
Suggest closing as superseded, or rebasing down to the installer notice only.
Summary
This is the marketplace half of the ruling on abilityai/trinity-enterprise#708 (2026-09-25): on an agent deployed to Trinity, the platform's auto-sync heartbeat owns commit-and-push durability; the
add-git-synchooks own it for local sessions only. Before this change, both rangit add -Aon the same working tree, and neither knew about the other.Closes Abilityai/trinity-skills#1 once mirrored into the library.
TRINITY_BACKEND_URLandAGENT_NAMEare both set, which is the Trinity agent container's own environment..gitignoreblock drops the.claude/settings.json+!.claude/settings.jsonpair. Trinity no longer ignores that file: after ent#708 it keeps a copy out of a commit only when it registers container-only/opt/trinity/hook paths. An existing negation line is harmless and stays.add-git-sync1.4,agent-dev1.16.6.Merge after Abilityai/trinity#3019 (ent#708) is released. Until then, Trinity still ignores
.claude/settings.json. The negation line this PR drops is what keeps the hook registrations tracked on a repo Trinity pushes to.Test plan
bash -npasses on every template; the frontmatter parses.🤖 Generated with Claude Code