fix: ChatBubble crash and DeepSeek API compatibility

- Fix ChatBubble to handle non-string content with String() wrapper
- Fix API route to use generateText for non-streaming requests
- Add @ai-sdk/openai-compatible for non-OpenAI providers (DeepSeek, etc.)
- Use Chat Completions API instead of Responses API for compatible providers
- Update ChatBubble tests and fix component exports to kebab-case
- Remove stale PascalCase ChatBubble.tsx file
This commit is contained in:
Max
2026-01-26 16:55:05 +07:00
parent 6b113e0392
commit e9e6fadb1d
544 changed files with 113077 additions and 427 deletions

View File

@@ -0,0 +1,21 @@
**🔥 CODE REVIEW FINDINGS, Max!**
**Story:** `3-1-history-feed-ui.md`
**Git vs Story Discrepancies:** Git repository not detected (Manual verification performed). New files verified.
**Issues Found:** 2 High, 1 Medium, 0 Low
## 🔴 CRITICAL ISSUES
- **Syntax Error in Production Code**: `src/components/features/journal/HistoryFeed.tsx` (Line 27) contains a syntax error: `const loading = useHistoryStore((s) => s.loading));` (extra closing parenthesis). This prevents the app from compiling.
- **Incorrect Sorting Logic (AC Violation)**: `DraftService.getCompletedDrafts` sorts by Primary Key (ID) instead of `completedAt`. The query `.where('status').equals('completed').reverse()` uses the `status` index, which falls back to ID sorting. This means drafts created earlier but completed later will appear at the bottom, violating "newest first" (by completion date) requirement.
## 🟡 MEDIUM ISSUES
- **Inefficient Index Usage**: The Schema V4 in `src/lib/db/index.ts` adds `completedAt` as a simple index (`status, completedAt`), but a compound index `[status+completedAt]` would be more efficient and allow precise sorting/filtering in one query.
## 🟢 LOW ISSUES
- None found.
I have identified these issues. Please select an action:
1. **Fix them automatically** - I'll fix the syntax error and correct the sorting logic (updating schema if needed).
2. **Create action items** - Add to story Tasks/Subtasks.
3. **Show me details** - Deep dive into values.