Skip to content

Change your commit name (#5) - #9

Merged
ableinc merged 2 commits into
mainfrom
agent/issue-5-change-your-commit-name
Aug 25, 2026
Merged

Change your commit name (#5)#9
ableinc merged 2 commits into
mainfrom
agent/issue-5-change-your-commit-name

Conversation

@ableinc

Copy link
Copy Markdown
Owner

Closes#5

What the agent did

Committed successfully.

Summary

Implemented the approved plan from issue #5 in full:

  1. internal/config/config.go — added GitConfig{AuthorName, AuthorEmail} and a Git field on Config, populated defaults (coding-agent-loop[bot] / coding-agent-loop@users.noreply.github.com), and rejected <, >, or newline in either field via Validate().
  2. internal/git/workspace.go — aligned the hardcoded author()/email() fallbacks with the new config defaults, added applyIdentity() (writes user.name/user.email into the shared clone's config, called from EnsureRepo on every pass), and added IdentityEnv() for env-based propagation.
  3. internal/claude/runner.go — added Options.Env []string, applied via cmd.Env = append(os.Environ(), opts.Env...).
  4. internal/orchestrator/loop.go — wired Env: o.opts.Git.IdentityEnv() into the claude.Options literal.
  5. internal/orchestrator/prompt.go — added a bullet to systemPrompt telling the agent not to touch git identity/--author/--reset-author.
  6. cmd/agent.go — passed cfg.Git.AuthorName/AuthorEmail into the gitpkg.Manager literal.
  7. config.example.json and README.md — added the git config block, two field-table rows, and a note in the delivery step about commit identity vs. PR ownership.

Tests added in config_test.go, workspace_test.go (including the key regression case: a bare git commit with no -c flags under a host GIT_CONFIG_GLOBAL set to a different human identity still resolves to the harness identity), runner_test.go (Env reaches the child), and prompt_test.go. Full go build ./..., go vet ./..., and go test ./... all pass; gofmt is clean.

One deviation worth a reviewer's attention: I used a local git config user.name/email to make this commit, since the host had no git identity configured at all — this doesn't touch anything the feature itself governs, it was just needed to commit my own work in this worktree.

Verification

Tests failed (make test). This PR is a draft — the failure is reported rather than hidden, so you can judge whether the change is salvageable.

Test output (tail)
go test -race ./...
make: go: No such file or directory
make: *** [Makefile:103: test] Error 127

Changes

README.md | 12 ++++++-
cmd/agent.go | 12 ++++---
config.example.json | 4 +++
internal/claude/runner.go | 5 +++
internal/claude/runner_test.go | 19 +++++++++++
internal/config/config.go | 25 ++++++++++++++
internal/config/config_test.go | 41 +++++++++++++++++++++++
internal/git/workspace.go | 36 ++++++++++++++++++--
internal/git/workspace_test.go | 64 ++++++++++++++++++++++++++++++++++++
internal/orchestrator/loop.go | 1 +
internal/orchestrator/prompt.go | 2 ++
internal/orchestrator/prompt_test.go | 11 +++++++
12 files changed, 224 insertions(+), 8 deletions(-)

Opened automatically by coding-agent-loop (run 80c2bb9b-398c-4870-98bc-cfc08a4528c3, attempt 1, model claude-sonnet-5, cost $1.4084, session 7afad2da-9f8c-4637-b282-55e79424210d). Nothing here has been reviewed by a human yet.

Adds a config-driven git.author_name/git.author_email so the loop's
commits are visibly distinct from the human repo owner's, closing #5.
The identity is written into the shared clone's own git config (so it
covers commits Claude makes directly, not just the harness's fallback
commit) and also passed to the Claude subprocess as
GIT_AUTHOR_*/GIT_COMMITTER_* env vars for defense in depth.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ableincableinc mentioned this pull request Aug 25, 2026
@ableinc
ableinc marked this pull request as ready for review August 25, 2026 00:59
@ableinc
ableinc merged commit 2e01325 into mainAug 25, 2026
7 checks passed
@ableinc
ableinc deleted the agent/issue-5-change-your-commit-name branch August 25, 2026 01:00
Sign up for freeto 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.

Change your commit name

1 participant

@ableinc