Skip to content

Commit as the GitHub account with plain git in a clone pap git made - #381

Merged
hkonsti merged 1 commit into
mainfrom
pap-git-clone-identity
Nov 21, 2026
Merged

hkonsti merged 1 commit into
mainfrom
pap-git-clone-identity

Conversation

@hkonsti

@hkonsti hkonsti commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

An agent working in a sandbox committed under a name and email it made up rather than as the GitHub account. It cloned with pap git clone and then ran git add and git commit with plain git, as agents do for local commands. pap git set the account's identity only through GIT_AUTHOR_*/GIT_COMMITTER_* for its own run, so plain git in the clone had no identity, and the agent filled one in with git -c user.name=… -c user.email=….

Fix

  • pap git clone now passes --config user.name=… --config user.email=… (the identity route's account, with GitHub's noreply address), so the new clone's own .git/config names the account and plain git commit there commits as it. If the environment sets GIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL, those are used instead. That also covers pap gh repo clone, whose git shim runs with gh's identity env. The caller's own --config comes after these and wins. Only the identity is written: nothing of the sign-in (relay URL, token) goes into any config.
  • The agent instructions (mcp/tools.ts) now say that a clone made with pap git commits as the account with plain git too, so the agent shouldn't set a name or email of its own. The pap git note and the GitHub docs page say the same.

Tests

  • git.test.ts: gitArgs unit tests, and pap git clone spawning git with the config.
  • real-pap.test.ts: real git through the relay. Clone with pap git, commit with plain git and no identity: the author and committer are the account, and the config holds no token or PAP URL.
  • packages/cli tests pass. real-pap.test.ts passes 17/17 and mcp/route.test.ts passes. Typecheck passes for cli, contracts and api.

…re commits as it rather than as whoever the agent makes up
@hkonsti
hkonsti merged commit 3d1bf3b into main Nov 21, 2026
4 checks passed
@hkonsti
hkonsti deleted the pap-git-clone-identity branch November 21, 2026 06:41
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