opencode
opencode copied to clipboard
fix: prevent model list corruption from SolidJS reactivity
Model store gets fed react proxy objects, so the cache is corrupted on some model changes.
- Deep copy objects when inserting into recent/favorite stores to break reactive proxy references
- Only filter models from provider sections if actually displayed in Recent section
To repeat the existing problem (and show that the new behavior is correct), try this without exiting opencode in between.
- Enter opencode
- /models # and change to a model not on recent list
- /models. # and change back to the previous model again
- /models. # will show that is has lost your first model change.