Two critical fixes for worksheet grading: 1. **Fix OpenAI Responses API parameters** - Move `verbosity` from top-level to `text.verbosity` - API was rejecting requests with 400 error - Confirmed against GPT-5 Responses API documentation 2. **Surface actual grading errors in UI** - Add `error_message` column to worksheet_attempts table - Store actual API/grading errors in database - Display real error messages instead of generic "too blurry" text - Users now see OpenAI API errors, validation failures, etc. Changes: - Updated gradeWorksheet.ts API call structure - Created migration 0020 for error_message column - Updated processAttempt.ts to save error messages - Updated API route to return errorMessage field - Updated results page to display actual errors Now when grading fails, users see helpful error messages like: "Unsupported parameter: 'verbosity'..." instead of just "too blurry" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5 lines
688 B
SQL
5 lines
688 B
SQL
-- Custom SQL migration file, put your code below! --
|
|
CREATE TABLE `worksheet_mastery` (`id` text PRIMARY KEY NOT NULL, `user_id` text NOT NULL, `skill_id` text NOT NULL, `is_mastered` integer DEFAULT 0 NOT NULL, `total_attempts` integer DEFAULT 0 NOT NULL, `correct_attempts` integer DEFAULT 0 NOT NULL, `last_accuracy` real, `first_attempt_at` integer, `mastered_at` integer, `last_practiced_at` integer NOT NULL, `updated_at` integer NOT NULL, `created_at` integer NOT NULL, FOREIGN KEY (`user_id`) REFERENCES `users`(`id`) ON UPDATE no action ON DELETE cascade);
|
|
--> statement-breakpoint
|
|
CREATE INDEX `worksheet_mastery_user_skill_idx` ON `worksheet_mastery` (`user_id`, `skill_id`);
|