Skip to content

fix(oauth): retain operator settings across provider login - #3688

Merged
lidge-jun merged 2 commits into
devfrom
codex/c-lane-3631-d778
Sep 5, 2026
Merged

fix(oauth): retain operator settings across provider login#3688
lidge-jun merged 2 commits into
devfrom
codex/c-lane-3631-d778

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

OAuth login currently rebuilds a provider row from its preset and loses operator settings outside a small preservation list. Preserve the existing row, refresh only login-owned transport/auth and registry-owned catalog fields, and keep valid live-discovery defaults. OAuth-only providers discard incompatible key credentials; providers supporting key overrides retain sanitized keys and billing intent. Cloud Code Assist login also clears account-owned project metadata so the next request uses the active credential snapshot.

Carries #3631 onto current dev, preserving the newer xAI transport overrides and their regressions. Original source commits: 015c04afd152380e4948c506d49acaa9215694d6, 3f4e7c5a46d1f078559bda9aa53b88a1d96c4e48, 171451d338ab76b55185e587986450397f20ee02.

Stack layer 3/5, depends on #3687 (codex/c-lane-3536-d778). Review only the OAuth configuration delta. Later Antigravity replay work consumes this layer; merge bottom-up.

Verification

  • No local tests, typechecks or builds, per explicit maintainer instruction.
  • macmini-cf Bun 1.4.0 at 7ca5890ba27b84f238445f0dfa4f4f8cba7f6be7: nine focused files, 174 pass / 0 fail; source archive SHA256 verified.
  • Independent security re-review: PASS. A real login from account A to B verifies the first outbound request uses B bearer/B project; startup reconciliation and non-CCA project behavior remain covered.
  • Preserve operator fields, explicit live-model choices, xAI protocol overrides, catalog reconciliation, credential removal, and key-mode billing intent.
  • Independent security review and current-head hosted CI are required before merge; draft while pending.

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.

Co-authored-by: SB Yoon 44089734+yansigit@users.noreply.github.com

Carry #3631 onto the current xAI transport baseline. Preserve canonical
login fields, registry catalog reconciliation, and key billing intent.

Source-commits: 015c04a, 3f4e7c5, 171451d
Co-authored-by: SB Yoon <44089734+yansigit@users.noreply.github.com>
@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.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 69 / 80

이 PR은 OAuth 로그인 때 provider 행을 preset으로 다시 만들어 운영자 설정을 잃던 문제를 줄입니다. 지금 HEAD의 upsertOAuthProviderconst next = {{ ...def.providerConfig }}로 시작한 뒤 liveModels·commandCodeVersion·xAI 오버레이·modelCosts·oauthAccountFailover·allowKeyAuthOverride 키 정도만 골라 붙입니다. preset에 없는 운영자 필드(선택 모델, 기타 transport 등)는 로그인마다 사라질 수 있습니다. 이 변경은 기존 행을 보존하고, 로그인이 소유하는 transport/auth와 레지스트리 catalog 필드만 갱신하며, 유효한 live-discovery 기본값을 지킵니다. OAuth-only는 맞지 않는 key credential을 버리고, key override 가능 provider는 sanitize된 키와 billing intent를 유지합니다. 원본 #3631 carry이고, 현재 xAI transport 오버라이드 회귀도 유지한다고 본문에 적혀 있습니다. C 레인 3/5, 베이스 #3687.

문서에 providers-accounts 참고가 조금 보강됐고, reconcile/upsert 테스트가 늘었습니다. 체크리스트의 security 항목이 아직 비어 있고, draft·hosted CI 대기입니다. Antigravity replay 후속 작업이 이 레이어를 소비한다고 하니, C 열차에서 위치가 분명합니다. types/config 분할과 직접 충돌하지 않습니다. config.ts persistence 스키마를 바꾸는 PR이 아닙니다.

OAuth 재로그인은 자주 일어나는 운영 동작입니다. 그때마다 피커 선택·가격 오버레이·failover 옵트아웃이 리셋되면 “로그인만 했는데 설정이 날아감”이 됩니다. HEAD의 whitelist 보존은 이미 몇 개를 막고 있지만 구멍이 남고, 이 PR은 보존 모델을 뒤집습니다. credential을 만지는 코드라 보안 체크리스트를 비워 둔 채 ready로 올리면 안 됩니다.

경로/심볼 src/oauth/index.ts upsertOAuthProvider - HEAD는 whitelist 보존입니다. 이 PR은 “기존 행 유지 + 로그인/레지스트리 소유 필드만 갱신”으로 뒤집습니다. 리뷰 핵심입니다.

경로 테스트 preserve operator fields / xAI / catalog / key billing - 의도가 테스트 이름으로 잠겨 있습니다. exact-head 원격 통과 주장을 본문이 적습니다.

경로 문서 providers-accounts.md - 로그인 후에도 운영자 설정이 남는다는 계약을 사용자 문구로 적습니다.

경로 의존 #3687#3682 - 아래 두 층이 먼저입니다. 이 diff만 cherry-pick해 dev에 단독 넣지 마세요.

경로 원본 #3631 - OPEN. 안착 후 landed로 닫으세요.

경로 체크리스트 security - 미체크. OAuth/credential 경계라 독립 보안 리뷰를 머지 게이트로 두는 편이 안전합니다.

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

  • 보존 필드 화이트리스트를 유지한 채 확장할지, “기존 행 전체 보존” 모델로 갈지(이 PR은 후자 쪽)
  • OAuth-only에서 key discard가 너무 공격적인 제공자가 있는지
  • security 리뷰 완료 전 ready 전환 허용 여부

너의 추천
방향은 맞지만 부모 두 층과 보안 리뷰가 먼저입니다. #3682#3687 머지 후 이 레이어 CI·보안 리뷰 통과 시에만 머지하세요. 그다음 #3631을 닫고 Antigravity replay 후속을 이어서 받으면 됩니다.

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

@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 bug Something isn't working label Sep 5, 2026
Base automatically changed from codex/c-lane-3536-d778 to dev September 5, 2026 17:09
@lidge-jun

Copy link
Copy Markdown
Owner Author

Owner explicitly authorized admin merging the C-lane stack. Independent security/code review: PASS at 7ca5890ba27b84f238445f0dfa4f4f8cba7f6be7. Remote focused verification: 174pass/0fail. Exact-head Cross-platform CI run 33979181943 succeeded with actual Linux/macOS suites and typecheck. Admin merge uses the owner-authorized review bypass; no self-approval is claimed. Original author attribution is retained.

@lidge-jun
lidge-jun marked this pull request as ready for review September 5, 2026 18:37
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 18:37
@lidge-jun
lidge-jun merged commit 789f69a into dev Sep 5, 2026
50 of 54 checks passed
@lidge-jun
lidge-jun deleted the codex/c-lane-3631-d778 branch September 5, 2026 18:37
@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-05T18:38:55.400746Z 7ca5890 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.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant