Skip to content

fix: isUsing3PServices 检查所有非 Anthropic provider#1235

Merged
claude-code-best merged 1 commit into
claude-code-best:mainfrom
Evsdrg:fix/is-using-3p-services
May 16, 2026
Merged

fix: isUsing3PServices 检查所有非 Anthropic provider#1235
claude-code-best merged 1 commit into
claude-code-best:mainfrom
Evsdrg:fix/is-using-3p-services

Conversation

@Evsdrg
Copy link
Copy Markdown
Contributor

@Evsdrg Evsdrg commented May 16, 2026

Summary

isUsing3PServices() 仅检查 Bedrock / Vertex / Foundry,遗漏了
OpenAI、Gemini、Grok 三个通过 CLAUDE_CODE_USE_* 环境变量切换的
第三方 provider。

这导致两个问题:

  1. 命令可用性判定中 OpenAI/Gemini/Grok 用户被错误识别为 console 用户
    /fast/install-github-app 两个 Anthropic 专有命令误显示)
  2. auth status 显示中这些用户被误报为"未登录"

Changes

在函数中添加三个缺失的环境变量检查,并更新注释说明与 providers.ts
的同步要求。

Test plan

  • tsc --noEmit 零错误
  • biome format 零差异
  • biome lint 零违规

🤖 Generated with Claude Code Best

Summary by CodeRabbit

  • New Features
    • Added support for detecting additional third-party AI provider environments (OpenAI, Gemini, Grok).

Review Change Stack

原实现仅检查 Bedrock/Vertex/Foundry,遗漏了 OpenAI、Gemini、Grok
三个通过 CLAUDE_CODE_USE_* 环境变量切换的第三方 provider。

这导致:
- 命令可用性判定中 OpenAI/Gemini/Grok 用户被错误识别为 console 用户
  (/fast、/install-github-app 两个 Anthropic 专有命令误显示)
- auth status 显示中这些用户被误报为"未登录"

Co-Authored-By: deepseek-v4-pro[1m] <deepseek-ai@claude-code-best.win>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ad4e4212-7339-4a27-9a1a-eaafc1db9428

📥 Commits

Reviewing files that changed from the base of the PR and between 5b941d4 and 8daca0f.

📒 Files selected for processing (1)
  • src/utils/auth.ts

📝 Walkthrough

Walkthrough

The isUsing3PServices() function in src/utils/auth.ts now detects three additional third-party provider environments—OpenAI, Gemini, and Grok—alongside existing Bedrock, Vertex, and Foundry detection. The function's documentation was expanded to clarify its broader gating purpose and explicitly require keeping the implementation synchronized with getAPIProvider() environment variable handling.

Changes

Third-party provider detection expansion

Layer / File(s) Summary
Extended third-party service detection
src/utils/auth.ts
isUsing3PServices() now checks CLAUDE_CODE_USE_OPENAI, CLAUDE_CODE_USE_GEMINI, and CLAUDE_CODE_USE_GROK environment variables to gate third-party provider usage, with documentation expanded to describe the gating purpose and sync requirement with getAPIProvider().

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • claude-code-best/claude-code#420: Broadens third-party provider detection in src/utils/auth.ts to include OpenAI/Gemini/Grok flags, which directly affects how requests are classified as "third-party" and payload shapes in the API service layer.
  • claude-code-best/claude-code#189: Expands third-party provider environment detection that feeds into API provider selection logic used by status panel configuration fields for Grok and OpenAI.
  • claude-code-best/claude-code#102: Also modifies src/utils/auth.ts to adjust provider environment gating for OpenAI-related modes and authentication enabling/disabling logic.

Poem

🐰 With OpenAI, Gemini, and Grok now in sight,
The provider detection spreads its wings wide and bright,
Third-party services recognized with care,
Each flag now dances in the env-var air,
Synced with getAPIProvider, keeping all fair!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: expanding isUsing3PServices to check all non-Anthropic providers, matching the core objective of fixing the function to detect OpenAI, Gemini, and Grok providers.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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 and usage tips.

@claude-code-best claude-code-best merged commit 48a19b8 into claude-code-best:main May 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants