> ## 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.

# Spawn Diagnostic • AI Agent SDK

> spawn_diagnostic: Fire-and-forget a detached diagnostic into ``log_dir``.

# spawn\_diagnostic

Method

> This is a method of the [**ShutdownForensicsProtocol**](https://praison.ai/docs/sdk/reference/praisonaiagents/classes/ShutdownForensicsProtocol.md) class in the [**protocols**](https://praison.ai/docs/sdk/reference/praisonaiagents/modules/protocols.md) module.

Fire-and-forget a detached diagnostic into `log_dir`.

Must never raise and must not block the caller; the diagnostic runs in
a detached session so it survives a `SIGKILL` on the process group.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
def spawn_diagnostic(ctx: Dict[str, Any], log_dir: Optional[str]) -> None
```

## Parameters

**ctx** `Dict[str, Any]` *required*

No description available.

**log\_dir** `Optional[str]` *required*

No description available.

## Source

> [card] [View on GitHub](https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/gateway/protocols.py#L5756)
>
> `praisonaiagents/gateway/protocols.py` at line 5756


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.