Add the environment variable CLAUDE_CODE_SKIP_PREFLIGHT_CHECK=1 to allow access in China and Hong Kong.#27
Add the environment variable CLAUDE_CODE_SKIP_PREFLIGHT_CHECK=1 to allow access in China and Hong Kong.#27Named1ess wants to merge 4 commits intopaoloanzn:mainfrom
Conversation
…low use in China and Hong Kong. Add the environment variable CLAUDE_CODE_SKIP_PREFLIGHT_CHECK=1 to allow use in China and Hong Kong.
Add a comment.
📝 WalkthroughWalkthroughAdded conditional bypass logic to preflight connectivity checks in the utilities module. When the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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.
🧹 Nitpick comments (1)
src/utils/preflightChecks.tsx (1)
19-21: Centralize the skip-flag check (and optionally emit a “preflight skipped” event).The same env key and condition are duplicated in
checkEndpoints()and_temp(). Extract a shared constant/helper to avoid drift, and consider logging a dedicated skip event for observability.♻️ Suggested refactor
+const SKIP_PREFLIGHT_ENV = 'CLAUDE_CODE_SKIP_PREFLIGHT_CHECK'; +const shouldSkipPreflight = () => isEnvTruthy(process.env[SKIP_PREFLIGHT_ENV]); async function checkEndpoints(): Promise<PreflightCheckResult> { - if (isEnvTruthy(process.env.CLAUDE_CODE_SKIP_PREFLIGHT_CHECK)) { //Bypasses preflight checks if the environment variable is set. - return { success: true }; //return true + if (shouldSkipPreflight()) { + // Optional: logEvent('tengu_preflight_check_skipped', { env: SKIP_PREFLIGHT_ENV }); + return { success: true }; } function _temp() { - if (isEnvTruthy(process.env.CLAUDE_CODE_SKIP_PREFLIGHT_CHECK)) { - return;// Skip preflight checks if the corresponding environment variable is enabled. + if (shouldSkipPreflight()) { + return; } return process.exit(1); }Also applies to: 153-155
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/utils/preflightChecks.tsx` around lines 19 - 21, Extract the duplicated environment check into a single exported helper (e.g., const SKIP_PREFLIGHT_ENV = 'CLAUDE_CODE_SKIP_PREFLIGHT_CHECK' and function shouldSkipPreflight() that calls isEnvTruthy(process.env[SKIP_PREFLIGHT_ENV])) and replace the inline checks in the current file and in checkEndpoints() and _temp() to call shouldSkipPreflight(); also emit or log a single "preflight skipped" observability event from that helper (or have it call a provided logger/emitter) so all callers get a consistent skip message.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/utils/preflightChecks.tsx`:
- Around line 19-21: Extract the duplicated environment check into a single
exported helper (e.g., const SKIP_PREFLIGHT_ENV =
'CLAUDE_CODE_SKIP_PREFLIGHT_CHECK' and function shouldSkipPreflight() that calls
isEnvTruthy(process.env[SKIP_PREFLIGHT_ENV])) and replace the inline checks in
the current file and in checkEndpoints() and _temp() to call
shouldSkipPreflight(); also emit or log a single "preflight skipped"
observability event from that helper (or have it call a provided logger/emitter)
so all callers get a consistent skip message.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a5283777-9836-4aee-bd8a-fa96c53c5652
📒 Files selected for processing (1)
src/utils/preflightChecks.tsx
|
LGTM, agree with the cr nitpicks |
Add the environment variable CLAUDE_CODE_SKIP_PREFLIGHT_CHECK=1 to allow access in China and Hong Kong.
Summary by CodeRabbit