-
Notifications
You must be signed in to change notification settings - Fork 11.1k
fix: disable doubao coding plan selection #3379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -124,6 +124,8 @@ const PARAM_OVERRIDE_OPERATIONS_TEMPLATE = { | |||||||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| const DEPRECATED_DOUBAO_CODING_PLAN_BASE_URL = 'doubao-coding-plan'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| // 支持并且已适配通过接口获取模型列表的渠道类型 | ||||||||||||||||||||||||||||||||||||||||||||||||
| const MODEL_FETCHABLE_TYPES = new Set([ | ||||||||||||||||||||||||||||||||||||||||||||||||
| 1, 4, 14, 34, 17, 26, 27, 24, 47, 25, 20, 23, 31, 40, 42, 48, 43, | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -413,9 +415,21 @@ const EditChannelModal = (props) => { | |||||||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||||||
| const formContainerRef = useRef(null); | ||||||||||||||||||||||||||||||||||||||||||||||||
| const doubaoApiClickCountRef = useRef(0); | ||||||||||||||||||||||||||||||||||||||||||||||||
| const initialBaseUrlRef = useRef(''); | ||||||||||||||||||||||||||||||||||||||||||||||||
| const initialModelsRef = useRef([]); | ||||||||||||||||||||||||||||||||||||||||||||||||
| const initialModelMappingRef = useRef(''); | ||||||||||||||||||||||||||||||||||||||||||||||||
| const initialStatusCodeMappingRef = useRef(''); | ||||||||||||||||||||||||||||||||||||||||||||||||
| const doubaoCodingPlanDeprecationMessage = | ||||||||||||||||||||||||||||||||||||||||||||||||
| 'Doubao Coding Plan 不再允许新增。根据火山方舟文档,Coding 套餐额度仅适用于 AI Coding 产品内调用,不适用于单独 API 调用;在非 AI Coding 产品中使用对应的 Base URL 和 API Key 可能被视为违规,并可能导致订阅停用或账号封禁。'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| const canKeepDeprecatedDoubaoCodingPlan = | ||||||||||||||||||||||||||||||||||||||||||||||||
| initialBaseUrlRef.current === DEPRECATED_DOUBAO_CODING_PLAN_BASE_URL; | ||||||||||||||||||||||||||||||||||||||||||||||||
| const doubaoCodingPlanOptionLabel = ( | ||||||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip content={doubaoCodingPlanDeprecationMessage} position='left'> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <span className='inline-flex items-center gap-2'> | ||||||||||||||||||||||||||||||||||||||||||||||||
| <span>Doubao Coding Plan</span> | ||||||||||||||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+422
to
+432
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New tooltip/label text bypasses i18n pipeline Line 422-432 introduces user-facing strings outside 🌐 Suggested fix- const doubaoCodingPlanDeprecationMessage =
- 'Doubao Coding Plan 不再允许新增。根据火山方舟文档,Coding 套餐额度仅适用于 AI Coding 产品内调用,不适用于单独 API 调用;在非 AI Coding 产品中使用对应的 Base URL 和 API Key 可能被视为违规,并可能导致订阅停用或账号封禁。';
+ const doubaoCodingPlanDeprecationMessage = t(
+ 'Doubao Coding Plan 不再允许新增。根据火山方舟文档,Coding 套餐额度仅适用于 AI Coding 产品内调用,不适用于单独 API 调用;在非 AI Coding 产品中使用对应的 Base URL 和 API Key 可能被视为违规,并可能导致订阅停用或账号封禁。',
+ );
...
- <span>Doubao Coding Plan</span>
+ <span>{t('Doubao Coding Plan')}</span>As per coding guidelines: “Frontend i18n: Use 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| // 2FA状态更新辅助函数 | ||||||||||||||||||||||||||||||||||||||||||||||||
| const updateTwoFAState = (updates) => { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -946,6 +960,7 @@ const EditChannelModal = (props) => { | |||||||||||||||||||||||||||||||||||||||||||||||
| data.base_url = 'https://ark.cn-beijing.volces.com'; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| initialBaseUrlRef.current = data.base_url || ''; | ||||||||||||||||||||||||||||||||||||||||||||||||
| setInputs(data); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (formApiRef.current) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| formApiRef.current.setValues(data); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1260,6 +1275,7 @@ const EditChannelModal = (props) => { | |||||||||||||||||||||||||||||||||||||||||||||||
| fetchModels().then(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| fetchGroups().then(); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (!isEdit) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| initialBaseUrlRef.current = ''; | ||||||||||||||||||||||||||||||||||||||||||||||||
| setInputs(originInputs); | ||||||||||||||||||||||||||||||||||||||||||||||||
| if (formApiRef.current) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| formApiRef.current.setValues(originInputs); | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -3062,8 +3078,9 @@ const EditChannelModal = (props) => { | |||||||||||||||||||||||||||||||||||||||||||||||
| 'https://ark.ap-southeast.bytepluses.com', | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||
| value: 'doubao-coding-plan', | ||||||||||||||||||||||||||||||||||||||||||||||||
| label: 'Doubao Coding Plan', | ||||||||||||||||||||||||||||||||||||||||||||||||
| value: DEPRECATED_DOUBAO_CODING_PLAN_BASE_URL, | ||||||||||||||||||||||||||||||||||||||||||||||||
| label: doubaoCodingPlanOptionLabel, | ||||||||||||||||||||||||||||||||||||||||||||||||
| disabled: !canKeepDeprecatedDoubaoCodingPlan, | ||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||
| ]} | ||||||||||||||||||||||||||||||||||||||||||||||||
| defaultValue='https://ark.cn-beijing.volces.com' | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential mismatch with backend deprecated base URL breaks “keep existing” behavior
The guard compares/stores
doubao-coding-plan, but backend special-base config for OpenAI useshttps://ark.cn-beijing.volces.com/api/coding/v3(constant/channel.go:205-208). If loaded channels carry the resolved URL, existing deprecated channels won’t be recognized as keepable.🔧 Suggested fix
Also applies to: 425-425, 963-963, 3081-3083
🤖 Prompt for AI Agents