[PAUSED] feat: run ACP agents on connected computers - #1007
Draft
akazwz wants to merge 4 commits into
Draft
Conversation
akazwz
force-pushed
the
feat/remote-acp
branch
from
August 16, 2026 13:53
f4de8b0 to
a5f8346
Compare
akazwz
force-pushed
the
feat/remote-acp
branch
from
August 16, 2026 14:19
a5f8346 to
2805410
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Status: Paused / 暂停开发
这个 Draft PR 暂时保留,作为已完成实验和实现参考,不准备按当前 Remote ACP 方案继续推进或合并。我们正在把核心抽象调整为 Connected/External Agent Runtime:Codex 直接使用 app-server,Claude 使用官方 Agent SDK sidecar,ACP 仅作为兼容 driver。待统一 runtime contract 和原生 driver 稳定后,再从本 PR 中提取可复用的连接、认证、进程执行与双向流基础设施。当前阶段无需继续 QA 或 review。
Important
这是一个 Draft PR,目前还不能合并。 核心传输和路由已经实现,并有自动化测试覆盖,但真实 Desktop/CLI 端到端测试和发布验证还没有完成。先提交 Draft 是为了尽早确认方案,再用真实连接电脑持续测试和优化。
这个 PR 做了什么
Remote ACP 允许 Memoh Server 在用户已连接的电脑上启动 Codex ACP 或 Claude Code ACP adapter,并通过该进程的 stdin/stdout 交换 ACP JSON-RPC 消息。
实现直接复用现有的 Remote Runtime 传输链路:
每个 ACP 进程都有自己独立的双向
Execstream。多个 Session 可以复用同一条电脑连接,但 HTTP/2 会分别处理各个 stream 的流控、顺序、stdin、stdout、stderr、退出状态、取消信号和进程生命周期,彼此不会串流。stdin 帧在进程 spawn 窗口内统一排队,flush 后才切换直写,保证字节顺序在任何时序下都与到达顺序一致。这里不需要再增加一套 ACP 专用连接或网络协议。范围边界与信任模型
这个 PR 只负责启动本地进程和转发 stdio。
Remote ACP 继承 Runtime 现有
exec能力的信任模型:连接电脑即意味着允许 Server 以本机用户身份执行命令。固定 launcher 机制解决的是名字解析和路径卫生(alias 一定解析到打包的 adapter、本地 CLI 路径不出本机),不是执行范围的收窄。docs/design/remote-acp.md的 Trust model 一节完整描述了这一边界,以及未来若要提供「仅 ACP、无通用 shell」授权所需要的 capability 级 Exec 白名单。实现方式
Runtime 和 Desktop
acp_codex或acp_claude_codecapability。$SHELL -lc 'command -v …')解析用户真实 PATH 来发现本机 codex/claude,覆盖 nvm、fnm、volta、pnpm、mise 等版本管理器;登录 shell 不可用时回退到确定性目录列表。找到的路径不做 realpath 解析,保留 symlink 分发语义(如 volta)。codex-acp1.2.0 和claude-agent-acp0.66.0;版本号由 Web 连接命令测试与 Desktop manifest 交叉断言,第三方声明中的传递依赖版本由打包测试对照 lockfile 校验。Server 和 Workspace 路由
workspace_read。无 Folder 的 ACP Session 在 remote Primary 上冷启动同样被该门拦截。project_path)与修改模型/推理走同一套 remote 门。Web
已完成的验证
go test ./...、golangci-lintpnpm --filter @memohai/runtime test,包括同一条传输连接上的两个并发双向 Exec stream、spawn 窗口内的 stdin 顺序回归测试Draft 阶段还要完成的工作
@memohai/runtime;registry 上现有版本还不包含 Remote ACP。目前还没有宣称完成人工端到端 QA。这个 PR 现阶段主要用于评审架构,并作为后续真实环境测试和迭代的基础。