Repository navigation
Commit as the GitHub account with plain git in a clone pap git made - #381
Merged
Merged
Conversation
…re commits as it rather than as whoever the agent makes up
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 cloneand then rangit addandgit commitwith plain git, as agents do for local commands.pap gitset the account's identity only throughGIT_AUTHOR_*/GIT_COMMITTER_*for its own run, so plain git in the clone had no identity, and the agent filled one in withgit -c user.name=… -c user.email=….Fix
pap git clonenow passes--config user.name=… --config user.email=…(the identity route's account, with GitHub's noreply address), so the new clone's own.git/confignames the account and plaingit committhere commits as it. If the environment setsGIT_AUTHOR_NAME/GIT_AUTHOR_EMAIL, those are used instead. That also coverspap gh repo clone, whose git shim runs with gh's identity env. The caller's own--configcomes after these and wins. Only the identity is written: nothing of the sign-in (relay URL, token) goes into any config.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. Thepap gitnote and the GitHub docs page say the same.Tests
git.test.ts:gitArgsunit tests, andpap git clonespawning git with the config.real-pap.test.ts: real git through the relay. Clone withpap 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/clitests pass.real-pap.test.tspasses 17/17 andmcp/route.test.tspasses. Typecheck passes for cli, contracts and api.