Skip to content

Commit d73c1b0

Browse files
authored
Merge pull request #77 from scaleapi/jason/fixes-oai
Adding openai fixes
2 parents d1f05d3 + 175317e commit d73c1b0

File tree

11 files changed

+22
-20
lines changed

11 files changed

+22
-20
lines changed

examples/tutorials/10_agentic/10_temporal/000_hello_acp/project/run_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from agentex.lib.utils.debug import setup_debug_if_enabled
77
from agentex.lib.environment_variables import EnvironmentVariables
88

9-
from workflow import At000HelloAcpWorkflow
9+
from project.workflow import At000HelloAcpWorkflow
1010

1111

1212

examples/tutorials/10_agentic/10_temporal/010_agent_chat/project/run_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from agentex.lib.utils.debug import setup_debug_if_enabled
77
from agentex.lib.environment_variables import EnvironmentVariables
88

9-
from workflow import At010AgentChatWorkflow
9+
from project.workflow import At010AgentChatWorkflow
1010

1111

1212

examples/tutorials/10_agentic/10_temporal/020_state_machine/project/run_worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from agentex.lib.utils.debug import setup_debug_if_enabled
77
from agentex.lib.environment_variables import EnvironmentVariables
88

9-
from workflow import At020StateMachineWorkflow
9+
from project.workflow import At020StateMachineWorkflow
1010

1111

1212
environment_variables = EnvironmentVariables.refresh()

examples/tutorials/10_agentic/10_temporal/020_state_machine/project/workflow.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
from agentex.lib.environment_variables import EnvironmentVariables
1313
from agentex.lib.sdk.state_machine.state import State
1414

15-
from state_machines.deep_research import DeepResearchStateMachine, DeepResearchState, DeepResearchData
16-
from workflows.deep_research.clarify_user_query import ClarifyUserQueryWorkflow
17-
from workflows.deep_research.waiting_for_user_input import WaitingForUserInputWorkflow
18-
from workflows.deep_research.performing_deep_research import PerformingDeepResearchWorkflow
15+
from project.state_machines.deep_research import DeepResearchStateMachine, DeepResearchState, DeepResearchData
16+
from project.workflows.deep_research.clarify_user_query import ClarifyUserQueryWorkflow
17+
from project.workflows.deep_research.waiting_for_user_input import WaitingForUserInputWorkflow
18+
from project.workflows.deep_research.performing_deep_research import PerformingDeepResearchWorkflow
1919

2020
environment_variables = EnvironmentVariables.refresh()
2121

examples/tutorials/10_agentic/10_temporal/020_state_machine/project/workflows/deep_research/clarify_user_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from agentex.lib.types.llm_messages import LLMConfig, SystemMessage, UserMessage
77
from agentex.lib.utils.logging import make_logger
88

9-
from state_machines.deep_research import DeepResearchData, DeepResearchState
9+
from project.state_machines.deep_research import DeepResearchData, DeepResearchState
1010

1111
logger = make_logger(__name__)
1212

examples/tutorials/10_agentic/10_temporal/020_state_machine/project/workflows/deep_research/performing_deep_research.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from agentex.types.text_content import TextContent
1111
from agentex.lib.utils.logging import make_logger
1212

13-
from state_machines.deep_research import DeepResearchData, DeepResearchState
13+
from project.state_machines.deep_research import DeepResearchData, DeepResearchState
1414

1515
logger = make_logger(__name__)
1616

examples/tutorials/10_agentic/10_temporal/020_state_machine/project/workflows/deep_research/waiting_for_user_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from agentex.lib.sdk.state_machine import StateWorkflow, StateMachine
33
from agentex.lib.utils.logging import make_logger
44
from temporalio import workflow
5-
from state_machines.deep_research import DeepResearchData, DeepResearchState
5+
from project.state_machines.deep_research import DeepResearchData, DeepResearchState
66

77
logger = make_logger(__name__)
88

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ dependencies = [
3232
"jinja2>=3.1.3,<4",
3333
"mcp[cli]>=1.4.1",
3434
"scale-gp>=0.1.0a59",
35-
"openai-agents>=0.0.7,!=0.2.3", # 0.2.3 bug - https://github.com/openai/openai-agents-python/issues/1276
35+
"openai-agents==0.2.7", # 0.2.3 bug - https://github.com/openai/openai-agents-python/issues/1276
3636
"tzlocal>=5.3.1",
3737
"tzdata>=2025.2",
3838
"pytest>=8.4.0",

src/agentex/lib/cli/handlers/run_handlers.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@ async def start_temporal_worker_with_reload(
8989
worker_path: Path, env: dict[str, str], process_manager: ProcessManager, manifest_dir: Path
9090
) -> asyncio.Task[None]:
9191
"""Start temporal worker with auto-reload using watchfiles"""
92-
9392
try:
9493
from watchfiles import awatch
9594
except ImportError:
9695
console.print("[yellow]watchfiles not installed, falling back to basic worker start[/yellow]")
9796
console.print("[dim]Install with: pip install watchfiles[/dim]")
9897
# Fallback to regular worker without reload
99-
worker_process = await start_temporal_worker(worker_path, env)
98+
worker_process = await start_temporal_worker(worker_path, env, manifest_dir)
10099
process_manager.add_process(worker_process)
101100
return asyncio.create_task(stream_process_output(worker_process, "WORKER"))
102101

@@ -114,6 +113,7 @@ async def start_worker() -> asyncio.subprocess.Process:
114113
# Extract agent name from worker path for cleanup
115114

116115
agent_name = env.get("AGENT_NAME")
116+
console.print(f"FOUND AGENT_NAME FROM ENV VARS: {agent_name} {agent_name is None}")
117117
if agent_name is None:
118118
agent_name = worker_path.parent.parent.name
119119

@@ -150,12 +150,12 @@ async def start_worker() -> asyncio.subprocess.Process:
150150

151151
try:
152152
# Start initial worker
153-
await start_worker()
153+
current_process = await start_worker()
154154
if current_process:
155155
output_task = asyncio.create_task(stream_process_output(current_process, "WORKER"))
156156

157157
# Watch for file changes
158-
async for changes in awatch(worker_path.parent):
158+
async for changes in awatch(manifest_dir, recursive=True):
159159
# Filter for Python files
160160
py_changes = [(change, path) for change, path in changes if str(path).endswith('.py')]
161161

@@ -225,7 +225,9 @@ async def start_temporal_worker(
225225
worker_path: Path, env: dict[str, str], manifest_dir: Path
226226
) -> asyncio.subprocess.Process:
227227
"""Start the temporal worker process"""
228-
cmd = [sys.executable, "-m", "run_worker"]
228+
run_worker_target = calculate_uvicorn_target_for_local(worker_path, manifest_dir)
229+
230+
cmd = [sys.executable, "-m", run_worker_target]
229231

230232
console.print(f"[blue]Starting Temporal worker from {worker_path}...[/blue]")
231233

src/agentex/lib/core/services/adk/providers/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ async def run_agent_streamed_auto_send(
656656
reasoning_content = ReasoningContent(
657657
author="agent",
658658
summary=[summary.text for summary in reasoning_item.summary],
659-
content=[content.text for content in reasoning_item.content] if reasoning_item.content else None,
659+
content=[content.text for content in reasoning_item.content] if hasattr(reasoning_item, "content") else None,
660660
)
661661

662662
# Create reasoning content using streaming context (immediate completion)

0 commit comments

Comments
 (0)