Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Durable Sessions for the Claude Agent SDK, in One Prompt

说明与用途

Claude Agent 在 Dapr Agents 中的会话在崩溃和重启后保持完整,能够从上一次完成的步骤恢复,并保留审批等待状态。

问题

Agents built with Claude often lose progress when a crash or restart occurs, and approval‑gated steps can be lost if they rely on in‑memory state.

结果

Agents survive crashes and restarts, resume from the last completed step, and approval‑gated steps persist across restarts, enabling reliable long‑running tasks.

工作流

  • Install dapr_agents and initialize dapr
  • Define a DurableAgent with a ClaudeAgentExecutor and specify session_store and require_approval
  • Start the agent
  • Assign a multi‑step task to the agent
  • Kill the process mid‑task (e.g., kill -9)
  • Restart the agent and observe session resumption
  • Trigger an approval‑gated tool, close the laptop, and approve later; the wait survives restarts

证据

We shipped a Claude Agent SDK executor in Dapr Agents with durable sessions and human approvals.

来源

Now break it on purpose, because that's the whole point: Give it a multi-step task. kill -9 the process somewhere in the middle. Start it again. The session resumes where it stopped and the steps already completed come back from the journal, not from re-running Claude.

来源

  • 记录日期: 2026-10-13T07:56:01.563Z