# load_thread_sort_order

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/model_config/load_thread_sort_order)

Load the sort order preference for the thread selector.

## Signature

```python
load_thread_sort_order(
    config_path: Path | None = None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `config_path` | `Path \| None` | No | Path to config file.  Defaults to `~/.deepagents/config.toml`. Passing a path also excludes managed policy from this read, so production callers must pass `None`. (default: `None`) |

## Returns

`str`

`"updated_at"` or `"created_at"`.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/3812967c84d90619848f3185f22470204fc88bd8/libs/code/deepagents_code/model_config.py#L6139)