-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
fix(schema): Fix 500 errors on job description parsing/improving #446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe prompt string in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Pull Request Title
Expand
employment_type
andremote_status
enums to support 'N/A'.Related Issue
#445, #374
Description
This PR updates the EmploymentTypeEnum and RemoteStatusEnum to include 'N/A' as a valid value.
This change prevents 500 errors when job descriptions are missing or contain unrecognized values for these fields. It ensures the system can handle incomplete or ambiguous input data gracefully.
Rewrote job description prompt to improve prompt clarity to reduce hallucinations and enforce raw JSON output. This reduces the number of 500s cause of the incorrect JSON generated:
[2025-07-25T14:35:43-0700 - app.agent.strategies.wrapper - ERROR] provider returned non-JSON. parsing error: Expecting ',' delimiter: line 56 column 2 (char 2529)
Type
Proposed Changes
Added 'N/A' to EmploymentTypeEnum
Added 'N/A' to RemoteStatusEnum
Updated relevant validation logic to accept 'N/A'
Prevented crashes caused by missing or invalid values in job data
Improved the job prompt
Screenshots / Code Snippets (if applicable)
How to Test
Submit a job description with 'N/A' for employment_type or remote_status.
Click the "Improve" button.
Verify that no error occurs and the system processes the resume correctly.
Checklist
Additional Information
This change improves resilience when dealing with third-party job data sources that may omit or generalize employment and location information.
Refactored the JSON extraction prompt to use clear positive instructions instead of relying on negative constraints. This helps the model produce more accurate and consistent outputs with fewer hallucinations.
We can also alter the prompt to force it to write
Not Specified
instead ofN/A
, but we should keep the prompt as simple and short as possible. Benefits: faster processing, easier to debug, long prompts with lots of conditions can make it harder for the model to prioritize the right ones.Summary by CodeRabbit
New Features
Documentation