feat: add auto approval and auto preset selection - #157
Merged
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
Raise the preset threshold to 0.7, keep repo-explorer out of preset combinations, and loosen approval thresholds to maxRisk 1 / minIntent 0.6. A failed evaluation call now asks for approval or uses repo-explorer and logs EVALUATION_FAILED. Structured GitHub API errors pass through eve formatters.
HugoRCD
force-pushed
the
feat/sdk-auto-approval-presets
branch
from
September 24, 2026 07:59
28c15bb to
1cb6609
Compare
Merged
2 tasks
This branch was successfully deployed
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
None.
📚 Description
Adds
'auto'modes for approval and presets to the SDK and the eve extension. An evaluation model decides per message through AI SDKexperimental_evaluate. The default is TypeSafe's Jev ('typesafe-ai/jev'through AI Gateway).requireApproval: 'auto'(createGithubTools,createGithubAgent, eve extension)AUTO_APPROVAL_TOOLS: labels, assignees, reactions, comments, review-thread replies, reviewer requests, notification reads, workflow re-runs), the model rates the risk (0–2) and whether the latest user message asked for this exact call. The call runs without approval whenrisk <= 1andintent >= 0.6; otherwise the user is asked.'auto':{ updateIssue: 'auto', mergePullRequest: true }.preset: 'auto'(createGithubAgent, eve extension)0.7are used, at most two. Read-onlyrepo-exploreris only used when no other preset qualifies. When none qualifies, the most likely preset is used. The full catalog is never exposed.[Pending approvals]resume message is not treated as a user request.Failure handling: when the evaluation call fails (model not enabled on AI Gateway, no credits, outage),
'auto'approval asks andpreset: 'auto'usesrepo-explorer. Both log agithub_tools.EVALUATION_FAILEDwarning with the gateway error ascause.Configuration:
evaluation: { model, maxRisk, minIntent, minPresetProbability, maxPresets }tunes both modes (defaults1,0.6,0.7,2).Fix: eve tool output formatters no longer crash on structured GitHub API errors (
Cannot read properties of undefinedin the next model step forlistPullRequestFiles,getFileContent,getRepositoryTree,getPullRequestContext,getCommit,compareCommits).Compatibility
'auto'needsai7.0.105 or later; withoutexperimental_evaluateit throwsEVALUATION_UNAVAILABLE. The root entry still loads onai6.aiis now a static namespace import, because eve could not bundle the extension with the dynamicimport('ai')("Expected one bundled authored module").createDurableGithubAgentdoes not accept'auto'.ToolOptions.needsApprovalis widened to the AI SDK type, which also accepts a function. Non-breaking.Benchmark (
examples/eve-bench): eve evals on 12 GitHub tasks withanthropic/claude-opus-5.5and Jev, writes stubbed. Against the full catalog,preset: 'auto'+requireApproval: 'auto'passed 12/12 tasks with 42% fewer tokens per task (107k to 62k), 34% lower cost ($0.164 to $0.108), and half the approval prompts (8 to 4). On 20 direct approval cases, Jev sent 10/10 unsafe writes to a human and auto-ran 8/10 safe ones. The defaults above were tuned on these runs. One run per configuration; costs vary 2–4× between runs.Docs: eve extension, presets and approval-control guides, API reference, READMEs, published skill,
AGENTS.md,examples/evenow uses both'auto'modes. Changesets:minorfor@github-tools/sdkand@github-tools/eve-extension,patchfor the formatter fix.Verification:
pnpm lint,pnpm typecheck, andpnpm test(130 tests) pass. Locallypnpm buildfails only inexamples/eve, where eve falls back to microsandbox without Docker running;mainfails the same way on this machine.📝 Checklist