Skip to content

fix: configure git identity before bundled-skill worktree commits#730

Open
tend-agent wants to merge 2 commits into
mainfrom
fix/issue-729
Open

fix: configure git identity before bundled-skill worktree commits#730
tend-agent wants to merge 2 commits into
mainfrom
fix/issue-729

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Problem

Bundled skills that commit in a fresh /tmp git worktree (and in the main checkout) run git commit without first configuring a git identity. On runners where the harness doesn't pre-seed one, the first commit fails with Author identity unknown, the branch gets pushed with no commit, and gh pr create then fails with No commits between main and <branch>. Sessions self-correct by setting an identity and recommitting, but they burn turns and momentarily push an empty branch. Per #729 this has fired on consecutive committing nightlies, making it structural rather than a one-off.

The gap is systemic — the same git commit-without-identity shape exists across nightly, review-runs, running-in-ci, triage, review, and ci-fix.

Solution

Fix it once at the root and reinforce at the documented failure sites:

  • running-in-ci/SKILL.md — new ### Configure git identity before the first commit subsection under PR Creation. Every skill loads running-in-ci first, so this is the canonical rule for all of them. Uses git config --global (covers the main checkout and every worktree in one shot) with the GitHub noreply email form (<id>+<login>@users.noreply.github.com) so commits stay attributed to the bot and pass verified-email push rules. Also annotated the Learning-from-Feedback worktree block to point at it.
  • nightly/SKILL.md — inlined the identity config into the Step 7 verbatim ship block (the failure site in nightly: worktree commit fails on runners without a pre-seeded git identity #729). Shell state doesn't persist between bash calls, so it's self-contained there.
  • review-runs/SKILL.md — annotated its worktree-commit block to set identity first.

Testing

Skill-text fix — no generator unit test applies. Reproduced the mechanism locally: git commit with no configured identity fails with Author identity unknown both in a fresh repo and a fresh worktree; setting git config --global user.name/user.email lets the same commit succeed. pre-commit (trailing-whitespace, typos, bang-backtick guard, install-tend sync) passes on all three changed files.


Closes #729 — automated triage

Bundled skills committed in fresh /tmp worktrees (and the main checkout)
without configuring git identity. On runners that don't pre-seed one, the
first commit fails with `Author identity unknown`, an empty branch gets
pushed, and `gh pr create` fails with `No commits between main and <branch>`.

Add a canonical "Configure git identity before the first commit" recipe to
running-in-ci (loaded first by every skill) and reinforce it inline in the
verbatim worktree-commit blocks in nightly (Step 7) and review-runs.

Closes #729

Co-Authored-By: Claude <noreply@anthropic.com>

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The canonical rule + the Step 7 inline are a solid root fix, and --global over the issue's repo-local git config is the right call (a fresh worktree shares the runner's ~/.gitconfig). One residual gap, though, on a site #729 explicitly named.

The conflict-resolution commits in Step 3 run before any identity is configured. "Resolve conflicts on bot PRs" dispatches parallel subagents that each git add + git commit --no-edit in a fresh git worktree add /tmp/pr-<number> — and that step executes well before Step 7, where the inline git config --global now lives. So at the moment those commits fire:

  • The main session hasn't reached Step 7 yet, so no --global identity has been written to ~/.gitconfig.
  • The commits run inside dispatched subagents, which are separate agent invocations and don't reliably load running-in-ci, so the new canonical rule isn't guaranteed to reach them.

That leaves the conflict-resolution git commit --no-edit — one of the three sites #729 called out — still exposed to Author identity unknown.

Because git config --global writes to the runner's shared ~/.gitconfig (filesystem state, not shell state — it persists across bash calls and across subagents in the same runner), setting it once, early in the main session — before Step 3 dispatches subagents — would cover every downstream commit site (conflict-resolution subagents, Step 7, and any later worktree dance) in one shot, strictly more robustly than placing it only at Step 7. A natural home is Step 0 right after loading running-in-ci, or just ahead of the Step 3 dispatch.

Not blocking the improvement here — just flagging for a follow-up so the fix reaches the site that was actually observed failing.

The Step 3 conflict-resolution subagents git commit in fresh worktrees
before Step 7's inline config runs, and as separate invocations don't
reliably load running-in-ci — leaving the conflict-resolution site #729
named still exposed to `Author identity unknown`. Set the identity once
in the main session before dispatching; --global writes to the shared
~/.gitconfig so subagents inherit it.

Co-Authored-By: Claude <noreply@anthropic.com>
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.

nightly: worktree commit fails on runners without a pre-seeded git identity

1 participant