Agent, register the agent with the orchestrator, and add its tool calls to the TOOL_CALLS progress map.
The standard pattern
@function_tool and is_enabled
The @function_tool decorator registers a Python function as a callable tool in the OpenAI Agents SDK. The optional is_enabled parameter accepts a predicate function that determines at runtime whether the tool is available for the current user.
connectors/utils/context.py:
ChatContext
RunContextWrapper[ChatContext] is the first parameter of every tool function. It provides access to the current request’s user, settings, and feature flags.
wrapper.context:
Steps to add a new agent
Create the agent file
Create
connectors/my_service.py. Implement your tool functions and define the Agent object following the pattern above.Import and add to orchestrator handoffs
Open
connectors/orchestrator.py and import your agent, then add it to the handoffs list in both ORCHESTRATOR_AGENT and the Orchestrator class.Add TOOL_CALLS entries
Add an entry for each tool function to the
TOOL_CALLS dict in connectors/orchestrator.py. The value is the progress message shown in the UI while the tool runs. Use None to suppress UI feedback for internal-only tools.Minimal agent example
Here is the smallest valid agent that follows all ODAI conventions:EXAMPLE_AGENT to the orchestrator handoffs and add "greet_user": "Greeting..." to TOOL_CALLS.