Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(harness): remove huawei proxy from frontend

m056838700927470b25fbf
diff --git a/jiuwenclaw/web/src/components/ConfigPanel/index.tsx b/jiuwenclaw/web/src/components/ConfigPanel/index.tsx
index 41182379da..4525cf23a1 100644
--- a/jiuwenclaw/web/src/components/ConfigPanel/index.tsx
+++ b/jiuwenclaw/web/src/components/ConfigPanel/index.tsx
@@ -112,58 +112,9 @@ const EVOLUTION_KEYS = new Set(["evolution_auto_scan", "skill_create"]);
const AGENT_KEYS = new Set(["name", "model", "skills", "max_iterations", "completion_timeout"]);
const TEAM_KEYS = new Set(["team_name", "lifecycle", "teammate_mode", "spawn_mode"]);
const FREE_SEARCH_BOOLEAN_KEYS = new Set(["free_search_ddg_enabled", "free_search_bing_enabled"]);
-const FREE_SEARCH_KEYS = new Set([...FREE_SEARCH_BOOLEAN_KEYS, "free_search_proxy_url"]);
+const FREE_SEARCH_KEYS = new Set([...FREE_SEARCH_BOOLEAN_KEYS]);
+const HIDDEN_CONFIG_KEYS = new Set(["free_search_proxy_url"]);
const MEMORY_KEYS = new Set(["memory_forbidden_enabled", "memory_forbidden_description"]);
-const DEFAULT_PROXY_SCHEME = "http";
-const DEFAULT_PROXY_HOST = "proxyhk.huawei.com";
-const DEFAULT_PROXY_PORT = "8080";
-
-type ProxyParts = {
- username: string;
- password: string;
-};
-
-function decodeUrlPart(value: string): string {
- try {
- return decodeURIComponent(value);
- } catch {
- return value;
- }
-}
-
-function parseProxyUrl(value: string): ProxyParts {
- const trimmed = (value || "").trim();
- if (!trimmed) {
- return { username: "", password: "" };
- }
- try {
- const url = new URL(trimmed);
- return {
- username: decodeUrlPart(url.username),
- password: decodeUrlPart(url.password),
- };
- } catch {
- const withoutScheme = trimmed.replace(/^[a-z][a-z0-9+.-]*:\/\//i, "");
- const [authAndHost] = withoutScheme.split(/[/?#]/, 1);
- const at = authAndHost.lastIndexOf("@");
- const auth = at >= 0 ? authAndHost.slice(0, at) : "";
- const colon = auth.indexOf(":");
- return {
- username: colon >= 0 ? decodeUrlPart(auth.slice(0, colon)) : decodeUrlPart(auth),
- password: colon >= 0 ? decodeUrlPart(auth.slice(colon + 1)) : "",
- };
- }
-}
-
-function buildProxyUrl(parts: ProxyParts): string {
- const username = parts.username.trim();
- const password = parts.password;
- if (!username && !password) return "";
- const auth = username || password
- ? `${encodeURIComponent(username)}${password ? `:${encodeURIComponent(password)}` : ""}@`
- : "";
- return `${DEFAULT_PROXY_SCHEME}://${auth}${DEFAULT_PROXY_HOST}:${DEFAULT_PROXY_PORT}`;
-}
function classifyKey(key: string): string {
if (MODEL_DEFAULT_KEYS.has(key)) return "model_default";
@@ -377,49 +328,9 @@ function isProviderKey(key: string): boolean {
return key.endsWith("_provider");
}
-function ProxyUrlInput({
- value,
- onChange,
- t,
-}: {
- value: string;
- onChange: (value: string) => void;
- t: (key: string) => string;
-}) {
- const parts = parseProxyUrl(value);
- const update = (patch: Partial<ProxyParts>) => {
- onChange(buildProxyUrl({ ...parts, ...patch }));
- };
- const inputClass = "w-full rounded-md border border-border bg-bg px-3 py-2 text-[13px] outline-none focus:border-accent";
- return (
- <div className="space-y-1.5">
- <div className="grid grid-cols-1 md:grid-cols-2 gap-2">
- <input
- type="text"
- value={parts.username}
- onChange={(e) => update({ username: e.target.value })}
- placeholder={t("config.keys.proxyUsernamePlaceholder")}
- className={inputClass}
- autoComplete="username"
- />
- <input
- type="password"
- value={parts.password}
- onChange={(e) => update({ password: e.target.value })}
- placeholder={t("config.keys.proxyPasswordPlaceholder")}
- className={inputClass}
- autoComplete="current-password"
- />
- </div>
- <p className="text-xs text-text-muted">{t("config.keys.freeSearchProxyUrlPlaceholder")}</p>
- </div>
- );
-}
-
/** 表格列显示用:video_api_base -> api_base,避免与分组标题重复 */
/** i18n 键名映射:字段名 -> 翻译 key(显示名 / placeholder) */
const KEY_DISPLAY_I18N: Record<string, string> = {
- free_search_proxy_url: "config.keys.freeSearchProxyUrl",
memory_forbidden_enabled: "config.keys.memoryForbiddenEnabled",
memory_forbidden_description: "config.keys.memoryForbiddenDescription",
name: "config.keys.agentName",
@@ -429,7 +340,6 @@ const KEY_DISPLAY_I18N: Record<string, string> = {
completion_timeout: "config.keys.agentCompletionTimeout",
};
const KEY_PLACEHOLDER_I18N: Record<string, string> = {
- free_search_proxy_url: "config.keys.freeSearchProxyUrlPlaceholder",
memory_forbidden_description: "config.keys.memoryForbiddenDescriptionPlaceholder",
};
const KEY_LABEL_HINT_I18N: Record<string, string> = {
@@ -442,7 +352,6 @@ const KEY_SORT_PRIORITY: Record<string, number> = {
skill_create: 1,
free_search_ddg_enabled: 0,
free_search_bing_enabled: 1,
- free_search_proxy_url: 2,
memory_forbidden_enabled: 0,
memory_forbidden_description: 1,
model: 0,
@@ -604,22 +513,6 @@ function GroupSection({
</select>
</div>
</div>
- ) : key === "free_search_proxy_url" ? (
- <div className="flex items-center gap-2">
- <span
- className="inline-flex w-3 justify-center shrink-0 font-semibold leading-none select-none text-transparent"
- aria-hidden="true"
- >
- *
- </span>
- <div className="flex-1">
- <ProxyUrlInput
- value={draftValues[key] ?? value}
- onChange={(nextValue) => onChange(key, nextValue)}
- t={t}
- />
- </div>
- </div>
) : (
<div className="flex items-center gap-2">
<span
@@ -2079,6 +1972,7 @@ export function ConfigPanel({
if (!Object.keys(normalizedConfig).length) return [];
const buckets: Record<string, [string, string][]> = {};
for (const [key, value] of Object.entries(normalizedConfig)) {
+ if (HIDDEN_CONFIG_KEYS.has(key)) continue;
const tag = classifyKey(key);
// 临时注释:先隐藏邮件配置,后续需要时可恢复。
if (tag === "email") continue;
diff --git a/jiuwenclaw/web/src/i18n/locales/en.json b/jiuwenclaw/web/src/i18n/locales/en.json
index d5f1afe95c..2540e16198 100644
--- a/jiuwenclaw/web/src/i18n/locales/en.json
+++ b/jiuwenclaw/web/src/i18n/locales/en.json
@@ -407,8 +407,6 @@
"selectModelProvider": "Select a model provider",
"enterValue": "Enter a configuration value",
"keys": {
- "freeSearchProxyUrl": "Proxy URL",
- "freeSearchProxyUrlPlaceholder": "http://username:[email protected]:8080",
"memoryForbiddenEnabled": "Enable",
"memoryForbiddenDescription": "Forbidden memory content description",
"memoryForbiddenDescriptionPlaceholder": "e.g. passwords, API keys, secrets, tokens, credit card numbers, ID numbers, phone numbers",
@@ -487,7 +485,7 @@
"model": { "label": "Model Configuration", "hint": "Model service and authentication settings" },
"embed": { "label": "Embed Configuration", "hint": "Embed service and authentication settings" },
"thirdParty": { "label": "Third-Party Services", "hint": "API key settings" },
- "freeSearch": { "label": "Free Search Engines", "hint": "Enable engines and optional proxy for enterprise intranet" },
+ "freeSearch": { "label": "Free Search Engines", "hint": "Enable free search engines" },
"evolution": { "label": "Evolution Settings", "hint": "Online skill evolution settings" },
"agents": { "label": "Multi-Agent Configuration", "hint": "For cluster mode only" },
"team": { "label": "Team Configuration", "hint": "Multi-agent team settings" },
diff --git a/jiuwenclaw/web/src/i18n/locales/zh.json b/jiuwenclaw/web/src/i18n/locales/zh.json
index 842992405a..cbad0045c2 100644
--- a/jiuwenclaw/web/src/i18n/locales/zh.json
+++ b/jiuwenclaw/web/src/i18n/locales/zh.json
@@ -406,8 +406,6 @@
"selectModelProvider": "请选择模型提供商",
"enterValue": "请输入配置值",
"keys": {
- "freeSearchProxyUrl": "代理地址",
- "freeSearchProxyUrlPlaceholder": "http://username:[email protected]:8080",
"memoryForbiddenEnabled": "启用",
"memoryForbiddenDescription": "禁止记忆内容描述",
"memoryForbiddenDescriptionPlaceholder": "例如:密码、API密钥、Secret、Token、信用卡号、身份证号、手机号等敏感信息",
@@ -486,7 +484,7 @@
"model": { "label": "模型配置", "hint": "模型服务与鉴权参数" },
"embed": { "label": "Embed配置", "hint": "Embed 服务与鉴权参数" },
"thirdParty": { "label": "第三方服务配置", "hint": "API Key 配置" },
- "freeSearch": { "label": "免费搜索引擎配置", "hint": "控制搜索引擎启用和企业内网代理" },
+ "freeSearch": { "label": "免费搜索引擎配置", "hint": "控制免费搜索引擎启用" },
"evolution": { "label": "自演进配置", "hint": "Skills 在线自演进参数" },
"agents": { "label": "多Agent配置", "hint": "仅供集群模式使用" },
"team": { "label": "Team配置", "hint": "多智能体团队配置" },