Skip to content

Commit 0bda3d8

Browse files
danielmillerpclaude
andcommitted
Fix missing imports in sync-openai-agents template
The sync-openai-agents template uses StreamTaskMessageFull and TextContent in the no-API-key error path but never imports them, causing a NameError at runtime. Also adds a missing return after the error yield. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b1f5ff8 commit 0bda3d8

File tree

1 file changed

+3
-1
lines changed
  • src/agentex/lib/cli/templates/sync-openai-agents/project

1 file changed

+3
-1
lines changed

src/agentex/lib/cli/templates/sync-openai-agents/project/acp.py.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ from agentex.lib.core.tracing.tracing_processor_manager import add_tracing_proce
99
from agentex.lib.types.tracing import SGPTracingProcessorConfig
1010
from agentex.lib.utils.model_utils import BaseModel
1111

12-
from agentex.types.task_message_update import TaskMessageUpdate
12+
from agentex.types.task_message_update import TaskMessageUpdate, StreamTaskMessageFull
1313
from agentex.types.task_message_content import TaskMessageContent
14+
from agentex.types.text_content import TextContent
1415
from agentex.lib.utils.logging import make_logger
1516
from agents import Agent, Runner, RunConfig, function_tool
1617

@@ -83,6 +84,7 @@ async def handle_message_send(
8384
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.",
8485
),
8586
)
87+
return
8688

8789
user_prompt = params.content.content
8890

0 commit comments

Comments
 (0)