# save_thread_sort_order

> **Function** in `deepagents_code`

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

Save the sort order preference for the thread selector.

## Signature

```python
save_thread_sort_order(
    sort_order: str,
    config_path: Path | None = None,
) -> bool
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `sort_order` | `str` | Yes | `"updated_at"` or `"created_at"`. |
| `config_path` | `Path \| None` | No | Path to config file. (default: `None`) |

## Returns

`bool`

True if save succeeded, False on I/O error.

---

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