Add specific AI SDK patterns to PR review prompt

This commit is contained in:
dayuan.jiang
2025-11-29 01:18:25 +09:00
parent 3e2dbbb541
commit 56167d363c

View File

@@ -79,12 +79,18 @@ jobs:
Review this PR for ONLY these issues: Review this PR for ONLY these issues:
1. Bugs that would cause runtime errors or broken functionality 1. Bugs that would cause runtime errors or broken functionality
2. Security issues (exposed secrets, API key leaks) 2. Security issues (exposed secrets, API key leaks)
3. AI SDK misuse (wrong patterns for streamText, tool definitions, message handling) 3. AI SDK misuse - specifically check for:
- Client-side: Should use useChat/useCompletion/useObject hooks, NOT raw fetch()
- Server-side: Should use streamText/generateText/streamObject/generateObject
- Message handling: Access message.parts array, not legacy content property
- Tool definitions: Must use Zod schemas for inputSchema
- Status handling: Check status (submitted/streaming/ready/error) before actions
- Stream cleanup: Call stop() when aborting streams
DO NOT comment on: DO NOT comment on:
- Performance optimizations - Performance optimizations
- Code style or formatting - Code style or formatting
- "Best practices" suggestions - "Best practices" that don't affect functionality
- Type safety improvements - Type safety improvements
- Error handling additions - Error handling additions