Repository navigation
fix(api): grade resumes that pdf.js cannot parse - #38
Draft
lautaropaske wants to merge 1 commit into
Draft
lautaropaske wants to merge 1 commit into
lautaropaske wants to merge 1 commit into
Conversation
pdf.js only supplies the PDF author for the prompt; Gemini reads the raw bytes itself. A parse failure (e.g. "Command token too long: 128") now logs a warning, grades with no author, and only answers 400 InvalidPDFException when the gateway also rejects the document with a 400. 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
pdf.js only supplies
info.AuthorforgetSysPrompt, which just checks whether the author is"silver". With no author we use the generic prompt.InvalidPDFExceptionkeeps its exact string. candidate-portal'sGradeAshbyResumescron matches on it to store its placeholder C grade.Evidence
UnknownErrorException: Command token too long: 128, from the cron on Oct 9) → 400, never graded.After: the same kind of file (handmade
garbled.pdf), POSTed to a local dev server, logs the pdf.js error as a warning and reaches the AI Gateway. There's no key locally, so it stops atGatewayAuthenticationError.bun tscclean,vitest80/80.statusCode === 400rather than a class or message, because the gateway's error classes don't follow the status code (the budget error came back asGatewayInternalServerErrorwith status 402). If Gemini answers unreadable documents with a 5xx instead, those return 503 and the cron retries them.Merge Danger
Door: two-way
Revert to roll back. Nothing is persisted.
Blast Radius: grading
Files pdf.js rejects now cost a model call and may get a real grade instead of the cron's placeholder C. The cron already skips files with no
%PDF-header (candidate-portal #1047), so only files that look like PDFs reach this path.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.