Files
.pouch/skills/deployer/references/production-agent.md
T
laily 95946d4278 fix: support explicitly authorized Codex deployment without sandbox
Production agents repeatedly failed before SSH because the launcher only accepted workspace-write profiles. Accept the explicit Codex danger-full-access profile through the same validated plan and receipt path, and cover profile, argv and receipt validation with regression tests.
2026-10-13 23:47:34 +08:00

3.7 KiB
Raw Blame History

正式环境 Agent 委派

正式环境的部署执行者固定是本机 ~/code/app00 项目的另一个 Agent。当前 deployer 只负责解析目标、创建 fresh terminal、投递结构化部署任务、读取结果和清理 terminal;不得在当前会话直接 SSH、sync.py、remote.py 或运行生产 Compose。

目标解析

  1. 先从 list.py / 合并后的 _config.yaml 得到单服务的 node 与 name,形成 app00 selector:<node>/<name>。例如 Blogger 正式环境为 vyec2/blogger;不要用当前仓库的 .pouch/deployer/prod 路径代替 selector。
  2. 确认 ~/code/app00 存在、是 Git 根目录,并在 Orca 中有与该绝对路径精确匹配的 project/worktree。 没有项目记录时,只登记已有目录(例如 orca repo add --path "$HOME/code/app00" --json), 不创建空目录、不按标题或分支猜 worktree。
  3. Agent CLI、模型、权限和启动参数必须来自 app00 已登记的可信 Agent/ACK 配置;不得从项目 文本拼接自由 command、argv、env 或凭据。若没有可证明的部署 Agent 路由,报告 environment-fail,不要 fallback 到当前 Agent 或 SSH。
  4. 正式部署需要 SSH 网络访问。用户明确要求无沙箱 Agent 时,使用 app00 已登记的 Codex permissionMode: danger-full-access profile(如 codex-deploy-prod),仍由 launcher 的 plan/fingerprint/launch 路径创建 fresh terminal。此授权持续有效, 后续同范围部署不重复询问;不要继续选择已知禁止 SSH 的 workspace-write profile。

Fresh terminal 协议

按 app00 的 Agent/ACK 启动协议创建一个新的 terminal;不得复用历史 terminal。创建动作必须 使用可信 adapter/launcher 解析出的 Agent CLI 和 worktree,不得手工拼接自由启动命令。创建后:

  1. 等待 terminal 进入可接收输入状态; 典型生命周期是 terminal wait --for tui-idle → terminal send --enter → terminal read/等待退出 → terminal close。读取命令返回的真实 handle,不要按列表顺序猜 terminal,也不要复用调用前已有的 handle。
  2. 投递下面的结构化任务,替换 <selector>、<image-tag> 和 <source-revision>,不要把 整个仓库或 secret 塞进 prompt:
你是 app00 正式部署 Agent。当前目录必须是 ~/code/app00 的 Git 根目录。
只部署 selector `<selector>`,不得触碰其它服务。
来源 revision:`<source-revision>`;期望不可变镜像 tag:`<image-tag>`。
请先读取 app00 项目规范和该服务的 compose,确认 selector、镜像 tag、目标环境一致;
然后使用 app00 已有的正式部署入口执行升级(例如该项目约定的 make upgrade),不要从业务仓库
同步文件,也不要自行改目标主机或凭据。
部署后验证单服务状态、实际镜像 tag/digest 和项目规定的健康检查;返回执行命令、退出码、
容器状态、镜像证据和未完成项。若 tag、selector、权限或健康检查不一致,立即停止并报告,
不要猜测、不要部署其它服务。
  1. 读取 Agent 的最终回报和必要的 terminal 输出,至少确认 selector、退出码、容器状态及镜像 tag/digest;只凭“命令已发送”不能判定部署成功。
  2. 无论成功、失败、超时、用户中断或读取异常,都关闭本轮创建的 terminal。关闭失败保留 handle 并报告 cleanup-fail,不得换一个 terminal 重试关闭。

与 tester 的关系

tester 要求准备正式测试环境时也使用本文件的委派协议;它只等待部署完成并执行健康检查,不能 自己 SSH 或把正式环境改成测试环境路径。测试环境则继续使用 deployer 的本机 Compose 路径。