agent-Specialization/.astrion/memory/cloud_server_ssh_and_directories.md

2.9 KiB
Raw Blame History

name description
cloud_server_ssh_and_directories 当需要SSH登录云服务器排查部署问题、查看日志、或操作服务器文件时应该索引本记忆

云服务器 SSH 与目录指南

SSH 登录

ssh 59.110.19.30
# 使用与本地相同的 id_ed25519 密钥

关键目录

用途 路径
源码根目录 /opt/agent/agents/
运行时数据根 /opt/agent/runtime/ASTRION_DATA_ROOT
部署级配置 /opt/agent/runtime/config/
子智能体模型配置 /opt/agent/runtime/config/sub_agent_models.json
子智能体代码 /opt/agent/agents/modules/sub_agent/Python 主进程内协程)
虚拟环境 /opt/agent/venv/

用户数据

/opt/agent/runtime/web/users/<用户名>/projects/<项目名>/
├── project/          # 用户工作区文件
└── data/
    └── conversations/
        └── default/
            └── conv_xxx.json   # 对话记录

子智能体相关

用途 路径
子智能体任务目录 /opt/agent/runtime/web/data/sub_agent_tasks/<task_id>/
任务文件 task.txtsystem_prompt.txt
子智能体交付目录 在用户 project 下的 sub_agent_results/

服务管理

操作 命令/路径
启动服务 bash /opt/agent/start_webapp_new.sh(端口 8091
更新服务 bash /opt/agent/refresh_agents.shgit pull + 重启 + nginx reload
数据迁移脚本 python3 /opt/agent/agents/scripts/migrate_runtime_data.py(执行前务必 --dry-run
Nginx 配置 /etc/nginx/sites-enabled/agent.cyjai.com
本地部署脚本 deploy_agents.shgit push → npm build → scp dist/ → 触发远程 refresh

日志

用途 路径
Web 日志 /opt/agent/runtime/web/logs/
主机调试日志 /opt/agent/runtime/web/logs/host_workspace_debug.log

常见排查流程

  1. SSH 登录服务器
  2. 查看对话 JSONcat /opt/agent/runtime/web/users/<user>/projects/<project>/data/conversations/default/conv_xxx.json
  3. 查看子智能体任务:ls /opt/agent/runtime/web/data/sub_agent_tasks/
  4. 查看日志:tail -100 /opt/agent/runtime/web/logs/host_workspace_debug.log
  5. 查看子智能体任务文件:ls /opt/agent/runtime/web/data/sub_agent_tasks/<task_id>/

已知坑

  • 前端构建不能服务器执行2G 内存会 OOM必须本地 build 后 scp 上传 static/dist/
  • venv 符号链接问题:从 macOS 复制来的 venv启动脚本 fix_venv() 会自动检测重建
  • 子智能体现为 Python 协程easyagent/ 目录已废弃,不再作为子智能体入口
  • 数据迁移后路径变更:运行态数据根的环境变量由 AGENTS_DATA_ROOT 改为 ASTRION_DATA_ROOT,工作区内部目录由 .agents/ 改为 .astrion/