# agent: Introduce \`ModelUsageContext\` \(\#32076\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/beb0d49dc4fae5350061b38ae7cd192c6857768e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: beb0d49dc4fae5350061b38ae7cd192c6857768e

Requested commit: beb0d49dc4fae5350061b38ae7cd192c6857768e

Commit: beb0d49dc4fae5350061b38ae7cd192c6857768e

Tree: a10a8212df4ca2df05cd1c5c4ae02d6f96d3b098

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
agent: Introduce `ModelUsageContext` (#32076)

This PR is a refactor of the existing `ModelType` in
`agent_model_selector`.

In #31848 we also need to know which context we are operating in, to
check if the configured model has image support.
In order to deduplicate the logic needed, I introduced a new type called
`ModelUsageContext` which can be used throughout the agent crate


Release Notes:

- N/A
```

## Parents

- [c9aadadc4b9359b807f6474f949957178c134edf](https://git.cafe/gitcafe/zed/commit/c9aadadc4b9359b807f6474f949957178c134edf?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/beb0d49dc4fae5350061b38ae7cd192c6857768e?format=markdown)
