fix: resolve FlexibleSchema safeParse errors in chat.test.ts#247
fix: resolve FlexibleSchema safeParse errors in chat.test.ts#247vaishnavijha12 wants to merge 2 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
👋 Thanks for opening a PR, @vaishnavijha12!Your PR has entered the 🚦 PR Review Pipeline.
What happens next
A pipeline status comment will appear below and update automatically as your PR progresses. While you wait
This comment is posted only once. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
WalkthroughZod tool input schemas are extracted as reusable exported constants in ChangesTool Schema Extraction and Validation Refactoring
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Implemented the requested fix by exporting reusable Zod schemas and updating validation tests to avoid relying on Please let me know if any additional refinements are needed. Thanks! |
piyushdotcomm
left a comment
There was a problem hiding this comment.
lgtm. but to verify that you setup the project locally correctly make a playground in the project on your local server and add a screenshot of that
or at least add screenshot of the dashboard
|
show me the dashboard |
|
@vaishnavijha12 |


Description
This PR fixes TypeScript compilation failures in
chat.test.tscaused by the Vercel AI SDK exposingFlexibleSchemainstead of raw Zod schemas.Changes Made
app/api/chat/tools.tsz.object()schemas with exported schema constants.safeParse()Issue Fixed
Previously, tests used:
However,
inputSchemais now typed asFlexibleSchema, which does not expose native Zod methods like.safeParse().The tests now correctly validate against exported Zod schemas.
Closes #243
Summary by CodeRabbit
Constraints
Refactor