> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeus.agentspro.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 恢复 Agent

> 恢复被中断的 Agent 执行 — HITL 审批后继续

当 Agent 执行中某个工具触发了 HITL（Human-in-the-Loop）中断后，前端收集用户的审批决策，通过此接口恢复执行。

返回 **SSE 流式响应**，从中断点继续执行。

`user_id` 从 JWT Token 中自动提取，无需在 body 中传入。

<ParamField header="Authorization" type="string" required>
  Bearer JWT Token（`user_id` 从中自动提取）
</ParamField>

<ParamField body="session_id" type="string" required>
  被中断的会话 ID
</ParamField>

<ParamField body="llm_config" type="object" required>
  LLM 模型配置（同 invoke）

  <Expandable title="llm_config">
    <ParamField body="baseUrl" type="string" required>
      API 基础 URL
    </ParamField>

    <ParamField body="apiKey" type="string" required>
      API 密钥
    </ParamField>

    <ParamField body="modelName" type="string" required>
      模型名称
    </ParamField>

    <ParamField body="temperature" type="number" default="0.7">
      温度参数
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="tool_call_results" type="array" required>
  工具调用审批结果列表

  <Expandable title="tool_call_result">
    <ParamField body="tool_call_id" type="string" required>
      工具调用 ID
    </ParamField>

    <ParamField body="tool_name" type="string" required>
      工具名称
    </ParamField>

    <ParamField body="decision" type="string" required>
      审批决策：`approved` | `rejected` | `modified` | `timeout`
    </ParamField>

    <ParamField body="result" type="string">
      自定义工具返回值（modified 时使用）
    </ParamField>

    <ParamField body="original_parameters" type="object">
      原始工具参数
    </ParamField>

    <ParamField body="modified_parameters" type="object">
      修改后的工具参数（modified 时使用）
    </ParamField>

    <ParamField body="rejection_reason" type="string">
      拒绝原因（rejected 时使用）
    </ParamField>

    <ParamField body="is_error" type="boolean" default="false">
      是否标记为错误
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="human_order" type="string">
  人工指令 — 随审批结果传递给 Agent 的额外说明
</ParamField>

<ParamField body="hitl_config" type="object">
  工具中断配置（后续工具调用仍可触发中断）
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://zeus-api.agentspro.cn/api/agent/resume \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "session_id": "sess_456",
      "llm_config": {
        "baseUrl": "https://api.openai.com/v1",
        "apiKey": "sk-...",
        "modelName": "gpt-4o"
      },
      "tool_call_results": [
        {
          "tool_call_id": "call_abc",
          "tool_name": "sandbox_exec",
          "decision": "approved"
        }
      ],
      "human_order": "执行时注意备份文件"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```text SSE Stream theme={null}
  data: {"type": "tool_result", "tool_name": "sandbox_exec", "result": "..."}
  data: {"type": "message_chunk", "content": "操作已完成，已备份文件。"}
  data: {"type": "done", "session_id": "sess_456"}
  ```
</ResponseExample>
