You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
forget_replaced_streams matches a selector prefix, so it drops unrelated nested streams #443
latest_streams is keyed by the selector itself (self.latest_streams[selector] = ..., template_stream.py:182), not by a longer tuple - source_streams is the one keyed (execution_id, retry_index, selector). So the [:2] slice belongs to the other dict.
Two consequences, and the second one is the harmful one:
for a two-part selector the comparison is selector[:2] == selector, which is true - so the intended entry is dropped, by accident;
for a selector of three or more parts, ("a", "b", "c")[:2] == ("a", "b") is also true, so replacing a.b also forgets the entry of the unrelated nested stream a.b.c.
FrameSession._replace_values calls this for every variable it sees replaced, so whenever a graph has both a.b and a.b.c as streaming selectors, a replacement on the former takes the latter's pinned stream away with it.
Reproduced directly against _TemplateStream (no engine needed): append one stream per selector, call forget_replaced_streams(("source", "text")), and both entries are gone where only the flat one should be.
Expected
Only the entry whose key equals the selector is dropped; a nested selector keeps its pinned stream.
Fix
Compare the whole key. PR to follow with a regression test.
Activity