Conversation
xAI Chat Completions returns 400 invalid-argument "Model grok-4.6 does not support parameter stop." The openai-chat adapter and Chat Completions passthrough copied inbound stop / stop_sequences with no capability guard, so Claude Code's auto-mode safety classifier (which always sends stop_sequences) failed the whole turn and surfaced it as the model being temporarily unavailable. Add noStopModels next to noTemperatureModels / noTopPModels / noPenaltyModels and thread it through the same registry, static-policy, derive, OAuth reconcile, editor-policy, rename, and behavior-report paths. Seed the xAI lineup with noStopModels: XAI_MODELS. Dropping stop degrades softly; sending it fails hard. The translated openai-chat guard stays a one-line change so the file stays inside its 822-line ratchet cap.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (29)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds ChangesStop parameter opt-out
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant ProviderRegistry
participant Router
participant OpenAIChatAdapter
participant ChatCompletionsPassthrough
ProviderRegistry->>Router: provide noStopModels
Router->>OpenAIChatAdapter: return resolved provider config
Router->>ChatCompletionsPassthrough: return resolved provider config
OpenAIChatAdapter->>OpenAIChatAdapter: omit stop for listed model
ChatCompletionsPassthrough->>ChatCompletionsPassthrough: delete stop for listed model
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 21.43% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 18 files. (11 skipped: 11 unsupported.)
✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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 |
|
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. |
리뷰 · 우선순위 62 / 80이 PR은 xAI Grok이 Chat Completions에서 라인 - 메인테이너의 판단이 필요한 지점 oauth/auth-cors 터치가 진짜 인증 면 변경이 아니라 정책 필드 전파뿐이면, 내용 확인 후 너의 추천 방향은 승인에 가깝습니다. 패턴 복사가 깔끔하고 실패 모드도 분명합니다. 메인테이너가 oauth/auth-cors diff를 훑어 스폰서 라벨만 달아 주고, 작성자가 체크리스트·full test·dev 최신 리베이스를 끝내면 머지해도 됩니다. xAI 전체 시드는 주석 근거가 있으니 유지하되, 나중에 이 댓글은 grok-bot이 작성했습니다 |
|
Duplicate of #5280 (same xAI Keep #5280. It already has the narrowed reasoning-id seed, adapter tests, and the one-line |
Summary
xAI Chat Completions returns
400 invalid-argument "Model grok-4.6 does not support parameter stop."when the openai-chat adapter or Chat Completions passthrough forwards inboundstop/stop_sequences. Claude Code's auto-mode safety classifier always sendsstop_sequences, so the whole turn failed and surfaced as the model being temporarily unavailable.This adds
noStopModelsnext tonoTemperatureModels/noTopPModels/noPenaltyModelsand threads it through the same registry, static-policy, derive, OAuth reconcile, editor-policy, rename, and behavior-report paths. The xAI lineup is seeded withnoStopModels: XAI_MODELS. Dropping stop degrades softly; sending it fails hard.The translated openai-chat guard is a one-line change so the file stays inside its 822-line ratchet cap.
Why oauth / auth-cors are in the diff
noStopModelsis a newOcxProviderConfigfield. The same one-line copies that already exist fornoTopPModelsare required for typecheck and OAuth/editor round-trip:src/oauth/index.ts—OAUTH_RECONCILE_FIELDSsrc/oauth/login-cli.ts— spread onto the key-login provider configsrc/server/auth-cors.ts—PROVIDER_CONFIG_FIELD_POLICY("editor")None of those files change auth, CORS, or credential handling. Hygiene still flags them as
unsponsored_surfacebecause the paths are in the restricted set. Maintainermaintainer-sponsoredis needed to lift the draft gate.Seed scope
Seed is the whole xAI catalog (
XAI_MODELS), same "lineup-wide" choice assupportsVerbosity: falseon this provider. Confirmed 400 is grok-4.6; later Chat ids share the surface. A model that later acceptsstopcan be removed from the list without an adapter change.The Claude Code classifier uses Anthropic
stop_sequenceson the Chat Completions / openai-chat path this adapter owns. Responses / ollama-native are out of scope.Test plan
bun x tsc --noEmitbun test tests/adapters/openai/openai-chat-stop-optout.test.ts tests/routing/routing-compatibility-model-matching.test.tsbun test tests/providers/provider-registry-parity.test.ts tests/test-layout-tooling.test.ts tests/test-layout.test.ts tests/providers/resolved-model-policy.test.tsbun test tests/oauth/oauth-provider-reconcile.test.ts tests/providers/xai/grok-config-inject.test.ts tests/ci-workflows/structure-ssot.test.ts tests/ci-workflows/file-size-ratchet.test.tsbun run structure:checkbun run test/prepushSupersedes #5280 (narrower wiring, no docs/behavior/CLOSED_KEYS, hygiene-blocked on the same surface).
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.