Skip to content

fix(resume-drill): add resilient resume project extraction status - #6

Merged
CUinspace233 merged 2 commits into
mainfrom
improve_resume_drill
May 24, 2026
Merged

CUinspace233 merged 2 commits into
mainfrom
improve_resume_drill

Conversation

@CUinspace233

Copy link
Copy Markdown
Owner
  • Added retry handling for resume project extraction with bounded attempts and backoff.
  • Introduced a project quality gate before accepting AI extraction results.
  • Persisted extraction_status on resumes and returned it through API schemas.
  • Displayed resume extraction status in the Resume Drill sidebar.
  • Moved synchronous OpenAI project extraction work onto a background thread.

- Added retry handling for resume project extraction with bounded attempts and backoff.
- Introduced a project quality gate before accepting AI extraction results.
- Persisted extraction_status on resumes and returned it through API schemas.
- Displayed resume extraction status in the Resume Drill sidebar.
- Moved synchronous OpenAI project extraction work onto a background thread.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the resilience and observability of “resume project extraction” in the Resume Drill flow by persisting an extraction_status and adding retry + fallback behavior for AI extraction, then surfacing that status in the API and UI.

Changes:

  • Added extraction_status to Resume DB model, API schema, and frontend types.
  • Implemented bounded retries with backoff, plus a quality gate and fallback extraction path for resume projects.
  • Displayed extraction status as a UI chip in the Resume Drill sidebar.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/types/interview.ts Extends ResumeResource type with extraction_status.
frontend/src/components/resume-drill/ResumeDrillSidebar.tsx Shows extraction status chip next to parsed project count.
backend/main.py Adds runtime schema migration to create resumes.extraction_status column.
backend/database/schemas.py Adds extraction_status to ResumeResource API model.
backend/database/models.py Persists extraction_status on the Resume SQLAlchemy model.
backend/api/endpoints/resume.py Adds retry/backoff + quality gate + fallback logic and returns/persists extraction status.
Comments suppressed due to low confidence (1)

backend/main.py:31

  • The migration helper swallows all exceptions when running ALTER TABLE ... ADD COLUMN ..., which can hide real migration failures (syntax issues, missing tables, permissions) and leave the app running with an unexpected schema. Instead of a blanket except Exception: pass, consider checking for column existence first (e.g., PRAGMA table_info) or at least logging unexpected errors while still ignoring the specific "duplicate column" case.
        # Add new columns to existing tables (SQLite ALTER TABLE)
        # create_all only creates new tables, not new columns on existing ones.
        for col_sql in [
            "ALTER TABLE questions ADD COLUMN status VARCHAR(20) DEFAULT 'completed'",
            "ALTER TABLE questions ADD COLUMN session_id VARCHAR REFERENCES interview_sessions(id)",
            "ALTER TABLE resumes ADD COLUMN extraction_status VARCHAR(20) DEFAULT 'unknown' NOT NULL",
        ]:
            try:
                await conn.execute(text(col_sql))
            except Exception:
                pass  # Column already exists

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 176 to 180
filename: str
content_text: str
projects: list[ResumeProject]
extraction_status: str = "unknown"
created_at: datetime
<Chip
size="sm"
variant="soft"
color={resume.extraction_status === "fallback" ? "warning" : "success"}
- Added a ResumeExtractionStatus enum to constrain resume parser status values in API schemas.
- Normalized invalid persisted extraction statuses to unknown before returning resume resources.
- Updated the Resume Drill status chip to map ai, fallback, and unknown states to explicit colors.
@CUinspace233
CUinspace233 merged commit aa3fb1c into main May 24, 2026
2 checks passed
@CUinspace233
CUinspace233 deleted the improve_resume_drill branch May 24, 2026 08:11
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.

2 participants