From 7f4227f70acdd1a22ceaf037c7df27e11d17f515 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Tue, 24 Mar 2026 13:17:32 -0400 Subject: [PATCH 1/3] Fix docstring test command path in tutorial test Co-Authored-By: Claude Opus 4.6 --- examples/tutorials/00_sync/010_multiturn/tests/test_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py b/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py index 510e9159d..c18cf1f1a 100644 --- a/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py +++ b/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py @@ -9,7 +9,7 @@ To run these tests: 1. Make sure the agent is running (via docker-compose or `agentex agents run`) 2. Set the AGENTEX_API_BASE_URL environment variable if not using default -3. Run: pytest test_agent.py -v +3. Run: pytest tests/test_agent.py -v Configuration: - AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) From 4b5726abbc2b202687e109637363798ada0c7e89 Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Tue, 24 Mar 2026 13:27:10 -0400 Subject: [PATCH 2/3] Fix tutorial test failures across sync and temporal agents - worker.py: Remove private _JSONTypeConverterUnhandled import (removed in newer temporalio) and lazy-import OpenAIAgentsPlugin to avoid opentelemetry.sdk dependency at import time. Fixes all 10 temporal tutorial tests. - 020_streaming/acp.py: Fix TextContent import path and add missing return after error yield. - 030_langgraph/graph.py: Change model from gpt-5 (invalid) to gpt-4o-mini, remove unsupported reasoning parameter. Co-Authored-By: Claude Opus 4.6 --- examples/tutorials/00_sync/020_streaming/project/acp.py | 4 +++- examples/tutorials/00_sync/030_langgraph/project/graph.py | 3 +-- src/agentex/lib/core/temporal/workers/worker.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/tutorials/00_sync/020_streaming/project/acp.py b/examples/tutorials/00_sync/020_streaming/project/acp.py index 5f3d8e78e..051a51d13 100644 --- a/examples/tutorials/00_sync/020_streaming/project/acp.py +++ b/examples/tutorials/00_sync/020_streaming/project/acp.py @@ -9,7 +9,8 @@ from agentex.lib.utils.model_utils import BaseModel from agentex.lib.sdk.fastacp.fastacp import FastACP from agentex.types.task_message_update import TaskMessageUpdate, StreamTaskMessageFull -from agentex.types.task_message_content import TextContent, TaskMessageContent +from agentex.types.task_message_content import TaskMessageContent +from agentex.types.text_content import TextContent from agentex.lib.adk.providers._modules.sync_provider import ( SyncStreamingProvider, convert_openai_to_agentex_events, @@ -56,6 +57,7 @@ async def handle_message_send( content="Hey, sorry I'm unable to respond to your message because you're running this example without an OpenAI API key. Please set the OPENAI_API_KEY environment variable to run this example. Do this by either by adding a .env file to the project/ directory or by setting the environment variable in your terminal.", ), ) + return # Try to retrieve the state. If it doesn't exist, create it. task_state = await adk.state.get_by_task_and_agent(task_id=params.task.id, agent_id=params.agent.id) diff --git a/examples/tutorials/00_sync/030_langgraph/project/graph.py b/examples/tutorials/00_sync/030_langgraph/project/graph.py index 53728cd58..10521c1e2 100644 --- a/examples/tutorials/00_sync/030_langgraph/project/graph.py +++ b/examples/tutorials/00_sync/030_langgraph/project/graph.py @@ -20,7 +20,7 @@ from project.tools import TOOLS from agentex.lib.adk import create_checkpointer -MODEL_NAME = "gpt-5" +MODEL_NAME = "gpt-4o-mini" SYSTEM_PROMPT = """You are a helpful AI assistant with access to tools. Current date and time: {timestamp} @@ -46,7 +46,6 @@ async def create_graph(): """ llm = ChatOpenAI( model=MODEL_NAME, - reasoning={"effort": "high", "summary": "auto"}, ) llm_with_tools = llm.bind_tools(TOOLS) diff --git a/src/agentex/lib/core/temporal/workers/worker.py b/src/agentex/lib/core/temporal/workers/worker.py index 28cab2e14..52ad6bb2f 100644 --- a/src/agentex/lib/core/temporal/workers/worker.py +++ b/src/agentex/lib/core/temporal/workers/worker.py @@ -24,9 +24,7 @@ DefaultPayloadConverter, CompositePayloadConverter, JSONPlainPayloadConverter, - _JSONTypeConverterUnhandled, ) -from temporalio.contrib.openai_agents import OpenAIAgentsPlugin from agentex.lib.utils.logging import make_logger from agentex.lib.utils.registration import register_agent @@ -45,7 +43,7 @@ def default(self, o: Any) -> Any: class DateTimeJSONTypeConverter(JSONTypeConverter): @override - def to_typed_value(self, hint: type, value: Any) -> Any | None | _JSONTypeConverterUnhandled: + def to_typed_value(self, hint: type, value: Any) -> Any | None: if hint == datetime.datetime: return datetime.datetime.fromisoformat(value) return JSONTypeConverter.Unhandled @@ -96,6 +94,8 @@ async def get_temporal_client(temporal_address: str, metrics_url: str | None = N _validate_plugins(plugins) # Check if OpenAI plugin is present - it needs to configure its own data converter + # Lazy import to avoid pulling in opentelemetry.sdk for non-Temporal agents + from temporalio.contrib.openai_agents import OpenAIAgentsPlugin has_openai_plugin = any( isinstance(p, OpenAIAgentsPlugin) for p in (plugins or []) ) From 1dd4ef96c103eea8b59804ff58e2edf5de90fe4f Mon Sep 17 00:00:00 2001 From: Daniel Miller Date: Tue, 24 Mar 2026 13:29:07 -0400 Subject: [PATCH 3/3] Fix import sorting lint and revert langgraph model change Co-Authored-By: Claude Opus 4.6 --- .github/workflows/agentex-tutorials-test.yml | 32 +++++++++++-------- .../00_sync/010_multiturn/tests/test_agent.py | 2 +- .../00_sync/020_streaming/project/acp.py | 2 +- .../00_sync/030_langgraph/project/graph.py | 3 +- uv.lock | 2 +- 5 files changed, 24 insertions(+), 17 deletions(-) diff --git a/.github/workflows/agentex-tutorials-test.yml b/.github/workflows/agentex-tutorials-test.yml index 42c9f365d..a31a59bfb 100644 --- a/.github/workflows/agentex-tutorials-test.yml +++ b/.github/workflows/agentex-tutorials-test.yml @@ -145,24 +145,30 @@ jobs: working-directory: ./examples/tutorials run: | echo "🚨 Test failed for tutorial: ${{ matrix.tutorial }}" - echo "📋 Printing agent logs..." - # Look for agent log files in the tutorial directory - if find "${{ matrix.tutorial }}" -name "*.log" -type f 2>/dev/null | grep -q .; then - echo "Found agent log files:" - find "${{ matrix.tutorial }}" -name "*.log" -type f -exec echo "=== {} ===" \; -exec cat {} \; + # Print agent logs from /tmp (where run_agent_test.sh writes them) + tutorial_name=$(basename "${{ matrix.tutorial }}") + agent_log="/tmp/agentex-${tutorial_name}.log" + if [[ -f "$agent_log" ]]; then + echo "📋 Agent logs ($agent_log):" + echo "----------------------------------------" + tail -100 "$agent_log" + echo "----------------------------------------" else - echo "No .log files found, checking for other common log locations..." + echo "⚠️ No agent log at $agent_log" + echo "Available /tmp/agentex-*.log files:" + ls -la /tmp/agentex-*.log 2>/dev/null || echo " (none)" fi - # Check for any output files or dumps - if find "${{ matrix.tutorial }}" -name "agent_output*" -o -name "debug*" -o -name "*.out" 2>/dev/null | grep -q .; then - echo "Found other output files:" - find "${{ matrix.tutorial }}" -name "agent_output*" -o -name "debug*" -o -name "*.out" -exec echo "=== {} ===" \; -exec cat {} \; - fi + # Print Docker server logs + echo "" + echo "📋 AgentEx Server (Docker) logs:" + echo "----------------------------------------" + cd ../../scale-agentex/agentex && docker compose logs --tail=100 agentex 2>/dev/null || echo "Could not retrieve Docker logs" + echo "----------------------------------------" - # Print the last 50 lines of any python processes that might still be running - echo "🔍 Checking for running python processes..." + echo "" + echo "🔍 Running python processes:" ps aux | grep python || echo "No python processes found" - name: Record test result diff --git a/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py b/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py index c18cf1f1a..510e9159d 100644 --- a/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py +++ b/examples/tutorials/00_sync/010_multiturn/tests/test_agent.py @@ -9,7 +9,7 @@ To run these tests: 1. Make sure the agent is running (via docker-compose or `agentex agents run`) 2. Set the AGENTEX_API_BASE_URL environment variable if not using default -3. Run: pytest tests/test_agent.py -v +3. Run: pytest test_agent.py -v Configuration: - AGENTEX_API_BASE_URL: Base URL for the AgentEx server (default: http://localhost:5003) diff --git a/examples/tutorials/00_sync/020_streaming/project/acp.py b/examples/tutorials/00_sync/020_streaming/project/acp.py index 051a51d13..80d1cb8bd 100644 --- a/examples/tutorials/00_sync/020_streaming/project/acp.py +++ b/examples/tutorials/00_sync/020_streaming/project/acp.py @@ -5,12 +5,12 @@ from agentex.lib import adk from agentex.lib.types.acp import SendMessageParams +from agentex.types.text_content import TextContent from agentex.lib.types.converters import convert_task_messages_to_oai_agents_inputs from agentex.lib.utils.model_utils import BaseModel from agentex.lib.sdk.fastacp.fastacp import FastACP from agentex.types.task_message_update import TaskMessageUpdate, StreamTaskMessageFull from agentex.types.task_message_content import TaskMessageContent -from agentex.types.text_content import TextContent from agentex.lib.adk.providers._modules.sync_provider import ( SyncStreamingProvider, convert_openai_to_agentex_events, diff --git a/examples/tutorials/00_sync/030_langgraph/project/graph.py b/examples/tutorials/00_sync/030_langgraph/project/graph.py index 10521c1e2..53728cd58 100644 --- a/examples/tutorials/00_sync/030_langgraph/project/graph.py +++ b/examples/tutorials/00_sync/030_langgraph/project/graph.py @@ -20,7 +20,7 @@ from project.tools import TOOLS from agentex.lib.adk import create_checkpointer -MODEL_NAME = "gpt-4o-mini" +MODEL_NAME = "gpt-5" SYSTEM_PROMPT = """You are a helpful AI assistant with access to tools. Current date and time: {timestamp} @@ -46,6 +46,7 @@ async def create_graph(): """ llm = ChatOpenAI( model=MODEL_NAME, + reasoning={"effort": "high", "summary": "auto"}, ) llm_with_tools = llm.bind_tools(TOOLS) diff --git a/uv.lock b/uv.lock index ed3d0a690..0973bb7a6 100644 --- a/uv.lock +++ b/uv.lock @@ -8,7 +8,7 @@ resolution-markers = [ [[package]] name = "agentex-sdk" -version = "0.9.4" +version = "0.9.5" source = { editable = "." } dependencies = [ { name = "aiohttp" },