Second root Answer omits LLM text already streamed by the first Answer
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 68/100
Direzione di ricerca
Start from the repro script in the issue or run tests/engine/test_response_stream_filter.py around lines 1366-1405, then inspect src/graphon/engine/filter/builtin/response_stream/template_stream.py near lines 394-419 where the filter tracks its read position per selector. Trace how the closed llm.text cursor is reused by the second Answer. Done means the concatenated NodeRunStreamChunkEvent chunks read first:value|next:value while the second Answer's saved output remains next:value.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
AI disclosure — Codex (gpt-6.2-astra) helped draft and verify this report. I reviewed the underlying behavior and am responsible for the report.
Description
When two root Answer nodes each reference {{#llm.text#}} once, the second Answer saves the full text but its streamed reply omits the LLM output. This reproduces on main (2e8b664) and on #395 (02e7e19).
Minimal reproduction
- Connect four nodes in sequence:
Start → LLM → First Answer → Second Answer. Give the LLM node the IDllmand have it stream the textvalue. - Set the first Answer template to
first:{{#llm.text#}}|and the second tonext:{{#llm.text#}}. - Run the graph with
ResponseStreamFilterand concatenate the emittedNodeRunStreamChunkEvent.chunkstrings.
| Expected | Actual | |
|---|---|---|
| Streamed text | first:value|next:value |
first:value|next: |
Second Answer's saved answer output |
next:value |
next:value |
Runnable example with an in-process model stub
Run from the Graphon repository root with the development dependencies installed. The script uses the existing Slim LLM example graph and supplies one model token locally.
PYTHONPATH=.:src uv run python - <<'PY'
from pathlib import Path
from unittest.mock import patch
import yaml
from graphon.dsl import loads
from graphon.engine.filter import (
EngineEventFilterContext, ResponseStreamFilter, filter_engine_events,
)
from graphon.engine_events.node import NodeRunStreamChunkEvent
from graphon.model_runtime.entities.llm_entities import LLMResultChunk, LLMResultChunkDelta
from graphon.model_runtime.entities.message_entities import AssistantPromptMessage
from tests.helpers.workflow_events import FakeSlimLLM
dsl = yaml.safe_load(Path("examples/slim_llm/graph.yml").read_text())
graph = dsl["graph"]
first = next(node for node in graph["nodes"] if node["id"] == "answer")
first["data"]["answer"] = "first:{{#llm.text#}}|"
graph["nodes"].append({
"id": "second", "data": {"type": "answer", "answer": "next:{{#llm.text#}}"},
})
graph["edges"].append({"source": "answer", "target": "second"})
token = LLMResultChunk(
model="gpt-4o-mini",
delta=LLMResultChunkDelta(index=0, message=AssistantPromptMessage(content="value")),
)
credentials = {"model_credentials": [{"vendor": "openai", "values": {"openai_api_key": "unused"}}]}
with (
patch("graphon.dsl.node_factory.SlimLLM", FakeSlimLLM),
patch.object(FakeSlimLLM, "invoke_llm", return_value=iter([token])),
):
engine = loads(yaml.safe_dump(dsl), credentials=credentials, start_inputs={"query": "test"})
events = filter_engine_events(
engine.run(),
context=EngineEventFilterContext.from_engine(engine),
filters=[ResponseStreamFilter()],
)
text = "".join(event.chunk for event in events if isinstance(event, NodeRunStreamChunkEvent))
print("Stream:", repr(text))
print("Second Answer:", repr(engine.runtime_state.variable_pool.get(["second", "answer"]).value))
PY
The root response filter stores its read position per selector. After the first Answer consumes the closed llm.text stream, the second Answer sees the same exhausted cursor and advances past its placeholder. The existing filter test also records the single-reference second reply ending at next:. Filter implementation · Existing test
Tracked separately as a non-blocking follow-up to #395.
- Lingua principale
- Python
- Stelle
- 90
- Fork
- 47
- Merge medio
- 3g 23h
- PR unite (30g)
- 19
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di langgenius/graphon
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
langgenius/graphon#443 ·
I maintainer di solito rispondono entro 2 giorni
-
Complete LLM results disappear from streamed answersForse già presa @WH-2099 l’ha presa 14 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
langgenius/graphon#389 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
bug(utils): parse_json_markdown drops a valid payload when the text contains a backtickForse già presa @WH-2099 l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
langgenius/graphon#380 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
project#graphon
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
langgenius/graphon#442 ·
I maintainer di solito rispondono entro 2 giorni
-
project#graphon
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
langgenius/graphon#438 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di langgenius/graphon
Issue simili
-
Task select patterns with uppercase letters never matchForse già presa @manobhisriram l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
app: scripts status: backlog type: housekeeping
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
netbox-community/netbox-scripts#239 ·
I maintainer di solito rispondono entro 1 giorno
-
Lambda deploys fail once the bundle grows by about 254 KBForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
developmentseed/titiler-cmr#341 ·
I maintainer di solito rispondono entro 1 giorno
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersForse già presa @omkarbandikatte l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno