Skip to content

Rebuild immutable NamedModel through __init__ when unpickled - #5301

Merged
trissim merged 1 commit into
mainfrom
fix/named-model-pickle
Nov 28, 2026
Merged

trissim merged 1 commit into
mainfrom
fix/named-model-pickle

Conversation

@trissim

@trissim trissim commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

The GUI observation pipe failed every few seconds with
'AttributeError: DeclaredModel is immutable': default slot-state unpickling
restores 'text' through setattr, which NamedModel refuses. Add reduce
so DeclaredModel and ChosenModel round-trip through their constructors.

The GUI observation pipe failed every few seconds with
'AttributeError: DeclaredModel is immutable': default slot-state unpickling
restores 'text' through __setattr__, which NamedModel refuses. Add __reduce__
so DeclaredModel and ChosenModel round-trip through their constructors.
@trissim
trissim enabled auto-merge November 28, 2026 18:10
@trissim
trissim merged commit 695ef16 into main Nov 28, 2026
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant