Skip to content

feat(eve): credit the GitHub App on pull requests and commits made with a user's token - #270

Merged
HugoRCD merged 1 commit into
mainfrom
feat/eve-attribution
Nov 17, 2026
Merged

HugoRCD merged 1 commit into
mainfrom
feat/eve-attribution

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Written by an AI agent on behalf of @HugoRCD, who shaped the solution. @HugoRCD has reviewed it.

🔗 Linked issue

No GitHub issue. It came up while running Evi, evlog's eve agent: a pull request Evi opened from a Slack request listed the maintainer as its only author, with nothing saying the agent wrote it.

📚 Description

With actAs: 'user', or 'caller' and a signed-in user, each call runs with the person's own GitHub token, so GitHub records them as the author of whatever the agent writes. That stays as it is: the person who asked owns the change. The extension now credits the GitHub App alongside them, by default:

  • createPullRequest ends the pull request body with Generated by [<app>](https://github.com/apps/<app>).
  • createOrUpdateFile, editFiles, mergePullRequest and enablePullRequestAutoMerge add the App's bot account to coAuthors, using the id+<app>[bot]@users.noreply.github.com address GitHub links to the bot.

Calls that run with the App's token add nothing, because GitHub already shows the App as their author.

Usage

export default githubExtension({
  connector: 'github/my-connector',
  actAs: 'caller',
  // default: true. false turns both off; or pick one:
  attribution: { footer: true, coAuthor: false },
})

Pull request body, for a user-token createPullRequest with body: 'Fixes the drain.'

 Fixes the drain.
+
+---
+
+Generated by [eval](https://github.com/apps/eval).

Commit message, for a user-token createOrUpdateFile with message: 'docs: update readme'

 docs: update readme
+
+Co-authored-by: eval[bot] <4242+eval[bot]@users.noreply.github.com>

Both blocks are the texts the stubbed GitHub received in tests/eve-act-as, recorded by the eval.

How the App is found. No config is needed. GitHub lists only the issuing App's installations to a user access token, so GET /user/installations gives the App's slug, and GET /users/<slug>[bot] gives the bot's id. The lookup runs once per process and connector, inside the same try as the call, so a revoked token still sends the user back through sign-in. A user token with no installation listed fails with the new github_tools.APP_BOT_UNKNOWN.

SDK exports from @github-tools/sdk/eve-runtime: githubAppBot(token), githubAppBotIdentity(bot), withGithubAppFooter(body, bot), GITHUB_COMMIT_TOOLS, and the GithubAppBot type.

For reviewers

  • It is on by default. Existing agents using 'user' or 'caller' get the footer on new pull requests after upgrading, so the changeset is a minor bump for both packages and says how to turn it off.
  • Agents whose commits are written by the App (eve's git extension, a signed push) already get the App credited when the pull request is squash-merged: GitHub adds each commit author other than the pull request's author as Co-authored-by, for example on evloghq/evlog#1027. The docs say so.
  • The footer is only added on create, so updatePullRequest never stacks a second one.

Verification

pnpm build, pnpm lint, pnpm typecheck and pnpm test exit 0. The new vitest file packages/github-tools/src/core/attribution.test.ts has 5 cases. The act-as eval gained these checks: a signed-in user's pull request and commit carry the credits, the App is looked up once, and neither a call that runs as the App nor a mount with attribution: false adds anything.

@github-tools/eve-act-as-test:test: ✓  act-as  gates 49/49
@github-tools/eve-act-as-test:test: Results: 1 passed (1 total)
@github-tools/eve-act-as-test:test: Gates: 49 passed

Not tested against real GitHub. The /user/installations route is checked only against the stub.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

ELI5: When someone asks the agent to open a pull request, GitHub shows that person as the author, which is right, since they asked for it. Now the pull request also says at the bottom that the agent's App wrote it, and the commits list the App's bot as a co-author.

…th a user's token

With actAs 'user', or 'caller' and a signed-in user, GitHub records the
person as the author of what the agent writes. The extension now credits
the App by default: createPullRequest ends the body with a "Generated by"
line linking the App, and the commit tools add the App's bot account to
coAuthors with the noreply address GitHub links to it.

The App is read from the user's token through GET /user/installations,
once per process and connector. Calls that run as the App add nothing.
`attribution: false` turns both credits off, `{ footer, coAuthor }` picks.

The SDK exports githubAppBot, githubAppBotIdentity, withGithubAppFooter
and GITHUB_COMMIT_TOOLS from eve-runtime, and adds APP_BOT_UNKNOWN.
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
github-tools-docs Ready Ready Preview, v0 Nov 17, 2026 11:20am UTC
github-tools-test-agent Ready Ready Preview, v0 Nov 17, 2026 11:20am UTC

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@HugoRCD HugoRCD self-assigned this Nov 17, 2026
@HugoRCD
HugoRCD merged commit 052eda9 into main Nov 17, 2026
19 checks passed
@HugoRCD
HugoRCD deleted the feat/eve-attribution branch November 17, 2026 11:23
@github-actions github-actions Bot mentioned this pull request Nov 17, 2026

This branch was successfully deployed

2 active deployments
Preview – github-tools-docs — 7a6fa0e6 Deployed Nov 17, 2026 by vercel[bot]
Preview – github-tools-test-agent — 7a6fa0e6 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant