Skip to content

Support Codex and PiAgent runtimes in Studio agent loop - #1071

Open
FirstayZheng wants to merge 3 commits into
volcengine:mainfrom
FirstayZheng:feat/studio-agent-loop-runtime
Open

Support Codex and PiAgent runtimes in Studio agent loop#1071
FirstayZheng wants to merge 3 commits into
volcengine:mainfrom
FirstayZheng:feat/studio-agent-loop-runtime

Conversation

@FirstayZheng

@FirstayZheng FirstayZheng commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

背景

Studio 创建多 Agent / LoopAgent 时需要支持 ADK、Codex、PiAgent 混合 runtime。PiAgent 云部署还遇到构建期和运行期二进制解析问题;LoopAgent 作为 root agent 时,Studio BFF tools 会因为 root 没有 .tools 列表而初始化失败。

变更

  • 在 Studio 创建页新增独立的“运行配置 / Runtime”区域,支持为 LLM Agent 选择 ADK、Codex、PiAgent,并在 YAML、草稿恢复和云端 graph 中保留该字段。
  • 生成代码支持 runtime="codex"runtime="piagent",Codex 自动补充运行依赖。
  • PiAgent Dockerfile 构建期预装 Pi 二进制,支持 Volcengine / BytePlus 不同优先级的 mirror + GitHub 多源 fallback。
  • Dockerfile 中优先调用包内 veadk.runtime.piagent.installer;当云端安装的是旧版 veadk、installer 不支持多 URL fallback 时,才执行内联安装脚本兜底。
  • 生成的 app.py 会为 PiAgent runtime 设置 PIAGENT_BINARYPIAGENT_INSTALL_DIRPIAGENT_AGENT_DIR 默认值,避免 AgentKit 运行时没有继承 Dockerfile ENV 时回落到首次请求懒下载。
  • 增强源码版 PiAgent installer:支持 PIAGENT_BINARY_URLS / PIAGENT_BINARY_BASE_URLS 多源 fallback、聚合失败原因,并可复用镜像内 /opt/piagent/pi/pi
  • 修复 root 是 LoopAgent 或其他无 .tools orchestrator 时 Studio BFF tools 初始化抛错的问题,改为自动关闭 BFF tools。
  • 修复更新 Agent 回显时 runtime 丢失的问题:当 draft 缺少 runtime 或走 legacy/runtime graph 恢复时,从安全后的 graph 中按 id/name/path 匹配子 Agent,并只给 LLM Agent 回填 ADK/Codex/PiAgent。
  • 改进 CodePipeline 空日志 URL 的错误呈现,避免 Studio 面板只看到无上下文的 DEBUG。

修复的问题

  • PiAgent 云上首次请求触发 GitHub 懒下载,导致 invoke 超时或 Runtime 初始化不可用。
  • PiAgent 构建下载失败时只暴露一行 DEBUG,不方便从 Studio 面板定位失败 URL 和原因。
  • LoopAgent 作为 root agent 时部署初始化失败:Studio BFF tools require an Agent with a tools list.
  • Codex / PiAgent runtime 字段在 Studio 草稿、YAML、云端运行拓扑和更新回显中无法稳定 round-trip。
  • CodePipeline step 返回空日志 URL 时,后端日志提示不够可读。

验证

  • npm --prefix frontend run build
  • npm --prefix frontend test
  • npm --prefix frontend run check:i18n
  • npm --prefix frontend run test:webui-assets
  • uv run pytest tests/cli/test_generated_agent_backend_codegen.py tests/cli/test_generated_agent_component_matrix.py tests/cli/test_generated_agent_backend_codegen_extended.py tests/integrations/agentkit/test_app.py tests/runtime/piagent/test_piagent_runtime.py tests/cli/test_frontend_deploy_errors.py
  • uv run pytest tests/cli/test_runtime_update_recovery.py tests/cli/test_studio_rbac.py -q -k 'runtime_update_recovery or legacy_runtime_capability_recovers_environment_and_agentkit_toolset or runtime_update_capability_restores_quick_mode_from_agent_draft_endpoint or runtime_update_capability_uses_safe_agent_draft_fallback'
  • clean .env 环境:uv run pytest tests/cli/test_runtime_update_recovery.py tests/cli/test_studio_rbac.py tests/cli/test_generated_agent_backend_codegen_extended.py tests/runtime/piagent/test_piagent_runtime.py tests/integrations/agentkit/test_app.py -q,286 passed / 1 skipped。
  • uv run --with pyright pyright veadk/cli/generated_agent_codegen.py veadk/integrations/agentkit/app.py veadk/runtime/piagent/installer.py
  • git diff --check
  • uv run pre-commit run --all-files
  • 云端验证:r-yeuk31uha864rmgqpmqz(cn-beijing)PiAgent invoke 成功返回 OK;运行日志进入 piagent runtime: starting pi rpc,没有再出现从 GitHub 懒下载 Pi 二进制。

局限与后续

  • 生成 Dockerfile 中暂时保留一份内联 Pi 二进制安装 fallback,和 veadk.runtime.piagent.installer 存在逻辑重复;这是为了兼容当前云端 PyPI 仍可能安装旧版 veadk-python==1.1.9 的情况。等增强后的 installer 发版并成为云端默认依赖后,可以删除内联脚本,改为只调用包内 installer。
  • 当前 Studio BFF tools 对无 .tools 的 orchestrator root 会自动关闭;如果后续希望给 LoopAgent root 直接挂 Studio tools,需要再设计工具路由语义。

@FirstayZheng
FirstayZheng force-pushed the feat/studio-agent-loop-runtime branch from aaba4fb to af27fe5 Compare September 9, 2026 03:13
@FirstayZheng
FirstayZheng force-pushed the feat/studio-agent-loop-runtime branch from af27fe5 to 541b7b6 Compare September 9, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant