Skip to content

fix(agents): native agent 创建时不再尝试启动 Docker 容器#355

Open
xingyipeng wants to merge 3 commits intodataelement:mainfrom
xingyipeng:main
Open

fix(agents): native agent 创建时不再尝试启动 Docker 容器#355
xingyipeng wants to merge 3 commits intodataelement:mainfrom
xingyipeng:main

Conversation

@xingyipeng
Copy link
Copy Markdown
Contributor

问题

创建 native 类型的 agent 时,代码无条件调用 start_container() 尝试拉取 openclaw 镜像并启动 Docker 容器。

  • 本地源码开发环境有 Docker Desktop 但没有 openclaw 镜像 → 拉取失败 → agent 状态被设为 error
  • native agent 通过 LLM API 直接调用,根本不需要 Docker 容器
  • 只有 openclaw 类型的 agent 才需要容器(已在 line 288 的 early return 中处理)

修复

移除 native agent 创建流程中的 start_container() 调用,直接将状态设为 idle

改动

backend/app/api/agents.py — 1 个文件,3 行改动

xingyipeng and others added 3 commits April 9, 2026 00:49
问题:
- agent_seeder 使用 .seeded 文件标记判断是否已初始化,换环境/连远程 DB 时标记丢失导致重复创建
- template/tool/skill seeder 每次启动都会重建被用户删除的数据

修复:
- 4 个 seeder 统一使用 system_settings 表的 DB 标记(跟随数据库,跨环境有效)
- 幂等三重检查:DB 标记 → DB 数据存在性 → 首次创建
- 用户删除数据后不再重建(标记存在即跳过)
- seed_atlassian_rovo_config 同步加入 DB 标记保护
- push_default_skills_to_existing_agents 在技能未变化时跳过文件扫描
- 更新 ALEMBIC_GUIDELINES.md 补充数据初始化规范

涉及的 DB 标记 key:
- builtin_tools_seeded
- builtin_templates_seeded
- builtin_skills_seeded
- default_agents_seeded
- atlassian_rovo_config_seeded
问题:
创建 native 类型的 agent 时,代码无条件调用 start_container()
尝试拉取 openclaw 镜像并启动容器。本地开发环境有 Docker Desktop
但没有 openclaw 镜像,导致拉取失败,agent 状态被设为 error。

native agent 通过 LLM API 直接调用,不需要 Docker 容器。
只有 openclaw 类型的 agent 才需要容器(已在上方 early return 处理)。

修复:
移除 native agent 创建流程中的 start_container() 调用,
直接将状态设为 idle。
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