We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fcc21a6 commit 177d11aCopy full SHA for 177d11a
src/agents/agent.py
@@ -479,7 +479,12 @@ async def run_agent(context: ToolContext, input: str) -> Any:
479
from .tool_context import ToolContext
480
481
resolved_max_turns = max_turns if max_turns is not None else DEFAULT_MAX_TURNS
482
- nested_context = context if isinstance(context, RunContextWrapper) else context
+ if isinstance(context, ToolContext):
483
+ nested_context = context
484
+ elif isinstance(context, RunContextWrapper):
485
+ nested_context = context.context
486
+ else:
487
488
run_result: RunResult | RunResultStreaming
489
490
if on_stream is not None:
0 commit comments