[BUG] Project Tutor API: unbounded input, missing timeout, and fragile question parsing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github, next.js, typescript
Hướng nghiên cứu
Start with src/app/api/project-tutor/route.ts and compare its request handling with the roast route’s readBoundedText(req, 8192); review callGroq and the existing API route tests. Add coverage in test/api-project-tutor-route.test.ts for invalid input, unknown actions, timeouts, and questions responses with surrounding text or an invalid shape. Done when inputs are validated before external calls, Groq has a 15s timeout, and question JSON is extracted and validated.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened?
src/app/api/project-tutor/route.ts:
Parses the body with req.json() and passes question into the Groq prompt with no type or length limit; each call is a paid model request. The roast route already uses readBoundedText(req, 8192).
A non-string repoUrl makes repoUrl.match throw, returning 500 instead of 400.
An unknown action still makes three GitHub API calls before returning 400.
callGroq has no AbortSignal timeout (same class as #4035 / #4054).
The questions action only strips code fences before JSON.parse, so any text around the JSON silently falls back to generic questions, and the parsed shape is never validated.
Expected: bound and validate input before any GitHub or model work, use a 15s timeout, extract and validate the JSON.
Found in source review; I’ll add tests in test/api-project-tutor-route.test.ts.
[x] I’d like to work on this.
Steps to reproduce
- Sign in and send POST /api/project-tutor with {"repoUrl": 123, "action": "analyze"} → returns 500 instead of 400.
- Send {"repoUrl": "https://github.com/vercel/next.js", "action": "bogus"} → three GitHub API calls are made before the 400.
- Send action "questions" while Groq returns text around the JSON (e.g. "Here are your questions: {...}") → the user silently gets the hard-coded generic questions.
- Send action "chat" with a very large "question" string → it is passed into the Groq prompt unchecked.
- If Groq stalls, the request has no timeout (callGroq passes no AbortSignal).
Where is it?
API
Where did you see it?
Local development
Browser and device
N/A (server-side API route)
Screenshots, console errors or logs
No response
Want to fix it?
- I'd like to work on this. A maintainer will assign you; please don't start before that.
- Ngôn ngữ chính
- TypeScript
- Star
- 246
- Fork
- 436
- Merge trung bình
- 9 giờ 33 phút
- Pull request đã merge (30 ngày)
- 213
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Priyanshu-byte-coder/devtrack
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Priyanshu-byte-coder/devtrack#4067 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
Priyanshu-byte-coder/devtrack#4066 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Webhook manager: replace the browser confirm() dialogs with ConfirmModalCó thể đã có người làm @Nandaninaulaa đã nhận 4 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
Priyanshu-byte-coder/devtrack#3889 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Goals form: square arcade buttons for recurrence, Create goal and RefreshCó thể đã có người làm @KartikeyG-world đã nhận 4 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:design
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Priyanshu-byte-coder/devtrack#3877 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Goals: the error banner and the "No goals yet" hint show at the same timeCó thể đã có người làm @KartikeyG-world đã nhận 4 ngày trước. Đang mởgood first issue level 1 level:beginner status:assigned type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
Priyanshu-byte-coder/devtrack#3872 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Priyanshu-byte-coder/devtrack
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
makecindy/cindy#15342 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
kwitsch/claude-code-plugin-tooling#219 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
no-repo-link tool-submission
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
BraveOPotato/NoSignups#2618 ·
-
enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100