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/020_streaming/project/acp.py b/examples/tutorials/00_sync/020_streaming/project/acp.py index 5f3d8e78e..80d1cb8bd 100644 --- a/examples/tutorials/00_sync/020_streaming/project/acp.py +++ b/examples/tutorials/00_sync/020_streaming/project/acp.py @@ -5,11 +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 TextContent, TaskMessageContent +from agentex.types.task_message_content import TaskMessageContent 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/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 []) ) 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" },