Repository navigation
English
Compatibility and upgrading
7.0.0 is available on npm, published on 2026-11-13. It is a milestone release chosen by the author. Existing MCP tool names and parameter interfaces remain compatible; callers should account for the behavior changes below.
- POSIX
kill_process: Linux and macOS now returnstatus: "termination_unconfirmed",terminationConfirmed: false, andterminationReasonswhen termination of the worker and recorded descendants cannot be confirmed.terminatedrequires that confirmation. Killing an already finished job preserves its originalcompleted/failed/loststatus. CheckterminationConfirmedrather than assuming a returned status alone proves the whole tree stopped. Windows keeps its response format and uses the Job Object broker for confirmation. - Windows job startup: the runner must enter a Job Object before starting the worker. A cold broker adds roughly five seconds before execution; repeated dispatches within 60 seconds are faster. This containment step also applies to ordinary durable jobs.
- Kernel concurrency: the default and hard ceiling are three runs per machine, with one per repository; worktrees and clones with the same origin count as the same repository. Paused, interrupted, and waiting-for-human runs retain their slots; ordinary awaiting-approval runs do not. An exception is a legacy
awaiting_approvalrun that already holdsactive.lock: it still blocks admission; release it withai-cli kernel cancel <runId>. Claude weekly quota below 10%, or when quota cannot be retrieved, reduces the machine limit to one. Codex quota below 20%, or when quota cannot be retrieved, prevents two simultaneous runs involving Codex. Admission refuses immediately rather than queuing. Only a human can lower the limit to 1–3. Setup and test commands share one machine-wide lock. See concurrency details. - Restart every MCP server after upgrading, including servers in other open sessions, so older servers stop using the old kill response and coordination behavior. An already running old Windows broker is replaced after it exits when idle.
- Rerun boundary probes: this release changes the Claude and Codex read-only launch arguments and their boundary keys, so previous probe records no longer match. After upgrading, run
ai-cli kernel probe --agent claudeandai-cli kernel probe --agent codex.
New install:
claude mcp add ai-cli -s user -- npx -y @tkflyc/ai-cli-mcpExisting installs: update through your existing npm or source installation method, then restart all MCP servers (restart the clients or reconnect each server with /mcp). Node ^20.19.0 || >=22.12.0 is required. Kernel use also requires the installed, authenticated vendor CLI selected for the work.
- Kernel MCP tools are off by default. Enable them with
ai-cli kernel enable;AI_CLI_KERNEL=on|offoverrides the stored setting. The CLI is independent of that tool switch. - Update
ai-cli-jobson each machine separately:claude plugin marketplace update tkflyc-ai-cli, thenclaude plugin update ai-cli-jobs@tkflyc-ai-cli, then restart Claude Code. npm updates and git pulls do not replace Claude Code's cached plugins. The optionalai-cli_kernel_panelis not included in the npm package and must be installed separately. It runsdist/bin/ai-cli.jsfrom a built source repository; pointAI_CLI_REPOat that repository, or use the documented home-directory fallback. - If you installed the SessionStart dispatch-policy hook, synchronize
tools/hooks/aicli-model-policy.pyto~/.claude/scripts/aicli_model_policy.pyafter reviewing your local configuration. - For direct-api providers, valid existing configuration keeps the default
max_tool_loopsof 30. Set an integer from 1–200 only when needed. If a model matches a configured provider key and provider validation fails, fix the configuration reported in the error rather than silently switching models. Malformed JSON whose keys cannot be read still has the documented fallback limitation.
Supervised agents: ai-cli_kernel
readonly-auditplans and runs supervised read-only work.developdelivers changes in a separate worktree and branch, with kernel-run acceptance tied to the delivery commit. It does not automatically merge or push. Workers retain the user's permissions; a branch is not a permission sandbox.- The deterministic loop records intent before actions, enforces budgets and human gates, and supports resuming interrupted work. Behavior probes check the actual CLI boundary; a PASS is not a guarantee of OS isolation for every vendor. In this release, Codex strict uses an OS read-only sandbox (issue #24), while Claude strict uses a tool allowlist.
- Checkpoints preserve work before development. Explicit single-use releases bind merge or push approval to exact commits, target state, and an expiry. Unknown outcomes are retained for reconciliation rather than retried blindly.
- Reusable approved mandates, opt-in triggers and schedules, repository-scoped candidate/active memories, and archive
list/show/donesupport longer-running work. Archive lists are summaries; useshowfor full evidence. Human approval controls activation and external handoff. - Automatic model selection uses task difficulty and measured quota, freezes eligible candidates in the mandate, and records rerouting. Explicit model choices stay explicit; unknown or insufficient quota does not silently pass the gate.
- The new
ai-cli_kernel_panel0.1.0 provides/kernelfor a terminal dashboard and/kernel sidefor an embedded panel. Opening a new terminal tab currently requires Windows Terminal.
Process-tree containment and recovery
- Windows durable jobs use a shared Job Object broker, with generation/epoch identities and persistent drained evidence. Lost broker contact remains unknown; it is not proof that descendants exited. Kernel normally waits for confirmed termination before releasing worktree resources.
- POSIX tracks descendants and verifies process identity before terminating them. macOS second-resolution start times need renewed relationship evidence before weak identities can be upgraded. Unrecorded descendants and incomplete enumeration remain limits.
- Broker registration and durable writes now use bounded retries for transient transport and reader-handle contention. Journal or lease failures preserve original causes and reconciliation evidence instead of rewriting completed results or assuming a worker died.
- Concurrency coordination, stale-slot handling, legacy-server compatibility markers, and shared test locks were tightened. Restarting all servers remains necessary; real mixed old/new MCP-server operation was not exercised.
Other changes and fixes
- direct-api accepts a per-provider
max_tool_loops, strips an initial UTF-8 BOM fromproviders.json, and reports validation failures for matching configured prefixes. Hitting the tool-loop limit can still end with exit 0: inspectagentOutput.finish_reasonfortool_loop_limit. - Update notices persist undelivered work across updates and rollbacks; delivery is recorded when a
runormodelsresponse reaches the calling AI. Plugin updates still require the user's agreement. ai-cli-jobs0.1.5 adds table rows and visibility into jobs from other sessions and projects. Version 0.2.0 adds a kernel section showing run status and progress, including approval, test-lock waits, acceptance testing, and waiting for human input. Archive summaries, delivery evidence, test-result parsing, and dashboard polling/quoting were also improved.
Validation and known limits
-
Commit
4366d0apassed CI run 43378399377 on Windows, Ubuntu, and macOS with Node 20.19 and 22. A single full Windows localnpm testrun passed all 62 scripts. -
npm 7.0.0 and annotated tag
v7.0.0resolve toffd56ee. That commit changes only CHANGELOG; no additional CI run was made for it. -
Linux and macOS test suites passed with stub CLIs. Kernel with real vendor CLIs has only been exercised on one Windows machine; CI does not establish real-vendor acceptance on Linux or macOS.
-
Windows non-administrator operation, mixed integrity levels, and real reboot / Fast Startup behavior remain untested. Human TTY / Windows Terminal panel interaction also remains unverified.
-
develop, user hooks, and arbitrary context commands run with user permissions. Hard OS isolation and prevention of indirect external writes are not provided. A probe PASS does not guarantee OS isolation for every vendor; the Codex and Claude read-only boundaries differ as described above. -
Issue #17 remains open. The fixes that confirm the worker and its descendants have stopped are included in this release; item 2 (executable verification by a second model, involving permission boundaries) has not started.
-
ai-cli-jobs0.2.0 passed 26claude plugin testcases, but has not been loaded and verified in real Claude Code. -
Scheduling tests used fake executors throughout; no real schedules were operated.
-
Automatic model selection was checked with 23 AUTO assertions using fake executors and quota snapshots; real quota queries and a real-machine
startwere not exercised.
Full details: 7.0.0 CHANGELOG. Changes since v6.9.1.
繁體中文
相容性與升級
7.0.0 已於 2026-11-13 發佈到 npm。這是作者選擇的里程碑版號;既有 MCP 工具名稱與參數介面維持相容,呼叫端仍須留意下列行為變化。
- POSIX
kill_process: Linux、macOS 無法確認 worker 與已記錄子孫都停止時,會回status: "termination_unconfirmed"、terminationConfirmed: false與terminationReasons;確認後才回terminated。對已結束的 job 呼叫 kill 會保留原本的completed/failed/lost。請檢查terminationConfirmed,不要只憑回覆狀態推定整棵程序樹已停止。Windows 回覆格式維持不變,由 Job Object broker 查證。 - Windows job 啟動: runner 先指派進 Job Object 才能啟動 worker。broker 冷啟動到開始執行約多五秒,60 秒內連續派工較快;一般 durable job 也會經過這個步驟。
- kernel 並行: 預設與硬上限都是全機三個 run、同 repo 一個;worktree 與同 origin 的 clone 算同 repo。暫停、中斷、等人仍佔名額,一般待核准不佔;舊版已取得
active.lock的awaiting_approval是例外,仍會擋住開工,須用ai-cli kernel cancel <runId>釋放。Claude 週額度剩不到 10% 或查不到額度時退回全機一個;Codex 剩不到 20% 或查不到額度時,不能同時跑兩個含 Codex 的 run。被擋立即回錯,不排隊;只能由人將上限下調為 1~3。準備與測試指令共用全機一把鎖。細節見並行規則。 - 更新後重開所有 MCP server,包含其他開著的 session,才能換上新的 kill 回覆與協調行為。既有 Windows 舊 broker 閒置退出後才會換成新版。
- 重跑邊界探針: 這版改了 Claude 與 Codex 的唯讀啟動參數及 boundary key,舊探針紀錄已對不上。更新後請重跑
ai-cli kernel probe --agent claude與ai-cli kernel probe --agent codex。
新安裝:
claude mcp add ai-cli -s user -- npx -y @tkflyc/ai-cli-mcp已安裝的使用者:依原本的 npm 或來源安裝方式更新,再重開所有 MCP server(重啟 client,或逐一用 /mcp 重連)。需要 Node ^20.19.0 || >=22.12.0;kernel 執行工作還需要已安裝並登入所選的 vendor CLI。
- kernel MCP 工具預設關閉,以
ai-cli kernel enable開啟;AI_CLI_KERNEL=on|off優先覆寫儲存設定。CLI 不受這個工具開關控制。 - 每台電腦的
ai-cli-jobs要分別執行claude plugin marketplace update tkflyc-ai-cli、claude plugin update ai-cli-jobs@tkflyc-ai-cli,再重開 Claude Code。npm 更新與 git pull 不會替換 Claude Code cache 裡的 plugin。選用的ai-cli_kernel_panel不在 npm 套件裡,要另外安裝;它執行已建置來源 repo 裡的dist/bin/ai-cli.js,請用AI_CLI_REPO指定該 repo,或使用文件所列的家目錄備援路徑。 - 裝了 SessionStart 派工政策 hook 的使用者,核對本機配置後,需將
tools/hooks/aicli-model-policy.py同步到~/.claude/scripts/aicli_model_policy.py。 - direct-api 的有效舊設定可沿用
max_tool_loops預設 30,有需要才設為 1~200 整數。model 匹配已設定的 provider key、卻遇到驗證錯誤時,應修正錯誤指向的設定,不要靜默換模型。JSON 已損毀到讀不出 key 時,仍有既有回退限制。
受監督 agent:ai-cli_kernel
readonly-audit規劃並執行受監督唯讀工作;develop在獨立 worktree 與分支交付,kernel 自己執行驗收,結果綁定交付 commit。不自動合併、不 push。worker 保有使用者權限,分支不是權限沙箱。- 確定性迴圈先記意圖再執行,管理預算與人工閘門,並支援中斷接回。行為探針查驗實際 CLI 邊界;探針 PASS 不是對每一家 vendor 的 OS 隔離保證。這版 Codex strict 改走 OS 唯讀沙箱(issue #24),Claude strict 的唯讀則使用工具白名單。
- 開發前保存回復點;單次放行把 merge/push 同意綁定精確 commit、目標狀態與期限。結果不明時保留對帳,不盲目重試。
- 可重用的已核准委任、選用觸發與排程、依 repo 分開的候選/啟用記憶,以及歸檔
list/show/done支援長期工作。list 只回摘要,完整證據用 show;啟用與外部交接由人控制。 - 自動選模型依難度與實測額度,在委任書凍結合格候選並記錄改派。指名模型照指名;額度不足或查不到額度不會靜默放行。
- 新增
ai-cli_kernel_panel0.1.0:/kernel開 Terminal dashboard,/kernel side開嵌入式側邊面板。目前新分頁功能需要 Windows Terminal。
程序樹 containment 與恢復
- Windows durable job 改用共用 Job Object broker,以 generation/epoch 識別與持久 drained 證據追蹤。broker 失聯仍是 unknown,不能當作子孫已退出;kernel 正常流程確認停止後才釋放 worktree 資源。
- POSIX 追蹤子孫,終止前核實程序身分。macOS 秒級啟動時間需重新取得親子等關係證據才能升級弱身分;未記錄的子孫與列舉缺口仍有限制。
- broker 登記與持久寫入對暫時傳輸錯誤、讀者 handle 競爭使用有界重試。journal/lease 故障保留原始原因與對帳證據,不把已完成結果改成失敗,也不逕認 worker 死亡。
- 補強並行協調、殘留名額回收、舊版 server 相容標記及共用測試鎖。仍須重開所有 server;真實新舊版 MCP server 並存未實測。
其他新增與修正
- direct-api 支援各 provider 的
max_tool_loops,解析providers.json前剝除 UTF-8 BOM,並回報匹配前綴的設定驗證錯誤。撞工具迴圈上限仍可能 exit 0,請檢查agentOutput.finish_reason是否為tool_loop_limit。 - 更新提示跨更新與回滾保留未送達事項,只有
run/models回覆送到呼叫端 AI 才算送達。plugin 更新仍須使用者同意。 ai-cli-jobs0.1.5 加入表格與其他 session/專案的 job;0.2.0 新增 kernel 區塊,顯示 run 狀態與進度,包含等核准、等測試鎖、驗收測試與等人處理。另改善歸檔摘要、交付證據、測試統計解析及 dashboard 輪詢/參數引用。
驗證與已知限制
-
4366d0a的 CI run 43378399377 在 Windows、Ubuntu、macOS × Node 20.19/22 全過;Windows 本機單次完整npm test的 62 支腳本全過。 -
npm 7.0.0 與 annotated tag
v7.0.0都對應ffd56ee;該 commit 只改 CHANGELOG,未另跑 CI。 -
Linux、macOS 的測試套件已用替身 CLI 通過 CI。kernel 搭配真實 vendor CLI 仍只在一台 Windows 實測過,不能據此視為 Linux、macOS 的真實使用已驗收。
-
Windows 非系統管理員、混合完整性、真正重開機/Fast Startup 尚未實測;真人 TTY/Windows Terminal 面板互動也尚未驗證。
-
develop、使用者 hook 與任意 context 指令以使用者權限執行;未提供硬性 OS 隔離與間接外部寫入防護。探針 PASS 並非每一家 vendor 的 OS 隔離保證;Codex 與 Claude 的唯讀邊界如前述有所不同。 -
issue #17 維持開啟。確認 worker 與子孫程序已停止的修正已進本版;第 2 點(由第二個模型做可執行的驗證,涉及權限邊界)尚未開始。
-
ai-cli-jobs0.2.0 的claude plugin test26 pass,尚未在真的 Claude Code 裡載入驗證。 -
排程測試全用假執行器,沒有操作真實排程。
-
自動選模型以 23 支 AUTO 斷言、假執行器與額度快照驗證;真的額度查詢與真機
start沒有實測。
完整內容見 7.0.0 CHANGELOG。自 v6.9.1 的變更。