feat(sdk): map failures to a structured evlog error catalog - #127
Merged
Conversation
Classifiable failures (GitHub API by status, Connect, OIDC, missing token)
now carry a stable code plus why/fix fields so models recover instead of
hallucinating causes. An expired VERCEL_OIDC_TOKEN throws before any
request with the exact expiry time, and eve tool failures return
{ error: { code, message, why, fix } }.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
|
Thank you for following the naming conventions! 🙏 |
The docs URL helps the model fetch the troubleshooting page when why/fix are not enough. Align the Errors guide page with other guides (header links, footer).
vercel
Bot
temporarily deployed
to
Preview – github-tools-test-agent
September 1, 2026 10:05
Inactive
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.
Summary
Raw failures made models hallucinate: an expired
VERCEL_OIDC_TOKENsurfaced as a bare "Not authorized" (read as "the repo is private"), and GitHub's 404-for-private-repos masking looked like a missing resource. This PR maps every classifiable failure to a structured evlog catalog error with a stablecode, awhy(technical cause), and afix(actionable remedy).github_toolscatalog (src/core/errors.ts, exported asgithubToolsErrors):TOKEN_REQUIRED,OIDC_TOKEN_EXPIRED,CONNECT_NOT_AUTHORIZED,CONNECT_USER_NOT_CONNECTED,CONNECT_INSTALLATION_REQUIRED,SUBJECT_CONTEXT_REQUIRED, plus GitHub API codes by status:UNAUTHORIZED(401),FORBIDDEN(403),RATE_LIMITED(403/429 with reset info),NOT_FOUND(404 — explicitly names the private-repo masking),VALIDATION_FAILED(422). Unmapped statuses pass through; the original Octokit error stays ascause, request coordinates ininternal(never model-facing).resolveConnectOptionsdecodes the JWTexpclaim (zero dependencies) and throwsOIDC_TOKEN_EXPIREDwith the exact expiry time before any doomed Connect request.@vercel/connecterrors are mapped in the token provider.runGithubToolStepreturns{ error: { code, message, why, fix } }for catalog errors (viaEvlogError.isEvlogError, copy-safe across duplicated installs); plain string otherwise. The extension'srequireToolContextthrowsSUBJECT_CONTEXT_REQUIRED.enrichGithubRateLimitErrorremoved (superseded by the catalog mapping; its suffix logic lives on informatRateLimitSuffix).Test plan
core/errors.test.ts), OIDC expiry + the three Connect error mappings (connect/token.test.ts), structured vs plain error payloads (eve/steps.test.ts)pnpm build && pnpm lint && pnpm typecheck && pnpm testexit 0 (117 SDK tests)