fix(conversation): Recover stored configs field by field - #1102
Open
JeanMertz wants to merge 2 commits into
Open
fix(conversation): Recover stored configs field by field#1102JeanMertz wants to merge 2 commits into
JeanMertz wants to merge 2 commits into
Conversation
A stored conversation config whose field types no longer match keeps everything that still parses. A field whose type changed, an enum variant that was renamed, or a validator that was tightened costs that one field instead of the whole config, and the conversation keeps loading. Deserialization runs in a loop: each failure names a path, that entry is dropped with a warning naming it, and the value is parsed again. The empty-config fallback is reached only when a failure names nothing addressable. That fallback was always close to useless as a recovery — `assistant.model.id.provider` and `conversation.tools.'*'.run` are required and have no default, so an empty config cannot be finalized and the conversation fails to load anyway. Paths that end in an enum or unknown segment are truncated to the last addressable entry and that is dropped instead, which discards more than the failure named but keeps the config around it. Config deltas recorded in the event stream take the same path, so a single unreadable delta no longer empties itself. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A stored conversation config whose field types no longer match keeps everything that still parses. A field whose type changed, an enum variant that was renamed, or a validator that was tightened costs that one field instead of the whole config, and the conversation keeps loading.
Deserialization runs in a loop: each failure names a path, that entry is dropped with a warning naming it, and the value is parsed again. The empty-config fallback is reached only when a failure names nothing addressable. That fallback was always close to useless as a recovery —
assistant.model.id.providerandconversation.tools.'*'.runare required and have no default, so an empty config cannot be finalized and the conversation fails to load anyway.Paths that end in an enum or unknown segment are truncated to the last addressable entry and that is dropped instead, which discards more than the failure named but keeps the config around it. Config deltas recorded in the event stream take the same path, so a single unreadable delta no longer empties itself.