Skip to content

🐛 fix(kanban): pin worker git identity to host config at spawn - #14

Merged
cwest merged 1 commit into
cwest/integrationfrom
topic/strip-worker-coauthor-trailer
Jun 28, 2026
Merged

🐛 fix(kanban): pin worker git identity to host config at spawn#14
cwest merged 1 commit into
cwest/integrationfrom
topic/strip-worker-coauthor-trailer

Conversation

@cwest

@cwest cwest commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Problem

Dispatched kanban workers clone/branch a repo and commit their work. When the
cloned repo carries no local git identity, the worker's runtime authors branch
commits under a synthesized per-profile identity (e.g. <name>@<host>.local).
Because that author differs from the squash-merge author, GitHub's
squash-merge auto-appends a Co-authored-by: <name> <name@…> trailer for it
into every merge commit body — baking an unwanted author into git metadata on
each merge. The squash author is correct; only the auto-derived co-author
trailer is wrong, and it recurs on every merge.

Fix

Resolve the host's canonical git config user.name / user.email once at
spawn (_default_spawn) and pin them into the worker subprocess env as
GIT_AUTHOR_* / GIT_COMMITTER_*. Env-level git identity overrides repo-local
and global config, so every worker commit is authored as the host maintainer
regardless of what identity the worker's runtime would otherwise set. With all
branch commits sharing the squash author, GitHub finds no distinct author and
adds no trailer.

  • Forward, non-destructive: stops new trailers at the source on every repo a
    worker touches; no history rewrite.
  • Standard git env vars, not a new HERMES_* config var — the identity value
    is read from the host's existing git config, the source of truth.
  • Identity is omitted (never set empty) when host config can't be resolved,
    so git's own config chain still applies and the spawn never crashes.

Tests

tests/hermes_cli/test_kanban_worker_git_identity.py (4 tests):

  • spawn env pins GIT_AUTHOR_* / GIT_COMMITTER_* from resolved identity
  • spawn omits the vars (no empty injection, no crash) when unresolvable
  • _resolve_worker_git_identity reads both keys from git config
  • resolution returns None (not empty strings) when config is missing

Verification:

  • 4/4 new tests pass; 241/241 across kanban_db + spawn + goal-mode suites; 0
    regressions (the one failing hermes_cli test is a pre-existing systemd test
    that fails identically on the base branch — macOS has no systemd).
  • E2E: a repo with local user.email set to a persona commits as the persona
    bare, but commits as the host identity when the GIT_* env vars are set —
    confirming the override prevents the squash co-author trailer.
  • ruff check clean on both changed files; commit signed (good signature).

Draft pending review.

Dispatched kanban workers clone/branch a repo and commit their work, but
the worker's runtime would author branch commits under a synthesized
per-profile identity (e.g. `<name>@<host>.local`) when the cloned repo
carried no local git identity. Because that author differs from the
squash-merge author, GitHub auto-appends a `Co-authored-by:` trailer for
it into every squash merge commit body — baking an unwanted author into
git metadata on each merge.

Resolve the host's canonical `git config user.name` / `user.email` once
at spawn and pin them into the worker subprocess env as GIT_AUTHOR_* /
GIT_COMMITTER_*. Env-level git identity overrides repo-local and global
config, so every worker commit is authored as the host maintainer
regardless of what identity the worker's runtime would otherwise set —
which means a squash-merge finds no distinct author and adds no trailer.
Identity is omitted (not set empty) when the host config can't be
resolved, so git's own config chain still applies and the spawn never
crashes.

This is a forward, non-destructive fix: it stops new trailers at the
source on every repo a worker touches and needs no history rewrite.
@cwest
cwest marked this pull request as ready for review June 28, 2026 16:33
@cwest
cwest merged commit 8645ecb into cwest/integration Jun 28, 2026
8 checks passed
@cwest
cwest deleted the topic/strip-worker-coauthor-trailer branch June 28, 2026 16:33
cwest added a commit that referenced this pull request Jul 1, 2026
Pin a dispatcher-spawned worker's git identity to the host config at spawn time
so worker commits carry the correct author instead of a container default.

upstream-pending: fork PR #14
cwest added a commit that referenced this pull request Jul 26, 2026
Pin a dispatcher-spawned worker's git identity to the host config at spawn time
so worker commits carry the correct author instead of a container default.

upstream-pending: fork PR #14
(cherry picked from commit 44f7949)
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.

1 participant