Handle removed IconName variants in text thread deserialization#47624
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @lex00 on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
Full disclosure, this PR was built by an "intent automation" framework I am testing. If the quality is satisfactory I would be willing to attempt to resolve more issues with it. If there are some that you would like to see done sooner please send them to me, thank you. |
IconName variants in text thread deserialization
MrSubidubi
left a comment
There was a problem hiding this comment.
Thanks for this!
Lets change this slightly so that we only handle the serde-case here and do not care about the strum-style. Otherwise looks good!
b1cbfb7 to
a37af15
Compare
Fixes zed-industries#41776 Old AI Text Thread sessions fail to open from History because the deserializer fails on unknown icon variants (e.g., icons that were removed in refactors). This adds a lenient deserializer for the `icon` field in `SlashCommandOutputSection` that falls back to `IconName::Code` for unknown variants. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
a37af15 to
be72006
Compare
MrSubidubi
left a comment
There was a problem hiding this comment.
Added some minor last changes, but looks good now. Thank you for looking into this and congratulations to your first contribution! 🎉
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:
Solution
Added a lenient deserializer for the
iconfield inSlashCommandOutputSectionthat falls back toIconName::Codefor unknown variants.This ensures old saved threads remain loadable even as icons are added/removed from the codebase.
Test Plan
Codecargo test -p assistant_slash_commandRelease Notes:
🤖 Generated with Claude Code