Repository navigation
Closed
Labels
agent-runtimeAgent orchestration, memory, and extensionsAgent orchestration, memory, and extensionsenhancementNew feature or requestNew feature or requestgit-workflowGit and pull request workflowsGit and pull request workflowsgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededjavascriptPull requests that update javascript codePull requests that update javascript codesecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Description
Parent: #98
问题概述 / Summary
现有命令能力以 typed action、一次性提案和人工操作为主;PR #97 正在补充经审阅的 PowerShell/Bash one-shot 与持久 Debug terminal。普通 Code/Deliver 仍缺模型可连续使用的真实命令闭环:批量执行、流式输出、后台 Job、stdin、超时/中断和大输出 Artifact。
优先级 / Priority
P0。目标是在普通编程任务中提供足够完整的真实 PowerShell/Bash/进程能力,而不是要求用户进入 Debug 最高权限。
当前基线 / Current baseline
- feat(execution): 工作区沙箱内的一次性通用命令 Runner #43 已交付工作区沙箱内的一次性通用命令 Runner;feat(terminal): 持久 Debug 终端与限时 Agent 输入 #46 已定义用户终端与 Agent 输入隔离。
- 主线已有 native one-shot、typed Git 和命令提案/人工接受后的再次唤醒。
- PR feat(runtime): add reviewed PowerShell/Bash and Debug terminal #97(Draft)增加固定解析、可审阅的 PowerShell/Bash transport 与 Debug terminal lease。
- 当前缺少同一工具轮次内的模型调用/结果回送、流式 cursor、可恢复后台 Job 和 stdin 生命周期。
- Cyber Surface 不在当前范围。
范围 / Scope
- 定义
command-runtime.v2:显式 executable/shell profile、canonical argv/script、cwd、受限 env、stdin policy、timeout、output policy 和 network declaration。 - 在 Code/Deliver + Root 中提供一次性真实命令工具;与用户终端、Debug terminal 和 Docker Sandbox 保持不同 session/所有权。
- 支持同一请求中的有序批次与明确的 fail-fast/continue 策略,不通过字符串拼接模拟多个命令。
- stdout/stderr 使用单调 cursor 流式读取,保留通道、时间、退出码和截断原因;大输出溢写为有 hash 的 Artifact。
- 支持 Run-owned 后台 Job:start/list/read/write-stdin/cancel/kill/wait,持久记录启动意图、generation lease、process tree 和终态。
- timeout、取消、应用重启和 Workspace root 漂移均终止或安全收养进程,不留下失去所有权的子进程。
- PowerShell/Bash/原生进程分别使用固定可信解析器和参数合同;环境来源、网络边界和 executable hash 在执行前可审阅。
- 命令结果作为不可信工具输出回到 Supervisor;控制字符、ANSI/C1、Secret 和超长片段统一清洗。
非目标 / Non-goals
- 不在 Plan 阶段执行命令。
- 不把 Debug terminal 的持久 Agent 输入权作为普通 Deliver 的默认能力。
- 不自动开放任意网络、credential helper、用户 Shell profile、历史文件或交互式密码提示。
- 不允许仓库脚本、Skill 或模型输出自行选择最高权限档。
涉及目录 / Affected directories
internal/runner/internal/terminal/internal/executionauth/internal/toolgateway/internal/application/internal/policy/internal/approval/internal/store/internal/events/internal/httpapi/cmd/cyberagent/cmd/cyberagent-desktop/web/src/docs/
依赖 / Dependencies
- PR feat(runtime): add reviewed PowerShell/Bash and Debug terminal #97 是 PowerShell/Bash 与 Debug terminal 的直接代码基线;合并前必须回放本 Issue 的兼容矩阵。
- 可与模型工作区工具并行实现,后续通过统一 Tool Gateway 接入。
验收条件 / Acceptance criteria
- 普通 Code/Deliver 可由 Root 在一次连续工具会话中启动真实 PowerShell、Bash 或批准的原生进程并读取最终结果。
- 批次语义、cwd、env、stdin、timeout、退出码和网络声明结构化;不依赖 Shell 拼接猜测。
- 长任务可后台运行、断线后按 cursor 续读、发送受限 stdin、取消并终止完整 owned process tree。
- 应用崩溃/重启后的 reconciliation 不重复执行,不恢复过期输入权,也不遗留无法归属的 Job。
- 输出有界、可脱敏、可溢写 Artifact;stdout/stderr 顺序和截断原因可解释。
- PowerShell 5/7、Git Bash 与受支持 POSIX Bash 有真实 smoke;缺失解析器时给出稳定诊断。
- 用户终端、Debug terminal、Agent one-shot 和 Sandbox Runner 的 UI/审计所有权明确不同。
- 网络与 credential 使用逐次授权;普通命令能力不能借 Git helper、profile 或环境变量静默提权。
- 单元、集成、竞争、故障注入、process leak 检测、OpenAPI 和双语文档完成。
安全边界 / Security boundaries
“命令可运行”不等于模型拥有 Shell。每次执行仍需按当前权限档、精确参数、cwd、env、网络、超时和 generation 在 Tool Gateway 最终复核。
Metadata
Metadata
Assignees
Labels
agent-runtimeAgent orchestration, memory, and extensionsAgent orchestration, memory, and extensionsenhancementNew feature or requestNew feature or requestgit-workflowGit and pull request workflowsGit and pull request workflowsgoPull requests that update go codePull requests that update go codehelp wantedExtra attention is neededExtra attention is neededjavascriptPull requests that update javascript codePull requests that update javascript codesecuritySecurity boundary or high-risk capabilitySecurity boundary or high-risk capability高难度
Activity