Flynor平台文档Flynor 首页
Flynor 文档/COMPONENT · EXECUTION
草案

Agent Adapter

统一 Claude Code CLI、Codex CLI、Cursor、Devin 与现有 Agent 后端的启动、续跑、取消、状态、会话恢复和工具注入。可执行 Facade 已承接 Robot Worker 中 9 个 Codex/Claude/Cursor 主链、恢复与 fallback 调用点、Project Intelligence 只读 Cursor 专家、Evolution Codex,以及 Tech Codex 的 Codex/Claude/Devin Router;原 Provider 选择、Runner 参数、会话续跑、取消、超时和错误类型保持不变。PI Expert 的 Cursor Agent Run 已精确绑定签名任务;Robot 的可选签名投影只签认本次 Runner 实际注入且同时被 Task/Lease 允许的成熟 MCP/Claude CLI 与内建 workspace read/write/shell 候选,bundled Choerodon MCP 已进一步执行逐调用门禁并在 Agent 结束后清理短期 context。公开 query/continue、Session hash 恢复映射、持久元数据 Run/工具审计和脱敏 Provider probe 已完成。固定 Codex/Claude/Cursor/Devin Provider 契约和重启边界已有 devbox deployed-contract;任意第三方 MCP/其他 CLI/Agent 自行启动命令的事务性调用前 gateway 仍待完成;model-runtime-connector 仅保留为兼容 ID。

展示名称Agent 适配器
类型agent-adapter
成熟度试点
OwnerAI 运维组
01

职责与边界

负责

  • 统一 start、continue、cancel、status 与结构化 Run/Session 事件
  • 屏蔽 Codex、Claude、Cursor、本地模型和其他 Agent Runtime 差异
  • 计算任务所需能力 ∩ Capability Lease ∩ Runtime 支持能力并生成工具投影
  • 管理认证、额度、网络、超时和 Provider 故障分类

不负责

  • 不决定任务目标、能力授权或业务结论
  • 不保存项目资源凭据
  • 不把未授权工具暴露给 Agent
  • 不绕过 Resource Tool Adapter 对每次工具调用的重新校验
02

数据与接口

拥有的数据

  • Agent Run/Session 引用、运行事件与脱敏用量;原生会话正文遵循宿主策略

输入

Agent Run Request;用户显式 Runtime 选择;受限工具投影;Runtime 凭据引用

输出

Agent Run 状态;增量事件;会话引用;结构化结果与错误

协议

目标 flynor/agent-run/v1;CLI;App Server;Responses-compatible API

依赖

protocol;codex-runtime

03

运行与部署

Owner / 支持

AI 运维组 · pilot · active;升级路径:AI 运维组 → 运行平台组

交付策略

embedded · supported;Agent Adapter 的兼容组件 ID;统一 Codex/Claude/Cursor/Devin 的 start/continue/cancel/status/result,公开 query/continue、Provider probe 与可选持久元数据恢复已在 Robot/PI 宿主落地,其他宿主适配继续兼容。

配置

Agent Runtime allow-list、模型映射、凭据引用、沙箱/网络/确认与回退策略

部署

逻辑连接器与共享接口;随 Worker Runtime、Robot、Project Intelligence 或 Tech Codex 受控宿主安装,不单独拥有业务状态

健康检查

Runtime probe、受限工具投影、start/continue/cancel、故障分类和会话恢复契约测试

可观测性

agentRun/session、runtime/model、耗时、用量、超时和错误类型;不记录凭据或默认上传完整会话

升级与回滚

旧 agent-connector/model-connector/AgentRuntimeRouter 名称至少保留两个小版本且不少于 90 天;Runtime 版本和宿主兼容性受矩阵约束

依据

architecture/audits/project-capability-runtime-closure-2026-08-30.md · architecture/adrs/0008-project-capability-reuse-eight-layer-architecture.md · architecture/schemas/standard-worker-task.schema.json · architecture/schemas/agent-connector.schema.json · architecture/schemas/runtime-state-event.schema.json · apps/robot/src/flynor_robot/runtime_state_ledger.py · apps/robot/src/flynor_robot/agent_adapter.py · apps/robot/src/flynor_robot/robot_agent_tool_projection.py · apps/robot/tests/test_agent_adapter.py · apps/robot/tests/test_robot_agent_tool_projection.py · apps/robot/src/flynor_robot/worker.py · apps/robot/tests/test_worker.py · apps/robot/src/flynor_robot/project_intelligence_node.py · apps/robot/tests/test_project_intelligence_node.py · apps/robot/src/flynor_robot/evolution.py · apps/robot/tests/test_evolution.py · apps/tech-codex/src/runtime.ts · apps/tech-codex/src/agentAdapter.ts · apps/tech-codex/src/agentRuntimeRouter.ts · apps/tech-codex/src/test/agentAdapter.test.ts · apps/robot/src/flynor_robot/runners · architecture/audits/agent-adapter-governance-2026-08-26.md · architecture/audits/project-intelligence-shared-boundaries-governance-2026-08-26.md · architecture/audits/project-intelligence-expert-capability-governance-2026-08-26.md · architecture/audits/evolution-tech-codex-agent-governance-2026-08-26.md · architecture/audits/robot-agent-tool-projection-governance-2026-08-26.md · architecture/audits/runtime-state-and-native-tool-governance-2026-08-26.md