Skip to content

fix(agent): stop clobbering developer ~/.gitconfig — use GIT_AUTHOR/COMMITTER env vars instead of git config --global #622

Description

@scottschreckengaust

Problem

agent/src/pipeline.py:826-837 runs git config --global user.name bgagent and git config --global user.email bgagent@noreply.github.com before repo setup. Inside the ephemeral ECS container this is intended (attribute commits to the bot), but the same code path runs on developer workstations during local agent runs / dry-runs / pytest that reaches run_task, permanently overwriting the developer's real identity in ~/.gitconfig.

Observed: a contributor's global user.name/user.email silently reset to bgagent / bgagent@noreply.github.com.

Fix

Replace the two git config --global subprocess calls with process-scoped environment variables (GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL), set alongside the existing os.environ writes on lines 838-845. Git honors these for all commits (inherited by Claude Code + the safety-net commit) without touching any on-disk config, so:

  • Container behavior is unchanged (commits still authored as bgagent).
  • A developer's ~/.gitconfig is never modified.

Out of scope: repo.py:153 safe.directory --global is additive and git-mandates global scope; it does not reset identity.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions