Repository navigation
feat: sign agent-authored commits with a Co-Authored-By trailer - #121
Merged
Merged
Conversation
Like Cursor, Claude Code and Codex, Pizza now attributes the commits it creates. A shell spawnHook deterministically appends the Co-Authored-By trailer for the pizza-agent GitHub App's bot identity to top-level `git commit` invocations — no hook files written into user repos, no prompt reliance. GitHub renders it as a clickable co-author linking to https://github.com/apps/pizza-agent. - src/core/git-attribution.ts: POSIX-aware rewrite (env prefixes, git global options, chains, pipes, background ops); conservatively skips --dry-run, '--' pathspec separators, command substitutions, existing co-author trailers, and redirect-at-tail segments. Requires git >= 2.32. - src/core/exec/shell-words.ts: export computeUnquotedCodeMask, add splitShellCommands (lossless, separator-preserving incl. & and newlines) and hasUnquotedShellChar. - settings.gitCommitCoAuthor (default true) to opt out. - Prompt guideline tells the model the trailer is automatic so it does not add a duplicate (git dedupes identical trailers anyway). Co-Authored-By: pizza-agent[bot] <356990035+pizza-agent[bot]@users.noreply.github.com>
Adds a Website row (Globe icon, opens externally) above the repository row in Settings → About, with en/zh-CN labels. Co-Authored-By: pizza-agent[bot] <356990035+pizza-agent[bot]@users.noreply.github.com>
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.
What
Like Cursor, Claude Code and Codex, Pizza now attributes the commits it creates. Every
git committhe agent runs gets a trailer:which GitHub renders as a clickable co-author linking to the Pizza Agent app.
How
A
spawnHookon the cli shell fallback deterministically appends--trailerto top-levelgit commitinvocations — not a prompt instruction (cannot be forgotten or hallucinated), and no hook files written into user repos.src/core/git-attribution.ts— POSIX-aware rewrite using the shared shell-word mask: env prefixes (FOO=1,env,command), git global options (-C,-c,--git-dir=), chains/pipes/&/newlines, mid-command redirects. Conservatively skips--dry-run,--pathspec separators, unclosed$(/subshells, commands already carrying aco-authored-bytrailer, and segments ending in a redirect operator. Requires git ≥ 2.32 (--trailerflag); detected once per process.src/core/exec/shell-words.ts— exportcomputeUnquotedCodeMask; addsplitShellCommands(lossless, separator-preserving split incl.&and newlines) andhasUnquotedShellChar.settings.gitCommitCoAuthor(defaulttrue) to opt out.--amend).The hook composes after any user-supplied
spawnHook, so SDK/extension callers see the final command.Tests
test/git-attribution.test.ts— 18 cases covering chaining, pipes, redirects, env prefixes,--/--dry-runskips, command substitution, and mid-line redirects. E2E verified in a scratch repo (trailer written; dedup on amend).