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(symphony): 修复点击技能管理刷新按钮,技能总谱无法刷新的问题

lin-xiaoyucda164066ba4
diff --git a/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx
index df1a8f8c93..c5ebfc9e58 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/ConfigPanel/index.tsx
@@ -295,13 +295,16 @@ const HIDDEN_CONFIG_KEYS = new Set([
"skill_retrieval_build_equivalence_enabled",
"skill_retrieval_retrieve_compact_codes_enabled",
"skill_retrieval_retrieve_flatten_tree",
+ "skill_retrieval_retrieve_max_exposure_depth",
+ "skill_retrieval_build_max_depth",
+ "skill_retrieval_build_max_workers",
+ "skill_retrieval_build_max_retries",
+ "skill_retrieval_build_total_timeout_seconds",
+ "skill_retrieval_build_classification_batch_limit",
]);
const MEMORY_KEYS = new Set(["memory_forbidden_enabled", "memory_forbidden_description"]);
const A2UI_KEYS = new Set(["a2ui_enabled"]);
const SYMPHONY_BOOLEAN_KEYS = new Set(["symphony_enabled"]);
-const SYMPHONY_KEYS = new Set([
- ...SYMPHONY_BOOLEAN_KEYS,
-]);
const SKILL_RETRIEVAL_BOOLEAN_KEYS = new Set([
"skill_retrieval_enabled",
]);
@@ -309,7 +312,7 @@ const MULTILINE_CONFIG_KEYS = new Set([
"skill_retrieval_build_root_categories",
]);
const SKILL_RETRIEVAL_KEYS = new Set([
- "skill_retrieval_enabled",
+ ...SKILL_RETRIEVAL_BOOLEAN_KEYS,
"skill_retrieval_build_max_depth",
"skill_retrieval_build_max_workers",
"skill_retrieval_build_max_retries",
@@ -317,6 +320,10 @@ const SKILL_RETRIEVAL_KEYS = new Set([
"skill_retrieval_build_classification_batch_limit",
"skill_retrieval_retrieve_max_exposure_depth",
]);
+const SYMPHONY_KEYS = new Set([
+ ...SYMPHONY_BOOLEAN_KEYS,
+ ...SKILL_RETRIEVAL_KEYS,
+]);
function classifyKey(key: string): string {
if (MODEL_DEFAULT_KEYS.has(key)) return "model_default";
@@ -333,7 +340,6 @@ function classifyKey(key: string): string {
if (MEMORY_KEYS.has(key)) return "memory";
if (A2UI_KEYS.has(key)) return "a2ui";
if (SYMPHONY_KEYS.has(key)) return "symphony";
- if (SKILL_RETRIEVAL_KEYS.has(key)) return "skill_retrieval";
if (key === "context_engine_enabled" || key === "kv_cache_affinity_enabled") return "context_engine";
if (key === "permissions_enabled") return "permissions";
if (key.startsWith("feishu")) return "feishu";
@@ -623,7 +629,7 @@ const KEY_SORT_PRIORITY: Record<string, number> = {
free_search_ddg_enabled: 0,
free_search_bing_enabled: 1,
symphony_enabled: 0,
- skill_retrieval_enabled: 0,
+ skill_retrieval_enabled: 1,
skill_retrieval_retrieve_max_exposure_depth: 10,
skill_retrieval_build_max_depth: 20,
skill_retrieval_build_max_workers: 21,
diff --git a/jiuwenswarm/channels/web/frontend/src/components/SkillGraphPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/SkillGraphPanel/index.tsx
index 3ebeeb64cd..2532a2e23f 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/SkillGraphPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/SkillGraphPanel/index.tsx
@@ -1,4 +1,12 @@
-import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
+import {
+ forwardRef,
+ useCallback,
+ useEffect,
+ useImperativeHandle,
+ useMemo,
+ useRef,
+ useState,
+} from 'react';
import {
AlertTriangle,
Focus,
@@ -85,6 +93,14 @@ type SkillGraphStatus = {
llm_token_usage?: LLMTokenUsageSummary;
};
+export type SkillGraphPanelHandle = {
+ refresh: () => boolean;
+};
+
+type SkillGraphPanelProps = {
+ onReadingChange?: (reading: boolean) => void;
+};
+
type GraphNode = {
id: string;
type: string;
@@ -640,7 +656,10 @@ function buildLogSignature(entries?: BuildLogEntry[]): string {
].map((item) => asString(item)).join('|');
}
-export function SkillGraphPanel() {
+export const SkillGraphPanel = forwardRef<SkillGraphPanelHandle, SkillGraphPanelProps>(function SkillGraphPanel(
+ { onReadingChange },
+ ref,
+) {
const { t } = useTranslation();
const canvasRef = useRef<HTMLCanvasElement | null>(null);
const graphRef = useRef<NormalizedGraph>({ nodes: [], edges: [] });
@@ -1315,6 +1334,24 @@ export function SkillGraphPanel() {
const detailOutputs = selectedNode ? asDetailItems(selectedNode.properties.outputs, t('skills.graph.required')) : [];
const detailTasks = selectedNode ? asDetailItems(selectedNode.properties.tasks, t('skills.graph.required')) : [];
+ useImperativeHandle(ref, () => ({
+ refresh: () => {
+ if (isBusy) {
+ return false;
+ }
+ void loadGraph();
+ return true;
+ },
+ }), [isBusy, loadGraph]);
+
+ useEffect(() => {
+ onReadingChange?.(loading);
+ }, [loading, onReadingChange]);
+
+ useEffect(() => () => {
+ onReadingChange?.(false);
+ }, [onReadingChange]);
+
return (
<div className="skill-graph-panel">
<aside className="skill-graph-panel__sidebar">
@@ -1582,4 +1619,4 @@ export function SkillGraphPanel() {
</aside>
</div>
);
-}
+});
diff --git a/jiuwenswarm/channels/web/frontend/src/components/SkillPanel/index.tsx b/jiuwenswarm/channels/web/frontend/src/components/SkillPanel/index.tsx
index de2884c9a1..8f2631cada 100644
--- a/jiuwenswarm/channels/web/frontend/src/components/SkillPanel/index.tsx
+++ b/jiuwenswarm/channels/web/frontend/src/components/SkillPanel/index.tsx
@@ -13,7 +13,7 @@ import { ClawHubSearchModal } from "../../features/ClawHubSearchModal";
import { TeamSkillsHubModal } from "../../features/TeamSkillsHubModal";
import { SkillEvolutionModal } from "../../features/SkillEvolutionModal";
import { normalizeSkillNetUrl } from "../../utils/skillNetUrl";
-import { SkillGraphPanel } from "../SkillGraphPanel";
+import { SkillGraphPanel, type SkillGraphPanelHandle } from "../SkillGraphPanel";
import { Switch } from "../Switch";
/** 刷新会 git pull marketplace,略放宽;普通进页单次 RPC 一般很快。 */
@@ -21,6 +21,7 @@ const SKILLS_FETCH_TIMEOUT_REFRESH_MS = 60_000;
const SKILLS_FETCH_TIMEOUT_NORMAL_MS = 30_000;
const SKILL_RETRIEVAL_RUNNING_POLL_MS = 10_000;
const SKILL_RETRIEVAL_IDLE_POLL_MS = 5 * 60_000;
+const GRAPH_READING_MIN_VISIBLE_MS = 500;
type SkillItem = {
name: string;
@@ -551,6 +552,10 @@ export function SkillPanel({ sessionId, onNavigateToConfig, isActive = false }:
const retrievalPollRef = useRef<number | null>(null);
const retrievalDiscoveryPollRef = useRef<number | null>(null);
const retrievalStatusRequestRef = useRef(0);
+ const skillGraphPanelRef = useRef<SkillGraphPanelHandle | null>(null);
+ const graphReadingStartedAtRef = useRef<number | null>(null);
+ const graphReadingTimerRef = useRef<number | null>(null);
+ const [graphReading, setGraphReading] = useState(false);
const [viewMode, setViewMode] = useState<"list" | "grid">("list");
const [retrievalStatus, setRetrievalStatus] = useState<SkillRetrievalStatus | null>(null);
const [retrievalTree, setRetrievalTree] = useState("");
@@ -573,9 +578,36 @@ export function SkillPanel({ sessionId, onNavigateToConfig, isActive = false }:
if (retrievalDiscoveryPollRef.current !== null) {
window.clearInterval(retrievalDiscoveryPollRef.current);
}
+ if (graphReadingTimerRef.current !== null) {
+ window.clearTimeout(graphReadingTimerRef.current);
+ }
};
}, []);
+ const updateGraphReading = useCallback((reading: boolean) => {
+ if (graphReadingTimerRef.current !== null) {
+ window.clearTimeout(graphReadingTimerRef.current);
+ graphReadingTimerRef.current = null;
+ }
+ if (reading) {
+ graphReadingStartedAtRef.current = Date.now();
+ setGraphReading(true);
+ return;
+ }
+ const startedAt = graphReadingStartedAtRef.current;
+ graphReadingStartedAtRef.current = null;
+ const elapsed = startedAt == null ? GRAPH_READING_MIN_VISIBLE_MS : Date.now() - startedAt;
+ const delay = Math.max(0, GRAPH_READING_MIN_VISIBLE_MS - elapsed);
+ if (delay === 0) {
+ setGraphReading(false);
+ return;
+ }
+ graphReadingTimerRef.current = window.setTimeout(() => {
+ graphReadingTimerRef.current = null;
+ setGraphReading(false);
+ }, delay);
+ }, []);
+
useEffect(() => {
if (searchDebounceRef.current !== null) {
window.clearTimeout(searchDebounceRef.current);
@@ -1432,6 +1464,11 @@ export function SkillPanel({ sessionId, onNavigateToConfig, isActive = false }:
if (activeTab === "index") {
void fetchRetrievalStatus();
void fetchRetrievalTree();
+ } else if (activeTab === "graph") {
+ const started = skillGraphPanelRef.current?.refresh() ?? false;
+ if (started) {
+ updateGraphReading(true);
+ }
} else if (activeTab === "my" || (activeTab === "marketplace" && marketplaceSubTab === "builtin")) {
setSearch("");
fetchSkills(true);
@@ -1439,12 +1476,17 @@ export function SkillPanel({ sessionId, onNavigateToConfig, isActive = false }:
setSearchTrigger((prev) => prev + 1);
}
}}
- className="flex items-center gap-1.5 px-1 py-1.5 rounded-lg text-sm text-text-muted hover:text-text hover:bg-secondary/50 transition-colors"
+ className={`flex items-center gap-1.5 px-1 py-1.5 rounded-lg text-sm text-text-muted transition-colors ${
+ activeTab === "graph" && graphReading
+ ? "cursor-not-allowed opacity-70"
+ : "hover:text-text hover:bg-secondary/50"
+ }`}
+ disabled={activeTab === "graph" && graphReading}
>
- <svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth={1.5}>
+ <svg className={`w-4 h-4 ${activeTab === "graph" && graphReading ? "animate-spin" : ""}`} fill="none" stroke="currentColor" viewBox="0 0 24 24" strokeWidth={1.5}>
<path strokeLinecap="round" strokeLinejoin="round" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
</svg>
- {t('common.refresh')}
+ {activeTab === "graph" && graphReading ? "正在读取技能总谱" : t('common.refresh')}
</button>
<button
onClick={handleImportLocal}
@@ -1753,7 +1795,7 @@ export function SkillPanel({ sessionId, onNavigateToConfig, isActive = false }:
{activeTab === "graph" ? (
<div className="mt-4 flex-1 min-h-0">
- <SkillGraphPanel />
+ <SkillGraphPanel ref={skillGraphPanelRef} onReadingChange={updateGraphReading} />
</div>
) : null}
diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
index 43223d6453..076857e1b0 100644
--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/en.json
@@ -691,7 +691,7 @@
"teamMemberPersona": "Persona",
"teamMemberPromptHint": "Prompt Hint",
"teamMemberAgentKey": "Agent Key",
- "symphonyEnabled": "Enable Skill Symphony",
+ "symphonyEnabled": "Enable skill orchestration",
"skillRetrievalEnabled": "Enable skill retrieval",
"skillRetrievalBuildBranchingFactor": "Split threshold base",
"skillRetrievalBuildMaxDepth": "Max tree depth",
@@ -800,8 +800,8 @@
"contextEngine": { "label": "Context Compression", "hint": "Enable or disable dialogue context compression" },
"permissions": { "label": "Tool Safety Guardrail", "hint": "Enable or disable permission checks for tool calls" },
"a2ui": { "label": "A2UI", "hint": "Enable or disable generated UI rendering and A2UI runtime prompts." },
- "symphony": { "label": "Skill Symphony", "hint": "Master switch for Skill Symphony orchestration" },
- "skillRetrieval": { "label": "Agentic Skill Retrieval", "hint": "Agentic skill retrieval for larger sets of installed skills" },
+ "symphony": { "label": "Skill Symphony", "hint": "Control Skill Symphony" },
+ "skillRetrieval": { "label": "Skill Symphony", "hint": "Control Skill Symphony" },
"memory": { "label": "Memory Sensitive Info Filter", "hint": "Configure sensitive content types forbidden from memory" },
"email": { "label": "Email Settings", "hint": "Email account and token settings" },
"other": { "label": "Other Settings", "hint": "Unclassified extended parameters" }
diff --git a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
index 9c790f718a..f7da360142 100644
--- a/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
+++ b/jiuwenswarm/channels/web/frontend/src/i18n/locales/zh.json
@@ -690,7 +690,7 @@
"teamMemberPersona": "人设",
"teamMemberPromptHint": "提示词",
"teamMemberAgentKey": "Agent Key",
- "symphonyEnabled": "启用技能交响乐",
+ "symphonyEnabled": "启用技能编排",
"skillRetrievalEnabled": "启用技能检索",
"skillRetrievalBuildBranchingFactor": "拆分阈值基数",
"skillRetrievalBuildMaxDepth": "最大树深",
@@ -799,8 +799,8 @@
"contextEngine": { "label": "上下文压缩", "hint": "控制对话上下文是否启用压缩" },
"permissions": { "label": "工具安全护栏", "hint": "控制工具调用时的权限检查" },
"a2ui": { "label": "A2UI", "hint": "开启或关闭生成式界面渲染与 A2UI 运行时提示词" },
- "symphony": { "label": "技能交响乐", "hint": "控制技能交响乐编排能力总开关" },
- "skillRetrieval": { "label": "Agentic技能检索", "hint": "适用于较大规模已安装技能场景下的 Agentic 技能检索" },
+ "symphony": { "label": "技能交响乐", "hint": "控制技能交响乐" },
+ "skillRetrieval": { "label": "技能交响乐", "hint": "控制技能交响乐" },
"memory": { "label": "记忆系统敏感信息过滤", "hint": "配置禁止写入记忆的敏感信息类型" },
"email": { "label": "邮箱配置", "hint": "邮件账号与令牌参数" },
"other": { "label": "其他配置", "hint": "未归类的扩展参数" }
diff --git a/jiuwenswarm/resources/config.yaml b/jiuwenswarm/resources/config.yaml
index e38f829397..91c28435d8 100644
--- a/jiuwenswarm/resources/config.yaml
+++ b/jiuwenswarm/resources/config.yaml
@@ -34,7 +34,7 @@ symphony:
build:
workers: 4
batch_size: 16
- require_consensus: true
+ require_consensus: false
min_edge_confidence: 0.1
orchestration:
diff --git a/jiuwenswarm/symphony/config.py b/jiuwenswarm/symphony/config.py
index 9d7121f82a..db790f458b 100644
--- a/jiuwenswarm/symphony/config.py
+++ b/jiuwenswarm/symphony/config.py
@@ -21,7 +21,7 @@ DEFAULT_FINGERPRINT_NORMALIZATION_MAX_VOCAB_SIZE = None
DEFAULT_BUILD_WORKERS = 1
DEFAULT_BUILD_MATCHER_BATCH_SIZE = 12
-DEFAULT_BUILD_REQUIRE_CONSENSUS = True
+DEFAULT_BUILD_REQUIRE_CONSENSUS = False
DEFAULT_BUILD_MIN_EDGE_CONFIDENCE = 0.7
DEFAULT_SYMPHONY_ENABLED = False