Skip to content

small update#210

Merged
ding113 merged 8 commits intomainfrom
dev
Nov 26, 2025
Merged

small update#210
ding113 merged 8 commits intomainfrom
dev

Conversation

@ding113
Copy link
Owner

@ding113 ding113 commented Nov 26, 2025

No description provided.

Silentely and others added 8 commits November 26, 2025 20:20
- 将"【重要】因各家供应商情况不同,测试结果仅供参考,不代表实际调用效果"调整为第一句
- 将"测试将向供应商发送真实请求,可能消耗少量额度"调整为第二句
- 保持"请确认供应商 URL、API 密钥及模型配置正确"为第三句

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- 在executeProviderApiTest接口中添加userAgent参数,支持渠道特定的User-Agent配置
- 更新Anthropic Messages API使用claude-cli/2.0.50 (external, cli) User-Agent
- 更新OpenAI Chat Completions API使用OpenAI/NodeJS/3.2.1 User-Agent
- 更新OpenAI Responses API使用codex_cli_rs/0.63.0 User-Agent
- 更新Gemini API使用GeminiCLI/v0.17.1 User-Agent
- 移除硬编码的通用User-Agent,改为使用各渠道特定的标识
- 避免被Cloudflare Bot检测系统拦截,提高API测试成功率
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- 英文版:将"[IMPORTANT] Results may vary by provider..."调整为第一句
- 繁体中文版:将"【重要】因各家供應商情況不同..."调整为第一句
- 保持与简体中文版一致的优先级:结果参考 > 真实请求 > 确认配置

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…-agents

fix: 调整为不同API提供商添加特定User-Agent,避免统一使用claude-cli/2.0.33
将新增/编辑/克隆服务商弹窗宽度从 max-w-4xl (896px) 调整为 max-w-6xl (1152px)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
根据 PR #208 中的 Critical 评论,修改 React 组件显示顺序而非 JSON 键顺序:

• 将 {t("disclaimer.resultReference")} 调整为第一行
• 将 {t("disclaimer.realRequest")} 调整为第二行
• 保持 {t("disclaimer.confirmConfig")} 为第三行

现在免责提醒的实际显示顺序为:
1. 【重要】因各家供应商情况不同,测试结果仅供参考,不代表实际调用效果
2. 测试将向供应商发送真实请求,可能消耗少量额度
3. 请确认供应商 URL、API 密钥及模型配置正确

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…er-order

fix: 调整模型测试提醒顺序
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ding113, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the application's API testing capabilities by introducing distinct User-Agent headers for various service providers, aiming to enhance the accuracy and success rate of these tests. Concurrently, it improves the user experience by expanding the display area of provider management dialogs and reordering critical disclaimer information for better visibility and understanding.

Highlights

  • API Test Robustness: Implemented provider-specific User-Agent headers for API tests to improve compatibility and prevent bot detection, ensuring more reliable testing.
  • UI/UX Enhancements: Increased the maximum width of provider configuration dialogs (add, edit, clone) for better usability and reordered disclaimer messages in the API test button for improved clarity.
  • Localization Updates: Updated disclaimer messages across English, Simplified Chinese, and Traditional Chinese localization files to emphasize the importance of test results.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@ding113 ding113 linked an issue Nov 26, 2025 that may be closed by this pull request
@ding113 ding113 added enhancement New feature or request size/XS Extra Small PR (< 50 lines) labels Nov 26, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a userAgent property to the provider API test functions, allowing each test to use a specific User-Agent string. This is a good improvement to avoid being blocked by services like Cloudflare. The PR also includes some minor UI tweaks, widening dialogs, and updating localization files.

My review focuses on improving the maintainability of the new code by suggesting the use of constants for the new User-Agent strings and standardizing comments to English for better consistency.

@ding113
Copy link
Owner Author

ding113 commented Nov 26, 2025

🔒 Security Scan Results

No security vulnerabilities detected

This PR has been scanned against OWASP Top 10, CWE Top 25, and common security anti-patterns. No security issues were identified in the code changes.

Changes Analyzed

File Change Type Security Impact
messages/en/settings.json i18n text reordering ✅ None
messages/zh-CN/settings.json i18n text reordering ✅ None
messages/zh-TW/settings.json i18n text reordering ✅ None
src/actions/providers.ts Channel-specific User-Agent strings ✅ None
add-provider-dialog.tsx Dialog width increase ✅ None
api-test-button.tsx Disclaimer display order ✅ None
provider-rich-list-item.tsx Dialog width increase ✅ None

Security Analysis Details

User-Agent String Changes (src/actions/providers.ts):

  • Changed from single hardcoded User-Agent to channel-specific hardcoded User-Agent strings
  • All User-Agent values are static strings defined in code (not user-controlled)
  • No injection risk: "claude-cli/2.0.50 (external, cli)", "OpenAI/NodeJS/3.2.1", "codex_cli_rs/0.63.0", "GeminiCLI/v0.17.1 (platform; arch)"
  • Existing security controls (session validation, URL validation, proxy URL validation) remain intact

Scanned Categories

  • ✅ Injection attacks (SQL, NoSQL, Command, LDAP, etc.)
  • ✅ Authentication and session management
  • ✅ Sensitive data exposure
  • ✅ Access control and authorization
  • ✅ Security misconfiguration
  • ✅ Cross-site scripting (XSS)
  • ✅ Insecure deserialization
  • ✅ SSRF and path traversal
  • ✅ Cryptographic weaknesses
  • ✅ Header injection / HTTP response splitting

📋 OWASP Top 10 Coverage

  • A01: Injection - No user input flows into User-Agent headers
  • A02: Broken Authentication - No changes to auth mechanisms
  • A03: Sensitive Data Exposure - No sensitive data changes
  • A04: XML External Entities - N/A (no XML processing)
  • A05: Broken Access Control - Admin session check preserved
  • A06: Security Misconfiguration - Clean
  • A07: XSS - No HTML rendering changes that accept user input
  • A08: Insecure Deserialization - N/A
  • A09: Known Vulnerabilities - N/A (no dependency changes)
  • A10: Logging & Monitoring - N/A

🛡️ Security Posture

Strong - This PR makes minimal, low-risk changes. The User-Agent strings are hardcoded constants (not user-controlled), and all existing security controls (session validation, URL validation, authorization checks) remain unchanged.


🤖 Automated security scan by Claude AI - OWASP Top 10 & CWE coverage

@ding113 ding113 added the size/S Small PR (< 200 lines) label Nov 26, 2025
Copy link
Owner Author

@ding113 ding113 left a comment

Choose a reason for hiding this comment

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

📋 Code Review Summary

This PR contains minor UI/UX improvements and a small refactor to make User-Agent configuration more flexible. All changes are low-risk and well-implemented.

🔍 Issues Found

  • Critical (🔴): 0 issues
  • High (🟠): 0 issues
  • Medium (🟡): 0 issues
  • Low (🟢): 0 issues

🎯 Priority Actions

No significant issues identified. The PR is ready for merge.

💡 General Observations

Changes reviewed:

  1. i18n files: Reordered disclaimer messages and added "[IMPORTANT]" prefix for emphasis
  2. providers.ts: Added channel-specific User-Agent configuration - clean refactor that improves flexibility
  3. Dialog components: Increased dialog width from 896px to 1152px to prevent horizontal scrolling with long model names
  4. api-test-button.tsx: Reordered disclaimer display to match i18n key ordering

All changes are straightforward, low-risk, and appropriately scoped.


🤖 Automated review by Claude AI - focused on identifying issues for improvement

@ding113 ding113 merged commit 9f0b323 into main Nov 26, 2025
12 of 14 checks passed
ding113 pushed a commit that referenced this pull request Nov 26, 2025
sususu98 pushed a commit to sususu98/claude-code-hub that referenced this pull request Nov 28, 2025
ding113 pushed a commit that referenced this pull request Nov 28, 2025
ding113 pushed a commit that referenced this pull request Nov 28, 2025
@ding113 ding113 mentioned this pull request Nov 28, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/S Small PR (< 200 lines) size/XS Extra Small PR (< 50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

测试供应商claude报错

2 participants

Comments