Skip to content

Multi-AI Terminal v0.2.8

Choose a tag to compare

@github-actions github-actions released this 23 Jul 02:44

v0.2.8 — Claude Agent SDK session runtime

EN

Claude runs now ride the Claude Agent SDK session runtime by default. Each MAT session keeps one persistent streaming query alive across turns, so follow-up turns reuse the warm session instead of cold-starting the CLI, and interrupts land as soft turn interrupts instead of process kills.

  • Session runtime (default): one persistent SDK query per session with streaming input; turns are serialized per session, results carry strict usage (inputTokens / outputTokens / costUsd), and the reported SDK session id becomes the resume ref.
  • Interrupt semantics: killing an active turn sends a soft SDK interrupt (the session survives); killing a queued turn cancels it before it starts. Both classify as killed (SIGTERM), never as provider errors.
  • Resilience: closed generators rebuild transparently with resume; managed-runtime changes recycle idle sessions immediately and busy ones at turn end; idle sessions are reaped after 5 minutes (resume still works cold).
  • Stream shape: text/thinking deltas coalesce into readable message blocks (same shape as the codex app-server runtime); tool use and tool results pass through as structured events.
  • Opt-out: set MAT_CLAUDE_RUNTIME=cli to use the legacy one-shot CLI path; MAT_DISABLE_AGENT_SDK=1 disables SDK loading entirely (runs fail over with a clear error pointing at the CLI opt-out).

Validated end-to-end against the real Claude Agent SDK (one-turn smoke through the production adapter: exit 0, real session ref, strict usage, coalesced stream).

zh-TW

Claude 執行現在預設走 Claude Agent SDK session runtime。每個 MAT session 維持一條跨回合的持久串流查詢:後續回合重用暖 session、不再冷啟 CLI,中斷也改為軟性回合中斷、不殺行程。

  • Session runtime(預設):每 session 一條持久 SDK query、串流輸入;同 session 回合序列化,結果帶嚴格 usage(inputTokens / outputTokens / costUsd),SDK 回報的 session id 即為 resume ref。
  • 中斷語意:中止進行中的回合送軟性 SDK interrupt(session 存活);中止排隊中的回合在起跑前取消。兩者一律歸類為 killed(SIGTERM),不會誤判為 provider 錯誤。
  • 韌性:generator 關閉後以 resume 透明重建;受管 runtime 變更時,閒置 session 立即回收、忙碌 session 於回合結束回收;閒置 5 分鐘的 session 會被回收(冷 resume 仍可用)。
  • 串流形狀:text/thinking delta 合併為可讀的訊息區塊(與 codex app-server runtime 同形);工具呼叫與結果以結構化事件透傳。
  • 退出選項:設 MAT_CLAUDE_RUNTIME=cli 走舊制一次性 CLI 路徑;MAT_DISABLE_AGENT_SDK=1 完全停用 SDK 載入(執行會以明確錯誤指向 CLI 退出選項)。

已對真實 Claude Agent SDK 完成端到端驗證(經正式 adapter 的單回合 smoke:exit 0、真實 session ref、嚴格 usage、合併串流)。