Conversation
Some providers materialize every SessionTask schema key with empty values, so send carried "model":"" even when the assistant intended to omit it. The presence-based guard rejected those deliveries with INVALID_ARGUMENT — 36 of 38 send calls on one provider/model pairing (vastsa/PI-Desktop#978). spawn already treats "" as absent via optionalText; the send guard now matches that semantics. A non-empty model still conflicts with the session's model.
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.
Fixes the send-half of vastsa/PI-Desktop#978 (empty-value materialization of the SessionTask schema).
Problem
The send guard is presence-based:
args.model !== undefinedrejects with INVALID_ARGUMENT. Some provider/model pairings materialize every schema key with empty values, so a send that was meant to omitmodelstill carried"model":""and was rejected — 36 of 38 send calls on the reported pairing.Fix
spawn already treats
""as absent viaoptionalText(models.js). The send guard now matches that semantics: only a non-emptymodelconflicts with the session's existing model. A real reselection attempt is still rejected, unchanged.Tests
any existing session supports bidirectional messages without reselecting models: a send withmodel: ""succeeds and the session keeps its existing model; a non-emptymodelstill rejects with INVALID_ARGUMENT.node --test test/: 39/39 passed.