Repository navigation
fix(go-models): add xAI model listing suffix - #15236
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR adds a ChangesXAI Model Listing Configuration and Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
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. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/entity/models/xai_test.go`:
- Around line 117-119: The httptest server handler currently calls t.Fatalf
(inside the goroutine created by httptest.NewServer) which is unsafe; update the
handler to call t.Errorf instead so failures are reported from the handler
goroutine without terminating the test goroutine. Locate the handler used to
construct srv := httptest.NewServer(http.HandlerFunc(...)) in the xai test and
replace the t.Fatalf call with t.Errorf, keeping the same error message and
ensuring ListModels-related assertion logic remains unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b8734ef7-848f-4ed2-877c-14b63ac5ed5e
📒 Files selected for processing (3)
conf/models/xai.jsoninternal/entity/models/xai.gointernal/entity/models/xai_test.go
Haruko386
left a comment
There was a problem hiding this comment.
@oktofeesh1 LGTM
Thank you for your contribution
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #15236 +/- ##
=======================================
Coverage 93.16% 93.16%
=======================================
Files 10 10
Lines 717 717
Branches 118 118
=======================================
Hits 668 668
Misses 29 29
Partials 20 20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
modelsURL suffix used by the existing GoListModelsimplementationWhat changed
url_suffix.modelstoconf/models/xai.json.CheckConnectiondelegation.Why
XAIModel.ListModelsalready builds requests fromURLSuffix.Models, andCheckConnectiondelegates to that method. The bundled xAI config did not define that suffix, which left the model-listing path unable to call the provider/modelsendpoint from the existing provider config.Validation
go test ./internal/entity/models -run TestXAI -count=1go test ./internal/entity -count=1git diff HEAD~1..HEAD --checkNotes
go test ./internal/entity/models -count=1currently fails in unchanged Astraflow coverage:TestAstraflowEmbedReturnsNoSuchMethodpanics before reaching any xAI assertions.