refactor(cleanup): remove legacy CLI and complete EvoAgent migration cleanup

- Delete backend/cli.py and all CLI-specific tests (test_cli.py,
  test_openclaw_cli_service.py, test_skills_cli.py)
- Remove evotraders console script from pyproject.toml
- Update README/CLAUDE.md to reference python backend/main.py instead of CLI
- Add pytest-asyncio to dev dependencies
- Enhance EvoAgent with reload_runtime_assets and backward-compat attrs
- Align tests with updated API semantics and gateway process models

Constraint: CLI is deprecated in favor of split-service runtime model
Confidence: high
Scope-risk: moderate
This commit is contained in:
2026-04-02 02:06:46 +08:00
parent 3334a41e5a
commit 49d704c363
15 changed files with 117 additions and 2151 deletions

View File

@@ -126,6 +126,8 @@ class EvoAgent(ToolGuardMixin, ReActAgent):
self.agent_id = agent_id
self.config_name = config_name
self.workspace_dir = Path(workspace_dir)
self.workspace_id = config_name
self.config = {"config_name": config_name}
self._skills_manager = skills_manager or SkillsManager()
self._env_context = env_context
self._prompt_files = prompt_files
@@ -328,6 +330,17 @@ class EvoAgent(ToolGuardMixin, ReActAgent):
# Call parent (which may be ToolGuardMixin's _reasoning)
return await super()._reasoning(**kwargs)
def reload_runtime_assets(self, active_skill_dirs: Optional[List[Path]] = None) -> None:
"""Reload toolkit and system prompt from current run assets.
Refreshes prompt files from workspace config and rebuilds the toolkit.
"""
# Rebuild system prompt (also refreshes _agent_config and _prompt_files)
self.rebuild_sys_prompt()
# Reload skills/toolkit
self.reload_skills(active_skill_dirs=active_skill_dirs)
def reload_skills(self, active_skill_dirs: Optional[List[Path]] = None) -> None:
"""Reload skills at runtime.
@@ -497,6 +510,10 @@ class EvoAgent(ToolGuardMixin, ReActAgent):
# Reload agent config in case it changed
self._agent_config = self._load_agent_config()
# Refresh prompt_files from updated config
if "prompt_files" in self._agent_config:
self._prompt_files = list(self._agent_config["prompt_files"])
# Rebuild prompt
self._sys_prompt = self._build_system_prompt()