Repository navigation
fix(resume-checker): show grading outages to users and stop false /api/grade errors - #37
Merged
Merged
Conversation
…i/grade errors - Answer AI Gateway 402 (budget exceeded) and 429 with 503 GradingUnavailable, and reword it to "Perdón, no podemos analizar tu CV en este momento". - Render API errors in the resume-checker badge again; an `error &&` guard from 0e9da65 had hidden every /api/grade failure since Jan 16. - Cap Gemini output (8192) and thinking (4096) tokens so a runaway generation fails fast instead of hitting the 60s timeout; log usage per grade. - Skip page-text rendering in parseResume: grading reads only metadata, and font loading was the source of the "TT: undefined function" warnings. - Answer any pdf.js parse failure with 400 InvalidPDFException, not 500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
Four
/api/gradeissues from Dash0 (Oct 8–9), fixed in the route and the resume-checker page.GradingUnavailablecopy: "Perdón, no podemos analizar tu CV en este momento. Probá de nuevo en unos minutos."Evidence
GatewayInternalServerError: Team budget exceeded(402)Before: 500
GradingError. Users were sent back to the upload page with no message.After: 503
GradingUnavailable. With a mocked 503 in Chrome, the badge shows the new copy, and a fresh page load shows no badge.UnknownErrorException: Command token too long: 128The caller is candidate-portal's hourly
GradeAshbyResumesJob(infra/functions/gradeAshbyResumes.ts), which grades real candidate resumes from Ashby. The ×3 is its retry loop (MAX_GRADING_RETRIES = 3).Before: 500 + alert. The cron stored no grade, so the same candidate was retried every hour.
After: 400
InvalidPDFException. The cron'sInvalidPDFExceptionbranch stores its placeholder C grade ("invalid PDF") and stops retrying. That error string is part of the cron's contract, so don't rename it.Checked locally: a handmade PDF that throws the same error in pdf-parse, POSTed to a local dev server, returns
400 {"error":"InvalidPDFException"}.After: output and thinking are capped. Not reproducible locally; the new usage logs will confirm the cause.
bun tscclean,vitest79/79. New cases:Merge Danger
Door: two-way
Revert to roll back. Nothing is persisted.
Blast Radius: grading
The token caps were set without measuring production usage. If normal grades need more than 4096 thinking tokens, grades could get worse or fail with
finishReason: "length". Watch the newoutcome: "graded"usage logs after deploy and raise the caps if they run close. Consumers: the resume-checker page and candidate-portal'sGradeAshbyResumesJob. That cron also gets the new 503GradingUnavailableduring gateway outages. It treats it like the old 500 (3 retries, then again next hour). A cap-induced 500 would leave its candidates ungraded the same way. The error badge now also shows API errors, so users may see a past error for up to 5 minutes when they return to the page.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.