opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: prevent model list corruption from SolidJS reactivity

Open joachim-isaksson opened this issue 3 weeks ago • 2 comments

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.

joachim-isaksson avatar Dec 29 '25 14:12 joachim-isaksson