mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-09 15:26:03 +00:00
refactor(agent-runner): make agent binding and auth snapshot explicit
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
|
||||
**本分支目标:AgentRunner 外化 / 插件化基础设施**
|
||||
|
||||
本分支只做 LangBot 作为 Agent Host 的基础能力建设:
|
||||
本分支只做 LangBot 作为 Agent Host 的基础能力建设,为后续用 `Agent`
|
||||
替代 Pipeline 承载 agent 配置打底:
|
||||
|
||||
- LangBot 与 SDK 的稳定协议合同(Protocol v1)
|
||||
- Host-side `AgentEventEnvelope` / `AgentBinding` 模型
|
||||
@@ -35,6 +36,22 @@
|
||||
|
||||
EventGateway 在本文档中描述为 **future integration point**,由外部 event branch 提供。本分支只定义 host-side envelope/binding models 和 `run(event, binding)` orchestrator 入口。
|
||||
|
||||
## 目标产品模型
|
||||
|
||||
未来产品层应把 `Agent` 理解为 Pipeline 的替代物:原先 bot 绑定
|
||||
Pipeline,Pipeline 携带 agent/provider/RAG/tool 等配置;后续应改为 bot 或
|
||||
IM channel 绑定一个 Agent,Agent 携带 runner id、runner config、
|
||||
resource/state/delivery policy 等 agent 配置。
|
||||
|
||||
约束:
|
||||
|
||||
- 一个 bot / IM channel 在同一时间只绑定一个负责 agentic 处理的 Agent。
|
||||
- 一个 Agent 可以被多个 bot / channel 复用,类似旧 Pipeline 可被多个 bot 共享。
|
||||
- Agent 配置是运行绑定配置,不是插件实例状态;多个 Agent 指向同一
|
||||
AgentRunner 时不创建多个插件实例。
|
||||
- 当前 Pipeline path 只是迁移期入口 adapter:它把旧 Pipeline 配置投影为临时
|
||||
`AgentBinding`,不代表目标架构仍由 Pipeline 承载 agent 语义。
|
||||
|
||||
## 当前状态
|
||||
|
||||
**当前 Pipeline 是入口 adapter,不再是 agent runner 设计核心。**
|
||||
@@ -65,7 +82,7 @@ EventGateway 在本文档中描述为 **future integration point**,由外部 e
|
||||
|
||||
- LangBot 与 SDK 的稳定协议合同
|
||||
- runner manifest / descriptor / registry
|
||||
- agent binding 与配置解析
|
||||
- Agent / binding 配置解析
|
||||
- run orchestration 和生命周期管理
|
||||
- resource authorization 与 `run_id` 级权限校验
|
||||
- host-owned state / storage / event log / transcript / artifact 能力
|
||||
@@ -87,6 +104,10 @@ Host 不定义通用历史窗口字段或策略;runner 通过 Host pull API
|
||||
|
||||
消息只是事件的一种。后续 `message.received`、`message.recalled`、`group.member_joined`、`friend.request_received` 等事件都应能通过统一事件 envelope 触发 AgentRunner。
|
||||
|
||||
EBA 主线按单 Agent 调度设计:EventRouter 对一个 bot / channel / scope
|
||||
解析出一个有效 AgentBinding,再调用一次 `AgentRunOrchestrator.run(event,
|
||||
binding)`。多 agent fan-out、observer agent 或并行裁决不属于当前目标语义。
|
||||
|
||||
**本分支不实现 EBA 完整能力,只预留:**
|
||||
- event-first envelope (`AgentEventEnvelope`)
|
||||
- AgentBinding model
|
||||
@@ -116,9 +137,11 @@ Host 不定义通用历史窗口字段或策略;runner 通过 Host pull API
|
||||
|
||||
- 一个插件可以声明多个 `AgentRunner` 组件,每个组件独立暴露 manifest、配置 schema、能力和权限。
|
||||
- 插件本身按单实例、无状态执行单元理解;不同绑定不创建多个插件实例。
|
||||
- 绑定只保存 runner id 和绑定配置,不代表插件实例状态。
|
||||
- Agent / binding 只保存 runner id 和绑定配置,不代表插件实例状态。
|
||||
- bot / IM channel 绑定一个 Agent;Agent 可被多个 bot / channel 复用。
|
||||
- LangBot 可以提供 host-owned state / storage 能力,让 runner 把状态寄宿在 LangBot;但这应该是授权能力,不是强制要求。
|
||||
- 官方 runner 插件是协议消费者,不是协议设计的优先约束。
|
||||
- Pipeline 是当前入口 adapter,不是未来架构中心。
|
||||
- Event dispatch 主线是 one event -> one AgentBinding -> one run_id -> one runner。
|
||||
- EventGateway 是 future integration point,由外部 event branch 提供。
|
||||
- Runtime control plane 是 v2 Host capability layer,不阻塞当前 AgentRunner v1 主线;agent 管控面插件应构建在该 Host 能力层之上。
|
||||
|
||||
Reference in New Issue
Block a user