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

# Thread Result • AI Agent SDK

> ThreadResult: Outcome of an agent/gateway-initiated thread creation (Issue #3987).

# ThreadResult

> Defined in the [**protocols**](../modules/protocols) module.

<Badge color="blue">AI Agent</Badge>

Outcome of an agent/gateway-initiated thread creation (Issue #3987).

Every call resolves to exactly one :data:`ThreadStatus`, so the caller
always gets a typed answer rather than a hard error — in particular a
channel that cannot thread returns `unsupported` rather than raising, and
the caller falls back to the parent channel. This mirrors the
:class:`ReactionResult` contract.

Attributes:
status: The outcome (`ok` / `unsupported` / `failed` /
`no_route`).
target: The resolved parent target the thread was opened under.
thread\_id: The new thread/topic id, populated only when
`status == "ok"`. Callers compose `"&lt;target&gt;:&lt;thread_id&gt;"` to
route subsequent sends into it.
detail: Optional model-readable explanation.

## Properties

<ResponseField name="status" type="ThreadStatus">
  No description available.
</ResponseField>

<ResponseField name="target" type="str">
  No description available.
</ResponseField>

<ResponseField name="thread_id" type="str">
  No description available.
</ResponseField>

<ResponseField name="detail" type="Optional[str]">
  No description available.
</ResponseField>

## Methods

<CardGroup cols={2}>
  <Card title="ok()" icon="function" href="../functions/ThreadResult-ok">
    Whether a thread was opened (`status == 'ok'`).
  </Card>

  <Card title="as_dict()" icon="function" href="../functions/ThreadResult-as_dict">
    Convert to a serializable dictionary for the tool return value.
  </Card>
</CardGroup>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L2540">
  `praisonaiagents/gateway/protocols.py` at line 2540
</Card>
