Repository navigation
feat(eve): add the attribution footer to editFiles pull requests and fill footer templates - #274
Merged
Merged
Conversation
…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.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
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].
Merged
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.
🔗 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
attributionon,withAttributionadded the footer only when the tool wascreatePullRequest:editFilesopens its own pull request frompullRequest.body, and its description tells the model to prefer it overcreateBranch+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 intoeditFiles'pullRequest.bodytoo. When the branch already has an open pull request,editFilesreturns it unchanged, so no second footer is added.Input, as a signed-in user with
actAs: 'caller':Pull request body GitHub receives:
Footer templates.
attribution.footertakes a template whose tokens the extension fills from each call, in addition totrue,falseand a(app) => stringfunction:{app}[<slug>](https://github.com/apps/<slug>){app.name}{requester}@<login>of the person whose token runs the call. OneGET /user, made only when the template uses it{channel}ctx.channel.kindwithoutchannel:, such asslack,githuborhttpThe 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'sToolContextdoes not carry the agent's name.@github-tools/sdk/eve-runtimeexportsfillGithubFooter,githubFooterTokens,githubAppFooterValues,githubLogin,GITHUB_FOOTER_TOKENSandDEFAULT_GITHUB_FOOTER.withGithubAppFooter(body, bot, footer?)takes the filled line as an optional third argument, so existing two-argument calls are unchanged. The changeset isminorfor both packages.Verification
pnpm build,pnpm lint,pnpm typecheckandpnpm testexit 0. The SDK has three new vitest cases for templates. The act-as eval has a newcustom.tsmount and three new checks: theeditFilescommit 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:eveis the eval's own channel, and@alicecomes from the stubbedGET /user. The mount-time check for an unknown token has no test.The "before" for
editFilesis the 0.14.0 code quoted above. I did not rerun the eval against it.📝 Checklist
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.