# Handle removed \`IconName\` variants in text thread deserialization \(\#47624\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 0db0cc65d67326baccb890a57fefca135a81fbff

Requested commit: 0db0cc65d67326baccb890a57fefca135a81fbff

Commit: 0db0cc65d67326baccb890a57fefca135a81fbff

Tree: de8179b42d00ffdf9fc95315fb2a6b7358943759

Author: lex00

Committer: GitHub

## Message

````
Handle removed `IconName` variants in text thread deserialization (#47624)

Fixes #41776

## Problem

Old AI Text Thread sessions fail to open from History because the
deserializer fails on unknown icon variants. When icons are removed or
renamed in refactors, old saved threads become unloadable with errors
like:

```
unknown variant `AtSign`, expected one of `Ai`, `AiAnthropic`...
```

## Solution

Added a lenient deserializer for the `icon` field in
`SlashCommandOutputSection` that falls back to `IconName::Code` for
unknown variants.

This ensures old saved threads remain loadable even as icons are
added/removed from the codebase.

## Test Plan

- Added unit test for valid icon deserialization
- Added unit test for unknown icon fallback to `Code`
- Added unit test for various unknown icon variants
- Added unit test confirming serialization unchanged
- All tests pass: `cargo test -p assistant_slash_command`

Release Notes:

- Fixed old AI text thread sessions failing to open from History when
they contain icons that were removed in previous updates.

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: MrSubidubi <finn@zed.dev>
````

## Parents

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

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