Remove engine-level LLM config — each adapter owns its own LLM #143

Open
opened 2026-06-07 04:40:48 +00:00 by xiaomo · 0 comments
Owner

Background

PR #142 (ThreadReactor) 让 agent 自己追加轮次修 frontmatter,extract() LLM 回退已经是死代码。

Moderator (evaluate.ts) 从来就是纯函数(读 $status → 查 graph → Mustache 渲染),不用 LLM。

uwf setup 配的 LLM 唯一消费方是 builtin agent,但 adapter 应该自己独立配置 LLM,engine 层不该碰 LLM。

要清理的东西

  1. workflow-util-agent/src/extract.ts — 整个删掉(死代码,createAgent() 已不调用)
  2. cli-workflow/src/commands/setup.ts — 去掉 provider / apiKey / model 交互流程
  3. config.yaml schema — 移除 providers / models / defaultModel 字段
  4. WorkflowConfig 类型 (workflow-protocol/src/types.ts) — 移除 LLM 相关字段
  5. workflow-agent-builtinloadWorkflowConfigresolveModel 改成 builtin agent 自己读自己的配置(独立于 engine config)
  6. workflow-util-agent/src/index.ts — 移除 extract / ExtractResult / ResolvedLlmProvider 的 re-export

设计原则

  • Engine 层只负责:graph 路由(moderator)、CAS 存取、agent 生命周期
  • LLM 配置下沉到各 adapter 自行管理
  • uwf setup 简化为只配 storage root + default agent
## Background PR #142 (ThreadReactor) 让 agent 自己追加轮次修 frontmatter,`extract()` LLM 回退已经是死代码。 Moderator (`evaluate.ts`) 从来就是纯函数(读 `$status` → 查 graph → Mustache 渲染),不用 LLM。 `uwf setup` 配的 LLM 唯一消费方是 builtin agent,但 adapter 应该自己独立配置 LLM,engine 层不该碰 LLM。 ## 要清理的东西 1. **`workflow-util-agent/src/extract.ts`** — 整个删掉(死代码,`createAgent()` 已不调用) 2. **`cli-workflow/src/commands/setup.ts`** — 去掉 provider / apiKey / model 交互流程 3. **`config.yaml` schema** — 移除 `providers` / `models` / `defaultModel` 字段 4. **`WorkflowConfig` 类型** (`workflow-protocol/src/types.ts`) — 移除 LLM 相关字段 5. **`workflow-agent-builtin`** — `loadWorkflowConfig` → `resolveModel` 改成 builtin agent 自己读自己的配置(独立于 engine config) 6. **`workflow-util-agent/src/index.ts`** — 移除 `extract` / `ExtractResult` / `ResolvedLlmProvider` 的 re-export ## 设计原则 - Engine 层只负责:graph 路由(moderator)、CAS 存取、agent 生命周期 - LLM 配置下沉到各 adapter 自行管理 - `uwf setup` 简化为只配 storage root + default agent
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shazhou/united-workforce#143