Skip to content

Bugfix/general - #95

Merged
SagiEv merged 4 commits into
mainfrom
bugfix/general
Nov 5, 2026
Merged

SagiEv merged 4 commits into
mainfrom
bugfix/general

Conversation

@SagiEv

@SagiEv SagiEv commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes AI Role Fit Analysis (POST /role-fit/analyze) failing with 504 DEADLINE_EXCEEDED / 500 Internal Server Error and falling back solely to the deterministic score.

Root Cause

  1. Payload Bloat (backend/services/fitAnalysis.service.js): getFitContext passed raw SELECT * rows from skills, profile, and user_experiences directly into candidate_data. Each skill included its 384-dimensional float embedding vector (vector(384)), inflating json.dumps(request.candidate_data) in the LLM prompt by tens of thousands of tokens.
  2. Aggressive Gemini Timeout (backend/ai_service/providers/gemini_provider.py): A 12-second server deadline (timeout=12) caused ChatGoogleGenerativeAI structured-output requests to time out with 504 DEADLINE_EXCEEDED across primary and fallback models.

Changes

  • Node Backend (backend/services/fitAnalysis.service.js):
    • Strip embedding vectors and internal DB metadata from skills, experiences, and profile in getFitContext.
    • Pass configured fitConfig.model to /role-fit/analyze, bound job_description length (15000 chars), and add default AI_SERVICE_URL fallback.
  • Python AI Service (backend/ai_service/providers/gemini_provider.py, backend/ai_service/role_fit/):
    • Increase ChatGoogleGenerativeAI timeout from 12s to 45s.
    • Omit temperature parameter for gemini-3.5-flash-lite to avoid fixed-sampling warnings.
    • Accept optional model in FitAnalysisRequest and forward it to get_fast_llm.
  • Frontend (frontend/src/pages/AnalyticsPage.jsx):
    • Read fit_analysis_ai?.ai_score before falling back to overall_score and fit_score_deterministic.
  • Tests (backend/tests/fitAnalysis.test.js):
    • Added unit test verifying getFitContext strips skill embeddings and internal metadata.

@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
job-pilot Ready Ready Preview Nov 5, 2026 7:53pm UTC

@SagiEv
SagiEv merged commit 8a181d8 into main Nov 5, 2026
6 checks passed

This branch was successfully deployed

1 active deployment
Preview — e990b210 Deployed Nov 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant