mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 19:38:30 +08:00
Merge f30d153f97 into 8031ea6d73
This commit is contained in:
commit
f6fb598668
@ -812,10 +812,13 @@ class AdvancedChatAppGenerateTaskPipeline(GraphRuntimeStateSupport):
|
||||
reason=QueueMessageReplaceEvent.MessageReplaceReason.OUTPUT_MODERATION,
|
||||
)
|
||||
|
||||
# Save message unless it has already been persisted on pause.
|
||||
if not self._message_saved_on_pause:
|
||||
with self._database_session() as session:
|
||||
self._save_message(session=session, graph_runtime_state=resolved_state)
|
||||
# Always save the final message state, even if it was already persisted on pause.
|
||||
# The message may have been saved with PAUSED status and empty answer during a
|
||||
# previous pause event — on completion, _save_message transitions PAUSED→NORMAL
|
||||
# and writes the final answer. _save_message is idempotent (SELECT + UPDATE by
|
||||
# message_id), so calling it multiple times is safe.
|
||||
with self._database_session() as session:
|
||||
self._save_message(session=session, graph_runtime_state=resolved_state)
|
||||
|
||||
yield self._message_end_to_stream_response()
|
||||
|
||||
|
||||
@ -69,7 +69,6 @@ from graphon.nodes.llm.exc import (
|
||||
InvalidContextStructureError,
|
||||
LLMNodeError,
|
||||
NoPromptFoundError,
|
||||
VariableNotFoundError,
|
||||
)
|
||||
from graphon.nodes.llm.file_saver import LLMFileSaver
|
||||
from graphon.nodes.llm.node import (
|
||||
@ -922,7 +921,7 @@ def test_fetch_jinja_inputs_serializes_supported_segment_types(llm_node):
|
||||
}
|
||||
|
||||
|
||||
def test_fetch_jinja_inputs_raises_for_missing_variable(llm_node):
|
||||
def test_fetch_jinja_inputs_skips_missing_variable(llm_node):
|
||||
node_data = llm_node.node_data.model_copy(
|
||||
update={
|
||||
"prompt_config": PromptConfig(
|
||||
@ -931,8 +930,8 @@ def test_fetch_jinja_inputs_raises_for_missing_variable(llm_node):
|
||||
}
|
||||
)
|
||||
|
||||
with pytest.raises(VariableNotFoundError, match="Variable missing not found"):
|
||||
llm_node._fetch_jinja_inputs(node_data)
|
||||
result = llm_node._fetch_jinja_inputs(node_data)
|
||||
assert result == {}
|
||||
|
||||
|
||||
def test_fetch_inputs_collects_prompt_and_memory_variables(llm_node):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user