Skip to content

Commit 3d2f50b

Browse files
committed
Exercise LangChain server demo in e2e
Constraint: GitHub e2e ignores tests/e2e/integration and filters node ids containing invoke. Rejected: Use real ModelService, sandbox, or MemoryCollection resources | CI should verify SDK wiring without external service flakiness. Confidence: high Scope-risk: narrow Directive: Keep this demo case in a GitHub e2e-collected path and avoid excluded node-id terms. Tested: uv run --python 3.10 --all-extras pytest tests/unittests/integration/test_langchain_convert.py::TestConvertAstreamEventsFormat::test_on_chain_stream_model_command_update_text tests/e2e/test_langchain_server_demo.py -v --tb=short Tested: uv run --python 3.10 --all-extras pytest tests/e2e/ --collect-only -q --ignore=tests/e2e/integration --ignore=tests/e2e/test_agent_ruintime.py --ignore=tests/e2e/test_workspace_id.py --ignore=tests/e2e/test_sandbox_browser.py --ignore=tests/e2e/test_sandbox_code_interpreter.py -k 'not (invoke or with_credential or model_proxy or process_get or delete_sandbox or delete_nonexistent_sandbox or connect_nonexistent or connect_sandbox_async or sandbox_lifecycle or connect_with_wrong_template or template_validation_code_interpreter_network or playwright or browser_recordings or aio_combined_workflow or browser_code_file_integration or aio_lifecycle)' Tested: uv run --python 3.10 --all-extras make mypy-check Tested: uv run --python 3.10 --all-extras make coverage Change-Id: I1769d00572e34d1516fca6e3b4add452122d3c83 Not-tested: Real cloud sandbox and MemoryCollection resources are mocked in the e2e case. Signed-off-by: congxiao.wxx <congxiao.wxx@alibaba-inc.com>
1 parent 3755e4a commit 3d2f50b

3 files changed

Lines changed: 422 additions & 0 deletions

File tree

‎agentrun/integration/langgraph/agent_converter.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,19 @@ def _convert_astream_events_event(
730730
and not self.has_on_chat_model_stream
731731
):
732732
chunk_data = data.get("chunk", {})
733+
messages = []
733734
if isinstance(chunk_data, dict):
734735
messages = chunk_data.get("messages", [])
736+
elif isinstance(chunk_data, list):
737+
for item in chunk_data:
738+
update = getattr(item, "update", None)
739+
if not isinstance(update, dict):
740+
continue
741+
item_messages = update.get("messages", [])
742+
if isinstance(item_messages, list):
743+
messages.extend(item_messages)
735744

745+
if isinstance(messages, list):
736746
for msg in messages:
737747
content = AgentRunConverter._get_message_content(msg)
738748
if content:

0 commit comments

Comments
 (0)