Skip to content

feat(eve): add the attribution footer to editFiles pull requests and fill footer templates - #274

Merged
HugoRCD merged 4 commits into
mainfrom
fix/eve-attribution-edit-files
Nov 19, 2026
Merged

HugoRCD merged 4 commits into
mainfrom
fix/eve-attribution-edit-files

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Nov 19, 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

Follow-up to #270. No GitHub issue: the bug came from a drafted report seen on pull requests opened on nuxt/nuxt.com.

📚 Description

Bug. With attribution on, withAttribution added the footer only when the tool was createPullRequest:

const addFooter = footer && name === 'createPullRequest'

editFiles opens its own pull request from pullRequest.body, and its description tells the model to prefer it over createBranch + createOrUpdateFile + createPullRequest. So most pull requests an agent opened with a person's token credited the App in the commit (Co-authored-by) but not in the body. The footer now goes into editFiles' pullRequest.body too. When the branch already has an open pull request, editFiles returns it unchanged, so no second footer is added.

Input, as a signed-in user with actAs: 'caller':

github__editFiles({
  owner: 'vercel-labs', repo: 'github-tools', branch: 'eval-new', baseBranch: 'main',
  message: 'docs: reword the intro',
  edits: [{ path: 'README.md', content: '# Site\n' }],
  pullRequest: { title: 'docs: reword the intro', body: 'Rewords the intro.' },
})

Pull request body GitHub receives:

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

Footer templates. attribution.footer takes a template whose tokens the extension fills from each call, in addition to true, false and a (app) => string function:

Token Value
{app} The App as a link, [<slug>](https://github.com/apps/<slug>)
{app.name} The App's slug
{requester} @<login> of the person whose token runs the call. One GET /user, made only when the template uses it
{channel} eve's ctx.channel.kind without channel:, such as slack, github or http
export default githubExtension({
  connector: 'github/my-connector',
  actAs: 'caller',
  attribution: { footer: 'Opened by Evi in {channel} for {requester}, through {app}.' },
})

The default footer is the template Generated by {app}., so its text is unchanged. An unknown token, such as {agent}, fails when the extension mounts and lists the valid ones. A token with no value fails the call instead of writing a broken footer. There is no {agent}: eve's ToolContext does not carry the agent's name.

@github-tools/sdk/eve-runtime exports fillGithubFooter, githubFooterTokens, githubAppFooterValues, githubLogin, GITHUB_FOOTER_TOKENS and DEFAULT_GITHUB_FOOTER. withGithubAppFooter(body, bot, footer?) takes the filled line as an optional third argument, so existing two-argument calls are unchanged. The changeset is minor for both packages.

Verification

pnpm build, pnpm lint, pnpm typecheck and pnpm test exit 0. The SDK has three new vitest cases for templates. The act-as eval has a new custom.ts mount and three new checks: the editFiles commit message, the pull request body it opens, and a template using every token. Each compares the exact text the stubbed GitHub received. The template one is:

Fixes the drain.

---

Opened in eve for @alice, through [eval](https://github.com/apps/eval) (eval).

eve is the eval's own channel, and @alice comes from the stubbed GET /user. The mount-time check for an unknown token has no test.

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

The "before" for editFiles is the 0.14.0 code quoted above. I did not rerun the eval against it.

📝 Checklist

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

ELI5: The agent was supposed to sign every pull request it opened for someone, but it forgot when it opened the pull request through its "edit files" shortcut, which it uses most. Now it signs those too, and you can write the signature as a sentence with blanks, like "for {requester}", that it fills in itself.

…opens

withAttribution added the footer only for createPullRequest. editFiles
opens its own pull request from pullRequest.body, and its description
tells the model to prefer it, so most agent pull requests had no footer.
The footer now goes into editFiles' pullRequest.body too.

attribution.footer also accepts a string or a (app) => string that
replaces the default "Generated by" line, and withGithubAppFooter takes
that line as an optional third argument.
@vercel

vercel Bot commented Nov 19, 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 19, 2026 2:44pm UTC
github-tools-test-agent Ready Ready Preview, v0 Nov 19, 2026 2:44pm UTC

@github-actions github-actions Bot added the bug Something isn't working label Nov 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

attribution.footer now takes a template with {app}, {app.name},
{requester} and {channel}, filled per call from the App, the person's
token and eve's channel. The default footer is the template
"Generated by {app}.", so its text is unchanged. {requester} costs one
GET /user call, made only when a template uses it. An unknown token
fails when the extension mounts, and a token with no value fails the
call instead of writing a broken footer.
@HugoRCD HugoRCD changed the title fix(eve): add the attribution footer to pull requests that editFiles opens feat(eve): add the attribution footer to editFiles pull requests and fill footer templates Nov 19, 2026
The default attribution footer is now "Generated by {app} for
{requester} from {origin}.". {app} shows the App's display name from
GET /apps/<slug>, falling back to the slug for a private App that
GitHub hides from user tokens. {origin} links the Slack thread built
from eve's channel metadata, names the Linear issue, or falls back to
the channel's name, and {channel} gives readable names such as Slack.
Slack and Linear are recognized from their metadata, not the channel's
file name.
githubAppBot always sets the display name, but GithubAppBot is public
and 0.14.0 callers pass { slug, login, id } to withGithubAppFooter.
Footers show the slug when name is missing instead of [undefined].
@HugoRCD HugoRCD self-assigned this Nov 19, 2026
@HugoRCD
HugoRCD merged commit cdc83c7 into main Nov 19, 2026
14 of 15 checks passed
@HugoRCD
HugoRCD deleted the fix/eve-attribution-edit-files branch November 19, 2026 14:55
@github-actions github-actions Bot mentioned this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant