Flatten resolutionSearchSchema for xAI compatibility#631
Conversation
- Extract resolutionSearchSchema to lib/schema/resolution-search.ts - Flatten schema structure to reduce nesting for better xAI compatibility - Replace z.literal with z.string to avoid JSON Schema 'const' constraints - Use explicit union types for coordinates instead of z.any() - Make geoJson field optional - Update agent prompt and field names - Add reconstruction logic in app/actions.tsx to maintain UI compatibility with standard GeoJSON Co-authored-by: ngoiyaeric <115367894+ngoiyaeric@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
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? |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
|
Caution Review failedPull request was closed or merged during review WalkthroughThe PR extracts the resolution search output schema into a centralized Zod definition, updates the agent to use this schema for structured output validation, and refactors the action flow to reconstruct a standard GeoJSON FeatureCollection from the validated features and persist it for rendering. ChangesResolution search schema centralization and GeoJSON handling
Sequence Diagram(s)sequenceDiagram
participant Agent as resolution-search agent
participant Action as resolution_search action
participant Storage as AI state storage
participant Render as GeoJsonLayer
Agent->>Action: analysisResult with geoJson.features[]
Action->>Action: reconstruct FeatureCollection<br/>from features array
Action->>Render: pass reconstructed geoJson
Action->>Storage: persist geoJson in<br/>resolution_search_result
Render->>Render: render GeoJSON features
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Restructured the
resolutionSearchSchemato follow a flattened pattern compatible with xAI's OpenAI-compatible endpoint. The schema was moved to a new filelib/schema/resolution-search.tsand updated to usez.string()instead ofz.literalfor fixed types and explicit coordinate types instead ofz.any(). Top-level fields likenewsContextandextractedCoordinateswere flattened into individual optional fields. TheresolutionSearchagent was updated to use this new schema, and reconstruction logic was added toapp/actions.tsxto transform the flattened features back into a standard GeoJSONFeatureCollectionfor the frontend map components.PR created automatically by Jules for task 5297044305958981276 started by @ngoiyaeric
Summary by CodeRabbit
Bug Fixes
Improvements