`forget_replaced_streams` matches a selector prefix, so it drops unrelated nested streams
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
The issue identifies _TemplateStream.forget_replaced_streams and says latest_streams is keyed by the selector in template_stream.py:182; start by reading that implementation and the FrameSession._replace_values call site. Add a regression test that replaces ("source", "text") while preserving the pinned stream for a nested selector, then run the relevant tests for template streams.
Written by the indexing model from the issue text.
Description
Problem
_TemplateStream.forget_replaced_streams filters the wrong part of its keys:
def forget_replaced_streams(self, selector: Sequence[str]) -> None:
for key in list(self.latest_streams):
if key[:2] == tuple(selector):
del self.latest_streams[key]
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 replacinga.balso forgets the entry of the unrelated nested streama.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.
- Dominant language
- Python
- Stars
- 90
- Forks
- 47
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from langgenius/graphon
-
Complete LLM results disappear from streamed answersPossibly taken @WH-2099 claimed this 13 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
langgenius/graphon#389 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
bug(utils): parse_json_markdown drops a valid payload when the text contains a backtickPossibly taken @WH-2099 claimed this 9 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
langgenius/graphon#380 · 1 assignee ·
Maintainers usually reply within 2 days
-
project#graphon
Difficulty 4/5 3-5 days Newbie friendliness 40/100
langgenius/graphon#442 ·
Maintainers usually reply within 2 days
-
project#graphon
Difficulty 3/5 1-2 days Newbie friendliness 50/100
langgenius/graphon#438 · 1 comment ·
Maintainers usually reply within 2 days
-
project#graphon
Difficulty 5/5 Over a week Newbie friendliness 8/100
langgenius/graphon#436 · 3 comments ·
Maintainers usually reply within 2 days
All issues in langgenius/graphon
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
micronaut-projects/micronaut-core#14585 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
[BUG]: Management endpoints /v1/memory/stats and /v1/memory/counts bypass API key authenticationOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
docling-project/docling-serve#788 ·
Maintainers usually reply within 1 day
-
Mend: dependency security vulnerability untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
opensearch-project/cross-cluster-replication#1805 ·
Maintainers usually reply within 1 day
-
load_advbench() re-raises HTTPError as the bare class, so a failed download ends in a TypeErrorOpenneeds-triage
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 2 days