# anthropic: Preserve custom model thinking mode after thinking-toggle refactor \(\#52975\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 8420716bd4ac4f6706e818da9605410f501d0246

Requested commit: 8420716bd4ac4f6706e818da9605410f501d0246

Commit: 8420716bd4ac4f6706e818da9605410f501d0246

Tree: e85f51fc252a9b636f6d6b96b01baa86b034e235

Author: Enoch

Committer: GitHub

## Message

```
anthropic: Preserve custom model thinking mode after thinking-toggle refactor (#52975)

PR #51946 broke `Model::Custom` thinking behavior: `mode()`,
`supports_thinking()`, and `supports_adaptive_thinking()` all inferred
capabilities from hardcoded built-in model lists, so any `Custom`
variant always fell back to `Default` regardless of its configured
`mode` field.

### Fixes

- **`Model::mode()`** — `Custom` now short-circuits to `mode.clone()`
before the built-in inference logic
- **`Model::supports_thinking()`** — `Custom` returns `true` when `mode`
is `Thinking { .. }` or `AdaptiveThinking`
- **`Model::supports_adaptive_thinking()`** — `Custom` returns `true`
when `mode` is `AdaptiveThinking`

Built-in model behavior is unchanged.

### Tests

Three regression tests added covering the three `Custom` mode cases:
explicit `Thinking`, `AdaptiveThinking`, and `Default` (which must
disable both flags).

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed custom Anthropic models losing their configured
thinking/adaptive-thinking mode after the thinking-toggle refactor
(#51946)

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
```

## Parents

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

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