Description
StudyPlan's entire core value proposition is: "Paste messy text → AI extracts tasks → Structured Tasks." This depends entirely on a single external call to the Google Gemini API per the documented architecture (AI Layer (Gemini API)). Based on the README and file structure, there's no dedicated error-handling module or documented behavior for:
- Missing/invalid
GEMINI_API_KEY (the .env.example only documents the key itself, not what happens if it's wrong)
- Gemini API rate limiting or downtime
- The AI returning malformed/non-JSON output that can't be parsed into "Dates, Subjects" as the architecture diagram describes
Why This Matters
Since there is "Zero Manual Entry" by design, an AI extraction failure with no graceful fallback means the user is left with a blank screen and no path forward — a hard usability dead-end for the app's single primary use case.
Proposed Scope
- Add explicit try/catch around the Gemini API call in
server.js
- Return structured error responses (e.g.
{ error: "extraction_failed", message: "..." }) instead of letting the request hang or 500
- On the frontend (
app.js), show a clear message: "Couldn't extract tasks from that text — try rephrasing or check back in a moment", with an option to manually add the task instead
- Add a startup check that warns in the console (not just a silent failure) if
GEMINI_API_KEY is missing from .env
Acceptance Criteria
Labels: bug, enhancement, backend, priority: high
Description
StudyPlan's entire core value proposition is: "Paste messy text → AI extracts tasks → Structured Tasks." This depends entirely on a single external call to the Google Gemini API per the documented architecture (
AI Layer (Gemini API)). Based on the README and file structure, there's no dedicated error-handling module or documented behavior for:GEMINI_API_KEY(the.env.exampleonly documents the key itself, not what happens if it's wrong)Why This Matters
Since there is "Zero Manual Entry" by design, an AI extraction failure with no graceful fallback means the user is left with a blank screen and no path forward — a hard usability dead-end for the app's single primary use case.
Proposed Scope
server.js{ error: "extraction_failed", message: "..." }) instead of letting the request hang or 500app.js), show a clear message: "Couldn't extract tasks from that text — try rephrasing or check back in a moment", with an option to manually add the task insteadGEMINI_API_KEYis missing from.envAcceptance Criteria
Labels:
bug,enhancement,backend,priority: high