test(codex-code-cli): RFC-005 E2E scaffold (L0-L6)#43
Draft
s2agi wants to merge 2 commits into
Draft
Conversation
…称 claude-code-cli)
通信工程马 step 1 read-only 调研 catch RFC-005 critical ambiguity:
- §3.3 sketch 用 spawn("codex", ["exec", ...]) = batch one-shot 模式
- §3.6 user workflow 描述 "用户进入 codex TUI" = interactive TUI 模式
- 两者冲突,早期 draft 误抄 codex-sdk 内部 batch 模式
通信龙 verify codex CLI help:
- codex (no subcommand) = TUI 模式
- codex exec = batch one-shot
- codex resume <id> = top-level subcommand (不是 flag)
Amend:
1. §3.3 sketch — 删 "exec",spawn("codex", [...flags]) TUI 对称 claude-code-cli
+ 加 Errata block 解释为什么早期 draft 错
+ 强调 attached daemon = stdio:"inherit"
+ TOML literal quote 形式说明 (inner double-quote 是 TOML 语法需要)
2. §6.6 session matters — codex exec resume → codex resume top-level subcommand
+ 首次启动 vs 后续启动 spawn args 区分
+ Errata 标注早期混淆 codex-sdk 路径
⚠️ 不阻塞工程马 Step 2 实施 — 他已按 A (TUI) 模式开 worktree,amend 是 doc 一致性 fix.
Author-Agent: 通信SDK马
Helpers: 通信工程马 (raise ambiguity in step 1 read-only), 通信龙 (Lead review + verify codex --help)
派单: 通信龙 → 通信测试马 RFC-005 codex-code-cli runtime E2E.
Vincent telegram 4019+4020: v2.1.8 大 feature = codex-cli 成功支持 + 充分测试.
落地 tests/test-codex-code-cli/{Dockerfile, run.sh, README.md}:
L0 prerequisites — which codex + which anet
L1 hub up + /health + admin login (bootstrap-race retry)
L2 anet node create --runtime codex-code-cli + config.runtime 验
L3 spawn verify: codex 二进制 fork + mcp_servers.commhub flag
(pgrep -af 'codex.*mcp_servers\.commhub')
L4 env injection: COMMHUB_TOKEN 在 /proc/<pid>/environ
L5 sandbox flags: --ignore-user-config + --ignore-rules 在 cmdline
L6 cross-agent: codex-bot + claude-peer 两 alias 共存 + admin send_task
跨 runtime 路由 (hub-side mock-via-MCP, 跟 qa-node-02 R6 同思路)
L2+ 依赖通信工程马 cli.ts ship 才能 PASS. L0+L1 现在就能跑 (scaffold sanity).
工程马 ship cli.ts + preview publish 后本测试应一次性 PASS.
Pin RFC-005 §3.3 + §7 契约:
- RuntimeName enum 含 codex-code-cli
- spawn("codex", args, no shell:true) per #86 patch round 2
- --config inline 注入 mcp_servers.commhub (HTTP transport)
- bearer_token_env_var=COMMHUB_TOKEN + env 不写盘
- --ignore-user-config + --ignore-rules 沙箱化
Pin 跨 runtime alias-agnostic: hub /api/task POST 不 care alias 后端 runtime
(L6).
资源:
- node:20-bookworm + bun + jq + procps
- @openai/codex@0.130.0 (per RFC-005 §7.1)
- @sleep2agi/agent-network@preview
- 0 OpenAI/Anthropic API calls
Author-Agent: 通信测试马
Helpers: 通信龙 (review), 通信SDK马 (RFC-005 §7 baseline), 通信工程马 (cli.ts 实施)
refs RFC-005 (commit 135aa24)
refs issue #14 Telegram bind / RFC-002 Phase 2 chain
s2agi
pushed a commit
that referenced
this pull request
May 13, 2026
…(Phase 1) Phase 1 ship anet 第 5 个 runtime via Path C — spawn `codex mcp-server` stdio + anet 作 MCP client(@modelcontextprotocol/sdk 复用),实测 SYNC return + 期间 emit 实时 `codex/event` 流(含 token-level agent_message_content_delta)。 预估 ~150-200 行 agent-node + ~30-50 行 cli.ts delegate。 决策依据: A/B/C 三路径对比矩阵(§3.2)— C 在复杂度 / 代码量 / 协议稳定性三 大决策维度全胜 (vs RFC-005 Path A pull-on-prompt 不达 G2 / vs Path B ws daemon ~590 行 + 协议本周仍 stabilize)。 Phase 2 升级路径触发条件量化(§10.1, per 通信工程马 review focus)— 满足 mid-turn 干预 / multi-client peer / ws transport stable / inject_items merged 任 2 个时启动 RFC-007 (基于 Path B)。 RFC-005 标 Superseded by RFC-006(下一 commit)。通信工程马 worktree ~/anet-work/rfc-005-codex-code-cli/ 6 edit 中 5/6 直接复用 + #6 launchAgent 改 spawn agent-node delegate。通信测试马 PR #43 L3 regex `mcp[_-]server` 演进。 Author-Agent: 通信SDK马 Helpers: 通信龙 (deep design doc 24b744e + architecture pivot decisions), 通信工程马 (cli.ts implementer eval + Option 2 architecture choice)
s2agi
pushed a commit
that referenced
this pull request
May 13, 2026
…(Path B) Per Vincent telegram 4108-4110 pick ws daemon over mcp-server stdio for TUI attach + daemon push. Pivot rationale (Vincent 4099 hands-on 跑通 codex remote-control + 4108+4110 final): - 用户 TUI attach 价值 > mcp-server SYNC 限制 - Multi-client peer co-presence (anet wrapper + 用户 codex --remote attach) - 完整 63 ServerNotification 流 (含 turn/steer mid-execution 控制) - 接受 OpenAI "Under-development incomplete" warning (docs 标 experimental) - ~1000 行实施成本 (vs Path C ~500 行, 2x 代码量) Amend scope (10 sections rewritten): - §1 Status: Phase 1 改 ws daemon `codex-cli-remote-control` runtime (Path B primary) / Path C mcp-server stdio demoted Phase 2 backup (§10.2) - §1.2 architectural pivot timeline 加 5th pivot (4108+4110 Path C→Path B) - §3 Design 重写主体: ws spawn `codex --enable remote_control app-server --listen ws://127.0.0.1:<port> --ws-auth capability-token --ws-token-sha256 <hex>` + agent-node ws client (npm `ws` ^8 new dep) + 9 reverse approval handler - §4 Protocol flow: 6 ClientRequest methods + 13 ServerNotification mapping + 9 ServerRequest reverse approval policy + user TUI attach co-presence flow - §5 Live progress: ServerNotification → commhub `report_progress` (RFC-003 复用) + 200ms/1KB batch + backpressure - §6 Configuration: capability-token bearer / 127.0.0.1 loopback default / port auto-allocate / approval-policy on-failure / sandbox workspace-write / tmux 长跑 + SSH port-forward - §7 Setup wizard: `codex-cli-remote-control` entry + EXPERIMENTAL warning prompt - §8 Testing: PR #43 演进 L0-L11 (含 ws handshake / bearer / push / multi-client / reverse approval / reconnect) - §9 Risks rewrite: 🔴 under-development + protocol churn 本周 3 PRs / 🟡 multi-client partial / bearer / reconnect / port / token leak / supervision / cross-thread leakage - §10 Future Work: TR1-TR3 触发 Phase 2 加 mcp-server stdio backup runtime (双 runtime user 选), 10.3 Optional anet codex-setup user-mode 命令, 10.4 Path A non-goal - §11 Open Questions rewrite 12 个 (含 naming / bearer / port allocation / supervisor policy / approval whitelist / ChatGPT model / multi-client UX / ephemeral / warning suppression / codex-setup / Phase 2 共存 strategy) 通信龙 lean naming `codex-cli-remote-control` (descriptive, 跟 codex CLI upstream binary 名一致), 写入 §3.2 RuntimeName enum + §7.1 wizard entry + §11 Q1 raise as Open Question. 通信工程马 worktree 6 edit 复用度: 5/6 直接复用 enum/normalize/check/wizard install 逻辑 + #6 launchAgent 改 spawn ws daemon path (vs 之前 mcp-server stdio path)。 Author-Agent: 通信SDK马 Helpers: 通信龙 (架构 pivot decision per Vincent 4108-4110, dual deep plan doc dispatch), 通信工程马 (cli.ts implementer eval + Option 2 architecture choice)
s2agi
pushed a commit
that referenced
this pull request
May 13, 2026
Per Vincent telegram 4136 "行吧先 mcp 吧" final pivot (6th Vincent pivot in this session: 单 C → 双 AC → 三 ACB → 单 C → 单 B → 单 C 复位). 6 轮 pivot evidence-driven 收敛 rationale: - 通信SDK马 deep research [96430e6](96430e6) §3.3: ws daemon broadcast model + per-client opt-out, 用户 TUI attach 仅看 lifecycle, in-progress token streaming 仅 thread owner 收到 - 通信龙 hands-on thread/resume race: "no rollout found for thread id" - 直接 falsify Path B 卖点 "用户 TUI co-presence 看 anet 跑的 turn live" - OpenAI "Under-development incomplete" + 协议 stabilize + 2x 代码量 trade-off 不值得 - Vincent 4123 "如果不能 TUI 的话" → 4136 "行吧先 mcp 吧" final 13 节内容: - §1 Background: 6 轮 pivot timeline + codex 0.130 mcp-server probe evidence - §2 设计目标 G1-G7 (push-driven daemon / live UX / 协议稳定) - §3 Design: Option 2 agent-node bridge + ~250-350 行 (cli.ts +30-50, agent-node +250-350, MCP stdio + @modelcontextprotocol/sdk 复用) - §4 Tool call flow: codex (首单) / codex-reply (续单) + isError handling (per 通信龙 §0.3 实测) + per-session thread strategy - §5 Live progress: codex/event → commhub report_progress (RFC-003 复用) + 13 event type mapping + 200ms/1KB batch - §6 Configuration: on-failure / workspace-write default + profile.flags.codex schema + ~/.codex/config.toml mcp_servers inherit (Q2) - §7 Setup wizard: codex-cli-mcp entry - §8 限制 (5 honest items per 通信龙 plan §4): stdio 1:1 / SYNC no steer / no slash commands / ChatGPT auth model / 双 process RAM - §9 Testing: PR #43 演进 L0-L10 (含 L9 isError / L10 useUserConfig=false) - §10 Future Work: Phase 2 ws daemon TR1-TR3 触发 + Path A non-goal + Optional codex-setup user-mode 命令 + anet-bridge fan-out 脑洞 (per 通信龙 §8 中期) - §11 12 Open Questions (含 Q12 codex-setup print-only vs --apply Phase 1 ship) - §12 Timeline Day 1-3 (1-2 天 ship) - §13 结论 通信工程马 worktree 6 edit 复用度: 5/6 直接复用 + #6 launchAgent 改 mcp-server stdio spawn (vs Path B ws spawn)。 Author-Agent: 通信SDK马 Helpers: 通信龙 (review + 6 轮 pivot dispatch + Path C plan 98b6728), Vincent (4136 final pivot)
s2agi
pushed a commit
that referenced
this pull request
May 13, 2026
Per 通信龙 task 3b0544ec dispatch + Vincent telegram 4175+4176 final decision: RFC-007 codex-cli-mcp implementation STOP (codex-sdk 已 cover ChatGPT 订阅 + autonomous + live streaming use case, codex-cli-mcp ~600 行 over-engineering). Archive Notice 顶部 banner 加 (3 行核心 + 6 轮 pivot timeline + 关联 docs + 未来 重启条件): - Vincent 4175+4176 final STOP rationale - Final state: ❌ Phase 1 不 ship / ❌ 不 migrate / ✅ 新 anet 节点 default codex-sdk - 6 轮 Vincent pivot timeline 完整 capstone (initial → dual → triple → narrow C → pivot B → 复位 C → §6.5 Option A → Q1+Q7+Q12 closed → second thought → final STOP) - 关联 docs 引用: anet-codex-mcp-server-plan.md (通信龙) + anet-codex-remote-control-plan.md (通信SDK马) + codex-deep-research.md (evidence) + RFC-005/006 chain - 未来重启条件: codex CLI 0.131+ 引入 codex-sdk 不 cover 真用户价值时 reconsider 字段表 "状态" 改: Proposed → 🗄 Archived — Phase 1 STOP per Vincent 4175+4176 RFC-007 文本主体保留作 design exercise + 6 轮 pivot 决策 audit trail (per Vincent 关心 anet team design 工艺 case study). Implementation chain 资源 unblock: - 通信工程马 idle (worktree 未 unstash, 不 implement) - 通信测试马 idle (PR #43 演进 hold) - 我 idle (research mode low priority per Vincent 4171) Research mode continue (per 通信龙 task body): - task #111 benchmark 4 runtime RAM/CPU real data (cost migration decision) - codex CLI 0.131+ changelog watch - anet broker fan-out / cross-node codex daemon RAM sharing 可行性 找到 codex-sdk 真不 cover 用户价值 → raise reconsider. RFC-007 完整 commit history: - 21b26ed v2 amend (通信牛 6 P1 review) - af0cb0b v3 amend (Vincent §6.5 Option A + 通信牛 4 checklist) - 3c9c666 v3 nit (Vincent §7.1 defaults + Q3 resolve) - 91e6beb v3.1 nit (Vincent Q7 gpt-5.5 + Q7 resolve) - b03be7c v3.2 (Vincent Q12 §10.3 print-only + Q12 resolve) - **(本 commit) v4 archive banner (Vincent 4175+4176 final STOP)** Author-Agent: 通信SDK马 Helpers: 通信龙 (Vincent telegram relay + final STOP dispatch), Vincent (4175+4176 final decision)
Open
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.
Author & Helpers
Author (Primary): 通信测试马
Helpers:
Tier review gate: 通信龙 (Lead) + 通信SDK马 (spawn 协议 sanity)
Summary
落地
tests/test-codex-code-cli/E2E scaffold,覆盖 RFC-005 §7 Smoke matrix L0-L5 + 通信龙 加的 L6 cross-agent。Vincent telegram 4019+4020:v2.1.8 大 feature = codex-cli 成功支持 + 充分测试。
6 层覆盖
which codex+which anet(scaffold sanity,任何 anet 版本都 PASS)anet hub start+/health+ admin login(带 bootstrap-race retry,issue #31 R6/R8/R19 经验)anet node create --runtime codex-code-cli+config.json写盘 +.runtime字段验pgrep -af 'codex.*mcp_servers\.commhub'验 spawn args/proc/<pid>/environ验COMMHUB_TOKEN注入(per RFC-005 §3.3)/proc/<pid>/cmdline验--ignore-user-config+--ignore-rules沙箱化(per RFC-005 §6.2)send_task跨 runtime 路由(hub-side mock-via-MCP,跟 qa-node-02 R6 同思路)当前状态
agent-network/bin/cli.ts:140RuntimeNameenum 还没加codex-code-cli。依赖通信工程马 cli.ts ship 到 main + preview tag publish → 然后本测试一次性应 PASS。
L0/L1 现在就能跑(验 scaffold 本身),所以这个 PR 可以先 review + 等 cli.ts ship 后再 merge(避免合并即红 CI)。
锁住的 RFC-005 契约
config.runtime--config 'mcp_servers.commhub.url=...'inline 注入bearer_token_env_var=COMMHUB_TOKEN+ env 注入不写盘/proc/environ--ignore-user-config+--ignore-rules沙箱化/proc/cmdline不覆盖(per RFC-005 §7.3)
Test plan
sg docker -c 'docker build -t anet-test-codex-code-cli -f tests/test-codex-code-cli/Dockerfile . && docker run --rm anet-test-codex-code-cli'应在 L2 失败但 L0/L1 PASS)refs