fix: bug: agents entrypoint does not set git safe.directory — worktrees fail after container restart (#517) #524
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#524
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-517"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #517
Changes
AI Review
Summary\n\nAdds
git config --global --add safe.directory '*'for the agent user at startup, fixing the dubious-ownership error git raises when worktree directories were created by a different UID (e.g. root) and git is later invoked as theagentuser after a container restart.\n\n### Assessment\n\n- Correctness:safe.directory '*'is the documented, recommended workaround for this scenario in containerised environments. Git has supported the wildcard since 2.35.2.\n- Placement: The call is outside theFORGE_PASScredential guard, so it always runs — correct, since the fix is independent of credential configuration.\n- Consistency: Follows the samegosu agent bash -c "..."pattern used everywhere else in the file.\n- ShellCheck: No issues introduced.\n- Security:safe.directory '*'disables the ownership check entirely for the agent user. Inside an isolated container this is acceptable and is the standard practice.\n\nMinor: placing the safe.directory config insideconfigure_git_credsis slightly odd semantically (it isn't credential-related), but the function runs unconditionally at startup, so this has no practical impact and isn't worth a separate function.Verdict
APPROVE — Correct minimal fix: safe.directory '*' is the standard workaround for git dubious-ownership errors in containers
Reviewed at
c7ca745| AGENTS.mdAI Review: APPROVE — Correct minimal fix: safe.directory '*' is the standard workaround for git dubious-ownership errors in containers