Skip to content

feat(xai): restore Grok Responses default with persistent Chat opt-in - #3670

Merged
lidge-jun merged 9 commits into
devfrom
codex/grok-responses-default-chat-optin
Sep 5, 2026
Merged

feat(xai): restore Grok Responses default with persistent Chat opt-in#3670
lidge-jun merged 9 commits into
devfrom
codex/grok-responses-default-chat-optin

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

Summary

  • Default Grok 4.5/4.6 OAuth Responses traffic to native Responses, migrate existing Chat overrides once, and preserve later operator choices across restart, provider edits and reauthentication.
  • Expose Chat Completions through the existing GUI switch and ocx provider edit xai --xai-chat on|off; keep API-key/translated-inbound defaults, other models and service-tier boundaries unchanged.
  • Fix the observed first-result confusion on native routed code mode: carry the existing explicit-output guidance before the first call and explain wholly empty paired exec results, without rewriting JavaScript or replacing populated/multimodal output.
  • This is one rollout unit: the owner requested the first-output prerequisite before enabling the new default. Extra changed lines are regression coverage, all locale strings and the durable audit record.

Verification

  • No local test suites or local typecheck, per owner instruction. Every push uses --no-verify.
  • Remote macmini-cf at 601725c87: GUI build, GUI focused tests (9 pass), typecheck, affected runtime tests (803 pass), privacy scan passed. Follow-up changes and the current dev integration are being verified at exact HEAD.
  • Synthetic live Grok Responses: first generated exec source emitted stdout, the exact source ran once with exit 0, and the next response returned OCX_FIRST_RESULT_7391 with no additional tool call. This is one observed live roundtrip, not a guarantee about all future model output.
  • Isolated GUI/CLI runtime: old Chat config migrated; CLI Chat on showed checked; GUI off persisted Responses. No live service settings or credentials changed by this task.
  • Independent static review passed after fixing startup reconciliation ordering, OAuth re-login preservation and multimodal test rows. Latest-head GitHub CI must pass before marking ready or merging.
  • Owner explicitly requested admin merge. The eventual maintainer approval bypass will be disclosed here; no self-approval is claimed.

Grok Chat opt-in, off means Responses

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Security review: existing destination/authentication/tier boundaries are unchanged. The migration changes only two owned wire overrides and a version marker, rebases persistence under the existing lock, and preserves later intent. Native output guidance is gated away from OpenAI-operated destinations and non-code-mode catalogs; raw input and populated/multimodal results remain unchanged. No credentials or private task payloads are included.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Sep 5, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 74 / 80

이 PR은 xAI Grok 4.5/4.6 OAuth Responses 트래픽의 기본 와이어를 다시 native Responses로 두고, 예전에 남아 있던 Chat Completions 오버라이드는 업그레이드 때 한 번만 지운 뒤, 그 다음부터 운영자가 GUI/CLI로 고른 Chat 선택을 재시작·재인증·provider edit 뒤에도 지키게 합니다. Chat은 기존 스위치와 ocx provider edit xai --xai-chat on|off로만 켭니다. API-key·번역 inbound·다른 모델·service-tier 경계는 그대로입니다. 같은 롤아웃 단위로, native Responses code-mode 첫 exec가 결과를 비워 보이게 하던 문제를 고치기 위해 CODE_MODE_RESULT_ECHO_SENTENCE 계열 안내를 native 경로에도 싣고, 완전히 빈 paired exec만 설명합니다. JS를 고쳐 쓰거나 populated/multimodal 출력을 바꾸지 않습니다.

지금 dev(6585e6a70)에는 src/providers/xai-responses-opt-in.ts, registry의 xAI wire 기본, ProviderAuthPanel 스위치, management provider-routes 원자 패치가 이미 있습니다. 이 PR은 registry 기본을 Responses로 되돌리고, xaiResponsesDefaultVersion 마이그레이션·src/server/xai-responses-startup.ts·OAuth upsert 보존·(부가) Responses 경로의 OAuth 429 계정 회전을 src/server/responses/core.ts에 맞춥니다. 소유자(본인)가 admin merge를 요청한 상태이고, 스크린샷·원격 macmini 검증·합성 라이브 first-result 한 건이 본문에 있습니다. --no-verify 로컬 전제와 “latest-head GitHub CI must pass”가 같이 적혀 있어, 병합 게이트는 원격 CI입니다.

주의할 제품 결정은 “업그레이드 전 Chat 설정을 보존하지 않는다”입니다. 본문·plan이 명시했고, version 마커로 이후 Chat opt-in은 지킴니다. GUI 카피가 Responses opt-in에서 Chat Completions 선택으로 뒤집혀 혼동 여지가 있어 로케일 전부가 같이 바뀌는지가 중요합니다. first-output 안내는 OpenAI-operated가 아닌 code-mode 카탈로그에만 걸리게 게이트해야 하고, plan도 그렇게 적혀 있습니다. #3668 직후 큰 기능 PR이라 충돌면은 xAI/registry/oauth 쪽이고 split-train과는 무관합니다.

src/providers/registry.ts - Grok 4.5/4.6 wire Chat→Responses; auth/inbound/tier fence 유지 여부 확인 필요
src/providers/xai-responses-opt-in.ts + xai-responses-startup.ts - 일회 마이그레이션·실패 시 disk 보존·preset reconcile 순서
gui/.../ProviderAuthPanel.tsx - 스위치 의미가 Chat 선택으로 반전; mixed 클릭 동작
src/adapters/responses-code-mode.ts / openai-responses.ts - 첫 턴 guidance·빈 exec 설명; OpenAI native 미적용
src/server/responses/core.ts - OAuth 429 회전을 Responses passthrough에 맞춤(범위 큼)
Draft + CI - ready/merge 전 latest-head 검사 필수; 소유자 admin-merge 의도 명시됨

메인테이너의 판단이 필요한 지점

  • 업그레이드 시 기존 Chat 강제 제거를 그대로 갈지(소유자 요청과 일치)
  • Responses core의 429 회전을 같은 PR에 둘지 후속으로 뺄지
  • Draft 해제·CI 그린 후 admin merge할지, 일반 리뷰 대기할지

너의 추천
제품 방향은 merge 쪽. CI 그린과 Draft 해제 확인 후 admin merge. 429 회전이 리뷰 부담이면 후속 PR로 쪼갤 수 있으나, Responses 기본과 같은 계약이면 한 유닛 유지가 plan과 맞음.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun marked this pull request as ready for review September 5, 2026 15:11
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 15:11
@lidge-jun

Copy link
Copy Markdown
Owner Author

The owner explicitly requested immediate admin merge and post-merge dev CI observation. Independent implementation review passed; Linux shards, gates, and packaging checks passed. One macOS shard is still running and the PR policy job was cancelled. Proceeding with the owner-authorized approval/check bypass, without self-approval, then monitoring the exact dev push-event CI. Additional fixes are not authorized by this monitoring request.

@lidge-jun
lidge-jun merged commit af50c6d into dev Sep 5, 2026
25 of 27 checks passed
@lidge-jun
lidge-jun deleted the codex/grok-responses-default-chat-optin branch September 5, 2026 15:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T15:17:40.435292Z 2e50d26 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2e50d26fad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1015 to +1019
if (!Object.hasOwn(body.provider, "modelAdapters") && latest?.modelAdapters) {
prov.modelAdapters = { ...latest.modelAdapters };
}
if (latest?.xaiResponsesDefaultVersion !== undefined) {
prov.xaiResponsesDefaultVersion = latest.xaiResponsesDefaultVersion;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stamp new xAI Chat choices as migration-complete

When an xai provider is created after startup through POST /api/providers with explicit Chat entries in modelAdapters, latest is absent, so this block persists neither an existing nor a new xaiResponsesDefaultVersion. On the next restart, migrateStartupXaiResponses treats that newly written configuration as legacy and deletes both explicit Chat choices. Stamp the current migration version when the submitted xAI provider explicitly selects either owned model wire; the batch provider editor needs the same treatment.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant