# parse_resume_command

> **Function** in `langchain_azure_ai`

📖 [View in docs](https://reference.langchain.com/python/langchain-azure-ai/agents/hosting/_converters/_hitl/parse_resume_command)

Build a resume :class:`Command` from request input items, if present.

Two input shapes are accepted, both keyed by ``interrupt.id``:

* :class:`FunctionCallOutputItemParam` matched by ``call_id``. Its
  ``output`` field is decoded — a JSON object with any of
  ``{"resume", "update", "goto"}`` populates the :class:`Command`;
  anything else (string, malformed JSON, list of content parts) is
  treated as the raw resume value.
* :class:`MCPApprovalResponse` matched by ``approval_request_id``.
  ``approve=True`` resumes with the original interrupt value;
  ``approve=False`` is *not* handled here — use
  :func:`detect_approval_rejection` to surface the rejection to the
  host.

Conflict resolution: when both shapes target the same interrupt id
in one request, the ``function_call_output`` wins (richer payload)
and a warning is logged. This is a deliberate, deterministic
departure from Agent Framework's order-dependent last-write-wins.

Resume shape: with a single pending interrupt the resume value is
passed through as-is (``Command(resume=value)``). With *parallel*
pending interrupts LangGraph requires an id-keyed resume map — a
bare value raises ``RuntimeError: When there are multiple pending
interrupts, you must specify the interrupt id when resuming.`` — so
every matched item that explicitly carries a resume value is folded
into ``Command(resume={id: value})``. Answering only some of the pending
interrupts is allowed; the unanswered ones stay paused.

## Signature

```python
parse_resume_command(
    items: Sequence[Any],
    pending: Sequence[Interrupt],
) -> tuple[Command | None, frozenset[str]]
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `items` | `Sequence[Any]` | Yes | Resolved input items from the request. |
| `pending` | `Sequence[Interrupt]` | Yes | Pending interrupts on the graph's checkpointed state. |

## Returns

`Command | None`

A ``(command, consumed_call_ids)`` pair. ``command`` is ``None``

---

[View source on GitHub](https://github.com/langchain-ai/langchain-azure/blob/7a6a664d617264df8dcb12fcfb1bacc09f21d504/libs/azure-ai/langchain_azure_ai/agents/hosting/_converters/_hitl.py#L305)