EPISODE · May 6, 2026 · 3 MIN
@ClaudeDevs:Claude Managed Agents 新增多代理協調與夢境自學習功能。 @ClaudeDevs 介紹 Claude Managed Agents 的全新功…
from EasyVibeCoding Podcast · host ClaudeDevs
Claude Managed Agents 新增多代理協調與夢境自學習功能。 @ClaudeDevs 介紹 Claude Managed Agents 的全新功能,包括 multiagent orchestration、基於 rubric 的 outcomes loop 自改善、夢境(dreaming)自學習,以及 webhooks 通知。這些更新讓 Agent 能協調子任務、自我迭代優化,並透過背景處理精煉記憶,提升複雜工作處理能力。所有 API 請求需使用 managed-agents-2026-04-01 beta header,SDK 會自動設定。 多代理協調(Multi-agent Orchestration) Multi-agent orchestration 讓 coordinator Agent 協調其他子代理完成複雜任務,每個子代理擁有獨立 context window,但共享 container 與檔案系統。適合平行化獨立子任務(如多來源搜尋、檔案分析)、專門化路由(如安全 Agent 或文件 Agent)、或升級複雜任務至更強模型。支援最大 25 個 concurrent threads,coordinator 只 delegate 一層,最多 20 個 unique agents,但可呼叫多個副本。 配置 coordinator 時設定 multiagent 宣告代理列表,例如 "Engineering Lead" 使用 claude-opus-4-7 模型,system prompt 為 "You coordinate engineering work. Delegate code review to the reviewer agent and test writing to the test agent.",tools 為 [{"type": "agenttoolset20260401"}] `bash coordinator=$(curl -fsS https://api.anthropic.com/v1/agents \ -H "x-api-key: $ANTHROPICAPIKEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01" \ -H "content-type: application/json" \ -d @- </dev/null <<EOF { "events": [ { "type": "user.define_outcome", "description": "Build a DCF model for Costco in .xlsx", "rubric": {"type": "text", "content": "DCF Model Rubric\n..."}, "max_iterations": 5 } ] } EOF ` 事件包括 span.outcomeevaluationstart(iteration 從 0 開始)、span.outcomeevaluationongoing(heartbeat)、span.outcomeevaluationend(result: satisfied 轉 idle、needsrevision 迭代、maxiterations_reached、failed、interrupted)。檢查 outcome status 透過串流或 poll session。 檢索 outcomes(Python): `python session = client.beta.sessions.retrieve(session.id) for outcome in session.outcome_evaluations: print(f"{outcome.outcome_id}: {outcome.result}") ` Agent 輸出檔案置於 /mnt/session/outputs/,idle 後透過 Files API 下載(scope 到 session): `python files = client.beta.files.list(scope_id=session.id) if files.data: content = client.beta.files.download(files.data[0].id) content.writetofile("/tmp/output.txt") ` Webhooks 通知 Webhooks 避免輪詢,通知 session、thread、outcome、vault 狀態變化。於 Console 註冊 HTTPS 443 endpoint,訂閱事件類型,使用 signing secret 驗證 X-Webhook-Signature。 Session webhook events 示例: session.statusrunstarted:轉 running session.status_idled:等待輸入 session.status_rescheduled:自動重試 session.status_terminated:終止錯誤 session.thread_created:新 multiagent thread session.outcomeevaluationended:迭代完成 Python webhook 驗證: `python from flask import Flask, request import anthropic client = anthropic.Anthropic() 讀取 ANTHROPICWEBHOOKSIGNING_KEY app = Flask(name) @app.route("/webhook", methods=["POST"]) def webhook(): try: event = client.beta.webhooks.unwrap( request.getdata(astext=True), headers=dict(request.headers), ) except Exception: return "invalid signature", 400 if event.data.type == "session.status_idled": print("session idled:", event.data.id) return "", 200 ` 處理重試(相同 event.id 捨棄)、排序用 created_at,非 2xx 觸發重試,~20 次失敗自動停用。 夢境自學習(Dreaming) Dreaming 是研究預覽功能(申請存取),背景處理多 session 記憶,精煉重組(合併重複、替換過時、提煉洞見)。輸入既有 memory store + 最多 100 sessions,輸出新 memory store,不修改輸入。需額外 dreaming-2026-04-21 beta header,支援 claude-opus-4-7、claude-sonnet-4-6。 建立 dream: `bash dream=$(curl -s https://api.anthropic.com/v1/dreams \ -H "x-api-key: $ANTHROPICAPIKEY" \ -H "anthropic-version: 2023-06-01" \ -H "anthropic-beta: managed-agents-2026-04-01,dreaming-2026-04-21" \ -H "content-type: application…
Embed this episode
Ready to play
@ClaudeDevs:Claude Managed Agents 新增多代理協調與夢境自學習功能。 @ClaudeDevs 介紹 Claude Managed Agents 的全新功…
No transcript for this episode yet
Similar Episodes
No similar episodes found.
Similar Podcasts
No similar podcasts found.