mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-02 08:31:35 +00:00
fix(grok): restore base URL resolution and operator settings wiring
Honor account GetGrokBaseURLOr policy for official vs custom endpoints, and wire settings resolution used by responses/chat URL builders.
This commit is contained in:
@@ -590,6 +590,7 @@ export interface SystemSettings {
|
||||
fallback_model_antigravity: string;
|
||||
grok_default_text_model: string;
|
||||
grok_cross_client_model_map_enabled: boolean;
|
||||
grok_default_base_url_mode: string;
|
||||
|
||||
// Per-platform account auto-pause thresholds (100 = disabled)
|
||||
account_scheduling_thresholds: AccountSchedulingThresholdsMap;
|
||||
@@ -911,6 +912,7 @@ export interface UpdateSettingsRequest {
|
||||
fallback_model_antigravity?: string;
|
||||
grok_default_text_model?: string;
|
||||
grok_cross_client_model_map_enabled?: boolean;
|
||||
grok_default_base_url_mode?: string;
|
||||
account_scheduling_thresholds?: AccountSchedulingThresholdsMap;
|
||||
enable_identity_patch?: boolean;
|
||||
identity_patch_prompt?: string;
|
||||
|
||||
@@ -445,6 +445,13 @@ export default {
|
||||
grokDefaultTextModelHint: 'Used for empty model values and, only when the switch is enabled, requests from other client model namespaces. Custom Grok model IDs are accepted.',
|
||||
grokCrossClientMap: 'Map other clients to Grok',
|
||||
grokCrossClientMapHint: 'Disabled by default. When enabled, GPT, Codex, o-series, and Claude model IDs are routed to the default Grok text model above.',
|
||||
grokDefaultBaseURLMode: 'Default Grok upstream',
|
||||
grokDefaultBaseURLModeHint: 'Used only when a Grok account has no explicit base URL. Media and voice endpoints continue to use their official API hosts.',
|
||||
grokBaseURLModeCLI: 'CLI chat proxy',
|
||||
grokBaseURLModeAPI: 'Public API',
|
||||
grokBaseURLModeUSEast1: 'Regional API (us-east-1)',
|
||||
grokBaseURLModeUSWest2: 'Regional API (us-west-2)',
|
||||
grokBaseURLModeEUWest1: 'Regional API (eu-west-1)',
|
||||
fingerprintUnification: 'Fingerprint Unification',
|
||||
fingerprintUnificationHint: 'Unify X-Stainless-* headers across users sharing the same OAuth account. Disabling passes through each client\'s original headers.',
|
||||
metadataPassthrough: 'Metadata Passthrough',
|
||||
|
||||
@@ -438,6 +438,13 @@ export default {
|
||||
grokDefaultTextModelHint: '用于空模型值;仅在右侧开关开启时也用于其他客户端模型命名空间。允许填写自定义 Grok 模型 ID。',
|
||||
grokCrossClientMap: '映射其他客户端模型到 Grok',
|
||||
grokCrossClientMapHint: '默认关闭。开启后,GPT、Codex、o 系列和 Claude 模型 ID 会路由到左侧默认 Grok 文本模型。',
|
||||
grokDefaultBaseURLMode: '默认 Grok 上游',
|
||||
grokDefaultBaseURLModeHint: '仅用于 Grok 账号未配置显式 base URL 的文本请求;媒体和语音仍使用官方 API 主机。',
|
||||
grokBaseURLModeCLI: 'CLI 聊天代理',
|
||||
grokBaseURLModeAPI: '公共 API',
|
||||
grokBaseURLModeUSEast1: '区域 API(us-east-1)',
|
||||
grokBaseURLModeUSWest2: '区域 API(us-west-2)',
|
||||
grokBaseURLModeEUWest1: '区域 API(eu-west-1)',
|
||||
fingerprintUnification: '指纹统一化',
|
||||
fingerprintUnificationHint: '统一共享同一 OAuth 账号的用户的 X-Stainless-* 请求头。关闭后透传客户端原始请求头。',
|
||||
metadataPassthrough: 'Metadata 透传',
|
||||
|
||||
@@ -991,6 +991,9 @@ export interface TempUnschedulableState {
|
||||
matched_keyword: string
|
||||
rule_index: number
|
||||
error_message: string
|
||||
trigger_count?: number
|
||||
trigger_threshold?: number
|
||||
trigger_window_minutes?: number
|
||||
}
|
||||
|
||||
export interface TempUnschedulableStatus {
|
||||
|
||||
@@ -5178,7 +5178,30 @@
|
||||
data-testid="grok-cross-client-model-map-toggle"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="md:col-span-2">
|
||||
<label
|
||||
for="grok-default-base-url-mode"
|
||||
class="text-sm font-medium text-gray-700 dark:text-gray-300"
|
||||
>
|
||||
{{ t("admin.settings.gatewayForwarding.grokDefaultBaseURLMode") }}
|
||||
</label>
|
||||
<select
|
||||
id="grok-default-base-url-mode"
|
||||
v-model="form.grok_default_base_url_mode"
|
||||
class="input mt-2 w-full"
|
||||
data-testid="grok-default-base-url-mode"
|
||||
>
|
||||
<option value="cli">{{ t("admin.settings.gatewayForwarding.grokBaseURLModeCLI") }}</option>
|
||||
<option value="api">{{ t("admin.settings.gatewayForwarding.grokBaseURLModeAPI") }}</option>
|
||||
<option value="us-east-1">{{ t("admin.settings.gatewayForwarding.grokBaseURLModeUSEast1") }}</option>
|
||||
<option value="us-west-2">{{ t("admin.settings.gatewayForwarding.grokBaseURLModeUSWest2") }}</option>
|
||||
<option value="eu-west-1">{{ t("admin.settings.gatewayForwarding.grokBaseURLModeEUWest1") }}</option>
|
||||
</select>
|
||||
<p class="mt-1.5 text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ t("admin.settings.gatewayForwarding.grokDefaultBaseURLModeHint") }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Fingerprint Unification -->
|
||||
<div class="flex items-center justify-between">
|
||||
@@ -9520,6 +9543,7 @@ const form = reactive<SettingsForm>({
|
||||
fallback_model_antigravity: "gemini-2.5-pro",
|
||||
grok_default_text_model: "grok-4.5",
|
||||
grok_cross_client_model_map_enabled: false,
|
||||
grok_default_base_url_mode: "cli",
|
||||
// Identity patch (Claude -> Gemini)
|
||||
enable_identity_patch: true,
|
||||
identity_patch_prompt: "",
|
||||
@@ -11102,6 +11126,7 @@ async function saveSettings() {
|
||||
form.grok_default_text_model.trim() || "grok-4.5",
|
||||
grok_cross_client_model_map_enabled:
|
||||
form.grok_cross_client_model_map_enabled,
|
||||
grok_default_base_url_mode: form.grok_default_base_url_mode,
|
||||
enable_identity_patch: form.enable_identity_patch,
|
||||
identity_patch_prompt: form.identity_patch_prompt,
|
||||
min_claude_code_version: form.min_claude_code_version,
|
||||
|
||||
Reference in New Issue
Block a user