feat(ai写作): 素材收集专家按真实智能体运行时跑技能 + 步骤条对齐

- 新增 run_skill_via_real_agent:复用 SubagentExecutor(与 lead agent / 子智能体
  同一套运行时),加载技能 SKILL.md + 全套工具 + 懒加载沙箱,让技能的真实检索逻辑
  (读文件 / 调内网接口 / MCP)真正执行,再按 JSON 契约收割结构化素材;researcher 的
  _execute_skill 在 researcher_skill_agent 开启时切到它,失败/空结果回退直连检索。
  解决内网技能(在别的智能体里好使)在 AI 写作里检不出东西的问题。
- 步骤条轻量对齐别的智能体:技能调用拆成「读取 SKILL.md → 执行检索 → 检索到 N 条」
  三段(前两段新增,结果段沿用 skill_result);前端 SkillStepsCard 零改动。
- 含 roundtable-planning(业务链选择 / Step2 编排)的进行中改动。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
fengxiangdebaoziandClaude Opus 4.8 committed 2026-06-24 22:19:30 +08:00
1 parent 1a127ef602
commit afb78a6943
6 files changed
+164 -17

No files matched your search

@@ -140,7 +140,7 @@ export function BusinessChainPicker({
const hasCoord = (plan.coordinatorPrompt?.trim() ?? "") !== "";
return hasParallel || hasGoal || hasCoord ? plan : null;
}, [selectedChain, survivingSeats]);
const [dagExecMode, setDagExecMode] = useState<"fast" | "sandbox">("fast");
const [dagExecMode, setDagExecMode] = useState<"fast" | "sandbox">("sandbox");
const handleUse = () => {
if (!canUse || !selectedChain) return;
@@ -460,7 +460,7 @@ export function useStep2Orchestration(
gatherFirst = false,
orchestrationMode,
orchestrationPlan,
dagExecMode = "fast",
dagExecMode = "sandbox",
buildInitialIntent,
triggerToast,
setRoles,
@@ -192,7 +192,7 @@ export function buildChainSeatSelection(
const agents = plan.stages
.flatMap((st) => st.agentIds)
.map((id) => ({ agent_id: id, name: nameOf(id), model: modelOf(id), seat_skill_directive: skillOf(id), seatMode: seatModeOf(id) }));
return { agents, mode: "dag", chain: chainMeta, plan, dagExecMode: "fast", seatMode: chain.seatMode, gatherFirst: chain.gatherFirst ?? false };
return { agents, mode: "dag", chain: chainMeta, plan, dagExecMode: "sandbox", seatMode: chain.seatMode, gatherFirst: chain.gatherFirst ?? false };
}
}
@@ -360,7 +360,7 @@ export default function RoundtablePlanningPage() {
const [orchestrationPlan, setOrchestrationPlan] = useState<OrchestrationPlan | null>(null);
// dag 执行子模式:fast(并行双列禁写)/ sandbox(并行单列可写、沙箱跟随)。
// 由推荐弹窗的「执行方式」选择决定(仅 dag 有意义)。
const [dagExecMode, setDagExecMode] = useState<"fast" | "sandbox">("fast");
const [dagExecMode, setDagExecMode] = useState<"fast" | "sandbox">("sandbox");
const [step2SidebarExpanded, setStep2SidebarExpanded] = useState(true);
const [step2Runs, setStep2Runs] = useState<DraftStep2RunSnapshot[]>([]);
const [activeStep2RunId, setActiveStep2RunId] = useState<string | null>(null);
@@ -684,7 +684,7 @@ export default function RoundtablePlanningPage() {
setOrchestrationMode(run.orchestrationMode ?? "recommend");
setChainMeta(run.chain ?? null);
setOrchestrationPlan(run.orchestrationPlan ?? null);
setDagExecMode(run.dagExecMode ?? "fast");
setDagExecMode(run.dagExecMode ?? "sandbox");
setStep3Report(run.step3 ?? null);
step2.hydrateFromDraft(run as unknown as Step2Snapshot);
markRestoredConsensusAsEmitted(Boolean(run.hasConsensus));
@@ -791,7 +791,7 @@ export default function RoundtablePlanningPage() {
setOrchestrationMode(snapshot.orchestrationMode ?? "recommend");
setChainMeta(snapshot.chain ?? null);
setOrchestrationPlan(snapshot.orchestrationPlan ?? null);
setDagExecMode(snapshot.dagExecMode ?? "fast");
setDagExecMode(snapshot.dagExecMode ?? "sandbox");
step2.hydrateFromDraft(snapshot as unknown as Step2Snapshot);
markRestoredConsensusAsEmitted(Boolean(snapshot.hasConsensus));
},
@@ -945,7 +945,7 @@ export default function RoundtablePlanningPage() {
// chain / dag 都来自业务链条,保留来源链名;recommend 无。
chain: result.mode === "recommend" ? null : result.chain ?? null,
orchestrationPlan: result.mode === "dag" ? result.plan ?? null : null,
dagExecMode: result.mode === "dag" ? result.dagExecMode ?? "fast" : undefined,
dagExecMode: result.mode === "dag" ? result.dagExecMode ?? "sandbox" : undefined,
step3: null,
};
setStep2Runs([...syncedRuns, newRun]);
@@ -998,7 +998,7 @@ export default function RoundtablePlanningPage() {
setGatherFirst(result.gatherFirst ?? false);
setChainMeta(result.mode === "recommend" ? null : result.chain ?? null);
setOrchestrationPlan(result.mode === "dag" ? result.plan ?? null : null);
setDagExecMode(result.mode === "dag" ? result.dagExecMode ?? "fast" : "fast");
setDagExecMode(result.mode === "dag" ? result.dagExecMode ?? "sandbox" : "sandbox");
setIsRecommendDialogOpen(false);
setCurrentStep(2);
triggerToast(
@@ -1527,7 +1527,7 @@ export default function RoundtablePlanningPage() {
setOrchestrationMode("recommend");
setChainMeta(null);
setOrchestrationPlan(null);
setDagExecMode("fast");
setDagExecMode("sandbox");
setStep3Report(null);
// 停掉页面层的 Step3 三个生成流(新任务不该带着旧任务的流跑)+ 复位进入闸门,
// 并停止后台作业实时跟随(作业本身继续在后台跑)。