實作指南 / 12 分鐘
套用前先審查 Codex Cloud tasks
Remote execution 只產生候選 diff;local checkout 才是驗收邊界。
Experimental cloud command 可向指定 environment 提交 task、列出或檢查狀態、顯示特定 attempt 的 unified diff,再把它套用到 local working tree。Apply 不等於 merge,也不證明 patch 適合目前 branch;接受前要確認 task、attempt、local status 與 tests。
CLI
已驗證 Terminal Sequence
- $
codex cloud exec --env ENV_ID "Run the migration checks" - $
codex cloud status TASK_ID - $
codex cloud diff TASK_ID - $
codex cloud apply TASK_ID
A
工作原則
Environment 就是 authority
它決定 repo access、setup 與 credentials;提交前確認明確 ID 與邊界。
Attempt identity 很重要
Best-of-N 可產生多個候選,inspect/apply 必須使用同一 attempt。
Apply 只是 transport
它以 Git mechanics 套 patch,不解決 correctness、local drift 或 approval。
B
實地程序
- 01
提交有界 task
指定 environment、必要時 branch、goal、允許變更與 remote checks。
- 02
追蹤精確狀態
保存 task ID;慢速執行時 poll status,不重複 submit。
- 03
檢查 candidate
閱讀指定 attempt 的 unified diff,對照 scope 與 repo conventions。
- 04
準備 checkout
確認 branch/working tree,保留無關 local edits,不套進未知 dirty tree。
- 05
Local apply 與驗證
套用後讀 git diff、跑 affected tests,再 review 才 commit。
PASS / FAIL
驗收清單
- Environment/branch/task/attempt 都有記錄。
- Polling 不會重複提交。
- Apply 前已讀 diff。
- 無關 local changes 被保留。
- Apply 後 tests/diff 已檢查。
WATCH / REJECT
失敗模式
- 套用碰巧排第一的 attempt。
- 假設 remote tests 涵蓋 local drift。
- 未做 local verification 就宣稱完成。