企业任务端到端主路径
整站先看
site-runtime;一条任务人话见enterprise-tour-narrative。本主题保留完整时序与 fail/ok 对偶,供深挖,不作首页。
一条主路径怎样走完
Desktop Main 经 prepareEnterpriseChatInput 组装 chat 输入并由统一 Work IPC 提交(createEnterpriseAgentLoopStream 已删除)(本机能力广告、可选 Plugin 投影、Local File 附件),POST /api/chat。Gateway createChatRoutes 做校验与会话绑定后,进入 OrchestratorRuntime.resolveAndRun:prepareExecution 不调模型,再 composeDeps 装配本轮 OrchestratorDeps,最后 orchestrate 进入模型循环。
工具分发经 ExecutionHostRouter(advertise / dispatch / reconcile / cancel)落到 Server、Local File、Plugin 或 Local Executor。需要用户输入时由 InteractionKernel.create 挂起;settle 校验 actor / answer 后写结算;continuation 再 resolveAndRun。Run 事实写回 agent_runs / 事件投影,Desktop 只观察与续传,不持有服务端 SoT。
失败 / 重试
- Router
dispatch对同 callId+bindingDigest 做 singleflight;已有 handle 且possibly_sent时先reconcile,禁止盲重试。 - 上下文 digest 不一致或 catalog 未解析 →
unsupported,不伪造成功。 - Interaction
settle:无记录 →not_found;策略禁行 →forbidden;结构/领域无效 → reject(actor_policy_stale/invalid_answer)。 - Desktop 断线只影响回执投递;服务端 SoT 与 lease 仍由 Agent 持有(见
state-authority)。
归属边与非目标
- Owner:Gateway 会话绑定 + OrchestratorRuntime;工具宿主由 ExecutionHostBinding 锁定。
- 非目标:不在本主题画 Admin 配置面、不展开各宿主内部 OCR/脚本细节(见
local-file-v5/local-executor/vertical-plugin-mount)。 - 相关:
control-plane、interaction-lifecycle、ledger-authority、state-authority、cold-paths、vertical-plugin-mount。
视图
-
main— 主路径时序(受理 → 模型/工具 → 交互与账本)。 -
tool-branch— LF / Plugin / LE 分叉 + Interaction settle/resume。 -
fail-host— 工具宿主 fail/timeout(Interaction 前)。 -
fail-ix— Interaction 取消/过期/结算失败 → resume 分叉。 -
fail-lease-mid— Run lease 中途丢失与 singleflight 冲突。 -
ok-host— 工具宿主成功完成(对偶fail-host)。 -
ok-ix— Interaction settle→resume(对偶fail-ix)。 -
ok-lease-mid— lease 持有全程并释放(对偶fail-lease-mid)。
成功对偶(与失败链入口相同)
- ok-host:
dispatch→kind=completed→delivery=completed+ terminalResult → Desktop SSE 成功。 - ok-ix:合法 settle → accepted+resolved → resume event → continuation。
- ok-lease-mid:
acquireLease→renewLease→ 工具完成 →releaseLease。
失败链(深挖)
- fail-host:
dispatchSingleflightcatch →possibly_sent|not_sent;host_unavailable/reconcile_needed;禁盲重试;IX 未创建。 - fail-ix:
expireDue/requestTaskCancellation/settle→ terminal;not_found|forbidden|rejected;仅 accepted+resolved 带 resume。 - fail-lease-mid:
RUN_LEASE_LOST/RUN_LEASE_BUSY;同 callId inflight → reconcile。
路由决策归分类器(ADR-0092,钉点 e2adc9a3c325)
-
选能力(
primaryCapabilityId与 high 候选)只能来自分类器的结构化理解,或经过校验的结构化状态(UI 显式选择、已接受的澄清、自有待办等);分类之后的确定性阶段只能否决、收窄或补参数,不得改 primary、加候选、提置信度或绕过分类器。续接改由分类器读结构化状态判断;常态一次分类、最多一次登记过的补充判断,失败返回可重试错误;评测原句不得进生产代码,评测拆 dev / holdout。 -
状态 Accepted;本钉点完成 knowledge/workforce/analytics、recruit、vms 迁移与跨族规则清零(STA-92 迁移 4/4)。续接统一读主分类
continuation_relation(prepareRouteContinuation/applyRouteContinuation);ADR 点名措辞续接函数已从 routing 删除;router.ts拆为routing/router/*。遗留utteranceRefersBack仅服务 child Decision(不在本 ADR)。见视图route-continuation。 -
证据:
aida-agent·docs/adr/0092-routing-decision-belongs-to-the-classifier.mdL22–47 ·选能力的只有两类来源·e2adc9a3c325;aida-agent·packages/agent/src/routing/router.tsL1–39 ·prepareRouteContinuation·e2adc9a3c325;aida-agent·packages/agent/src/routing/router/continuation.tsL34–53 ·applyRouteContinuation·e2adc9a3c325 -
本轮补记:措辞续接已退役;续接只保留分类器
continuation_relation一处。 -
逐提交判定(
d4f252c559a8..e2adc9a3c325,19 个 routing / llm-classifier 修复):没有一处用用户原文的正则或短语设定 primary、注入候选、抬高置信度或替代分类器。新增的确定性代码只做否决 / 收窄 / 补参数,或只决定要不要花一次语义复核:candidate-query-reference只在分类器已选recruit.query且有本轮目标证据时从工作焦点补applicationId(bf42be8d7);personal_skill由分类器判定,router 只去掉文件目标(28a6ec920);next_step_guidance只在证据逐字来自本轮、目标与分类器一致时放行,否则只澄清(e76845124);scoped my_work 要经已登记的business_request_check复读,复读认定是业务请求时交回业务路由(f5222c010);1d07cf06a/efd2255b4把 HR 档案等垂直触发条件搬进classifier-review-contracts,行为不变。证据:aida-agent·packages/agent/src/routing/verticals/candidate-query-reference.tsL19–41 ·prepareCandidateQueryReference·e2adc9a3c325;aida-agent·packages/agent/src/routing/router.tsL2124–2128 ·personalSkillManagement·e2adc9a3c325;aida-agent·packages/agent/src/routing/meta-intent.tsL157–181 ·nextStepGuidanceNeedsClarification·e2adc9a3c325;aida-agent·packages/agent/src/routing/router.tsL1521–1566 ·scopedMyWorkReread·e2adc9a3c325;aida-agent·packages/agent/src/routing/verticals/classifier-review-contracts.tsL93–115 ·needsInvalidSourceReadReview·e2adc9a3c325 -
第 4 条灰区(需 ADR owner 判断):①
3791ee5f4在主分类内部加了reviewAllFileTargets,多一次语义调用,只能清空fileTargetIds,不在RouteLlmPass登记表里,计量算在主分类下;②b9ce82c11对考勤填报缺日期 / 工时的写入,借已登记的missing_input_reread通道改跑目标复核,结果可改 primary(与补参数是 if / else,不多花调用,但通道名与用途不符);③nextStepGuideActions在只缺vms.employee_lifecycle时固定推荐已授权的 HR 只读能力作快捷入口,不改 primary。证据:aida-agent·packages/agent/src/routing/llm-classifier.tsL152–166 ·reviewAllFileTargets·e2adc9a3c325;aida-agent·packages/agent/src/routing/router.tsL395–411 ·RouteLlmPass·e2adc9a3c325;aida-agent·packages/agent/src/routing/router.tsL1977–1999 ·missing_input_reread·e2adc9a3c325;aida-agent·packages/agent/src/routing/verticals/guide-domain-labels.tsL9–15 ·nextStepGuideActions·e2adc9a3c325
reply_user:执行中途对用户说话(钉点 e2adc9a3c325)
- 新增内部工具
reply_user({ text, kind })(kind 为 progress / answer):前台轮次中途给当前用户发一条助手消息。消息 id 由 run + toolCallId 派生,重试不会多发;入参先过长度上限(2000 字)、内部标识脱敏和数字溯源,不通过就什么都不写,让模型重写。 - 默认关:只有 agent 级
contextPolicy.replyUserEnabled = true才挂载;旁路查询、子 run、后台 run 不挂载。是否有 agent 在用未核实。 - 发布成功后发
reply_user_message事件进 run 事件流;chat SSE ledger 视为关键事件立即落账、可补读,不并进response正文。Desktop 侧展示见desktop-client。
证据与范围
-
aida-desktop·apps/desktop/electron/agent-loop/enterprise-adapter.tsL65–123 ·prepareEnterpriseChatInput·4346d79eb364 -
aida-agent·packages/agent/src/gateway/chat-routes.tsL255–266 ·createChatRoutes·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/orchestrator-runtime.tsL372–379 ·resolveAndRun·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/orchestrator-runtime.tsL283–313 ·composeDeps·e2adc9a3c325 -
aida-agent·packages/agent/src/execution-host/router.tsL50–80 ·ExecutionHostRouter·e2adc9a3c325 -
aida-agent·packages/agent/src/execution-host/router.tsL95–125 ·dispatch·e2adc9a3c325 -
aida-agent·packages/agent/src/interaction-kernel/kernel.tsL226–258 ·InteractionKernel·e2adc9a3c325 -
aida-agent·packages/agent/src/interaction-kernel/kernel.tsL776–811 ·settle·e2adc9a3c325 -
aida-agent·packages/agent/src/execution-host/router.tsL129–159 ·dispatchSingleflight·e2adc9a3c325 -
aida-agent·packages/agent/src/execution-host/host-support.tsL41–53 ·unavailableExecution·e2adc9a3c325 -
aida-agent·packages/agent/src/interaction-kernel/kernel.tsL600–634 ·requestTaskCancellation/expireDue·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/unified-entry.tsL2660–2682 ·RUN_LEASE_LOST·e2adc9a3c325 -
aida-agent·packages/agent/src/gateway/unified-entry.tsL1948–1978 ·RUN_LEASE_BUSY·e2adc9a3c325 -
aida-agent·packages/agent/src/execution-host/router.tsL129–159 ·dispatchSingleflight·e2adc9a3c325 -
aida-agent·packages/agent/src/interaction-kernel/kernel.tsL587–617 ·buildInteractionResumeEvent·e2adc9a3c325 -
aida-agent·packages/agent/src/session/run-store.tsL693–728 ·renewLease/releaseLease·e2adc9a3c325
结论来自固定版本的静态源码与合同阅读;实现存在、默认开关和生产启用分别判断。本站代码证据面板列出声明状态与具体限制。
aida-agent·packages/agent/src/orchestrator/reply-user.tsL1–16 ·replyUserEnabled·e2adc9a3c325aida-agent·packages/agent/src/gateway/orchestrator-runtime.tsL302–305 ·replyUserEnabled·e2adc9a3c325aida-agent·packages/agent/src/shared/types.tsL147–156 ·reply_user_message·e2adc9a3c325aida-agent·packages/agent/src/runtime/stream/chat-sse-ledger.tsL107–115 ·reply_user_message·e2adc9a3c325
ADR-0097 / 0098(钉点 e2adc9a3c325)
-
ADR-0097(Proposed):非 VMS / 零业务订购租户的统一入口只识别已订购产品。D1-2a 已合入:
listCapabilitiesForTenant(..., { forRouting: true })在hasVerifiedNoBusinessScope时跳过 Pack 装配,只保留本地与 Plugin 候选(unified-entryfresh 目录同此)。D1-2b(未开通呈现)与 D2(显式 none Pack 选择)暂缓。 -
ADR-0098(方向 Accepted / 实施待批):待办卡可回访、确认时重校验;取代「等待卡锁死前台、其它请求只能旁路」模型。STA-193 止血已合入(只读旁问优先;未接入回访合同的等待前台 Root 仍按既有 supersede 规则收口,不是新增 parked 归属);其余 DDL、队列与生产者接入须另批。视图
entitled-local-catalog只画 D1-2a 已合入路径。 -
产品口径旁挂:MSP ≠ 单纯多租户;
entitled-local-catalog现状卡片「桌面本机」仅指本机路径(在线企业交付),勿读成 MSP 定义。产品叙事见product-narrative(2026-10-29)。
Agent 最新增量:条件产物(2026-10-29)
条件产物目标先在受理时冻结,再由原 Plugin 请求/回执与文件读取事实证明,完成前复核;本次不满足导出条件时应说明未导出,而非捏造 Artifact。另一个独立变化是已选 Skill 的非文件目标:只有原目标没有文件意图、独立目标复核的 action/object 与原判断一致时才能接受,不得把原文件目标偷偷改成非文件。
aida-agent·packages/agent/src/gateway/workbench-route-preparation.tsL118–125 ·7f2e519936b5aida-agent·packages/agent/src/routing/classifier-current-target-review.tsL42–69 ·7f2e519936b5