SYMBOL INDEX (6257 symbols across 466 files) FILE: .github/scripts/pr_labels.py class PRContext (line 65) | class PRContext: function read_file_at (line 70) | def read_file_at(commit: str | None, path: str) -> str | None: function dependency_lines_for_pyproject (line 79) | def dependency_lines_for_pyproject(text: str) -> set[int]: function pyproject_dependency_changed (line 117) | def pyproject_dependency_changed( function infer_specific_feature_labels (line 180) | def infer_specific_feature_labels(changed_files: Sequence[str]) -> set[s... function infer_feature_labels (line 205) | def infer_feature_labels(changed_files: Sequence[str]) -> set[str]: function infer_fallback_labels (line 218) | def infer_fallback_labels(changed_files: Sequence[str]) -> set[str]: function load_json (line 222) | def load_json(path: pathlib.Path) -> Any: function load_pr_context (line 226) | def load_pr_context(path: pathlib.Path) -> PRContext: function load_codex_labels (line 248) | def load_codex_labels(path: pathlib.Path) -> tuple[list[str], bool]: function fetch_existing_labels (line 274) | def fetch_existing_labels(pr_number: str) -> set[str]: function infer_title_intent_labels (line 282) | def infer_title_intent_labels(pr_context: PRContext) -> set[str]: function compute_desired_labels (line 295) | def compute_desired_labels( function compute_managed_labels (line 340) | def compute_managed_labels( function parse_args (line 355) | def parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace: function main (line 380) | def main(argv: Sequence[str] | None = None) -> int: FILE: .github/scripts/select-release-milestone.py function warn (line 13) | def warn(message: str) -> None: function parse_version (line 17) | def parse_version(value: str | None) -> tuple[int, int, int] | None: function latest_tag_version (line 29) | def latest_tag_version(exclude_version: tuple[int, int, int] | None) -> ... function classify_bump (line 48) | def classify_bump( function parse_milestone_title (line 64) | def parse_milestone_title(title: str | None) -> tuple[int, int] | None: function fetch_open_milestones (line 73) | def fetch_open_milestones(owner: str, repo: str, token: str) -> list[dict]: function select_milestone (line 90) | def select_milestone(milestones: list[dict], required_bump: str) -> str ... function main (line 138) | def main() -> int: FILE: docs/scripts/generate_ref_files.py function to_identifier (line 22) | def to_identifier(py_path: Path) -> str: function md_target (line 28) | def md_target(py_path: Path) -> Path: function pretty_title (line 34) | def pretty_title(last_segment: str) -> str: function main (line 46) | def main() -> None: FILE: docs/scripts/translate_docs.py function built_instructions (line 185) | def built_instructions(target_language: str, lang_code: str) -> str: function translate_file (line 296) | def translate_file(file_path: str, target_path: str, lang_code: str) -> ... function git_last_commit_timestamp (line 374) | def git_last_commit_timestamp(path: str) -> int: function should_translate_based_on_translation (line 393) | def should_translate_based_on_translation(file_path: str) -> bool: function translate_single_source_file (line 405) | def translate_single_source_file( function normalize_source_file_arg (line 426) | def normalize_source_file_arg(file_arg: str) -> str: function translate_source_files (line 434) | def translate_source_files( function main (line 459) | def main(): FILE: examples/agent_patterns/agents_as_tools.py function main (line 59) | async def main(): FILE: examples/agent_patterns/agents_as_tools_conditional.py class AppContext (line 16) | class AppContext(BaseModel): function french_spanish_enabled (line 20) | def french_spanish_enabled(ctx: RunContextWrapper[AppContext], agent: Ag... function european_enabled (line 25) | def european_enabled(ctx: RunContextWrapper[AppContext], agent: AgentBas... function get_user_name (line 31) | async def get_user_name() -> str: function main (line 83) | async def main(): FILE: examples/agent_patterns/agents_as_tools_streaming.py function billing_status_checker (line 10) | def billing_status_checker(customer_id: str | None = None, question: str... function handle_stream (line 18) | def handle_stream(event: AgentToolStreamEvent) -> None: function main (line 26) | async def main() -> None: FILE: examples/agent_patterns/agents_as_tools_structured.py class TranslationInput (line 12) | class TranslationInput(BaseModel): function main (line 53) | async def main() -> None: FILE: examples/agent_patterns/deterministic.py class OutlineCheckerOutput (line 24) | class OutlineCheckerOutput(BaseModel): function main (line 42) | async def main(): FILE: examples/agent_patterns/forcing_tool_use.py class Weather (line 40) | class Weather(BaseModel): function get_weather (line 47) | def get_weather(city: str) -> Weather: function custom_tool_use_behavior (line 52) | async def custom_tool_use_behavior( function main (line 61) | async def main(tool_use_behavior: Literal["default", "first_tool", "cust... function auto_demo (line 85) | async def auto_demo() -> None: FILE: examples/agent_patterns/human_in_the_loop.py function get_weather (line 19) | async def get_weather(city: str) -> str: function _needs_temperature_approval (line 31) | async def _needs_temperature_approval(_ctx, params, _call_id) -> bool: function get_temperature (line 40) | async def get_temperature(city: str) -> str: function confirm (line 65) | async def confirm(question: str) -> bool: function main (line 77) | async def main(): FILE: examples/agent_patterns/human_in_the_loop_custom_rejection.py function tool_error_formatter (line 24) | async def tool_error_formatter(args: ToolErrorFormatterArgs[None]) -> st... function publish_announcement (line 33) | async def publish_announcement(title: str, body: str) -> str: function _find_formatter_output (line 38) | def _find_formatter_output(result: object) -> str | None: function main (line 52) | async def main() -> None: FILE: examples/agent_patterns/human_in_the_loop_stream.py function _needs_temperature_approval (line 17) | async def _needs_temperature_approval(_ctx, params, _call_id) -> bool: function get_temperature (line 26) | async def get_temperature(city: str) -> str: function get_weather (line 39) | async def get_weather(city: str) -> str: function confirm (line 51) | async def confirm(question: str) -> bool: function main (line 63) | async def main(): FILE: examples/agent_patterns/input_guardrails.py class MathHomeworkOutput (line 33) | class MathHomeworkOutput(BaseModel): function math_guardrail (line 46) | async def math_guardrail( function main (line 64) | async def main(): FILE: examples/agent_patterns/llm_as_a_judge.py class EvaluationFeedback (line 26) | class EvaluationFeedback: function main (line 42) | async def main() -> None: FILE: examples/agent_patterns/output_guardrails.py class MessageOutput (line 31) | class MessageOutput(BaseModel): function sensitive_data_check (line 38) | async def sensitive_data_check( function main (line 61) | async def main(): FILE: examples/agent_patterns/parallelization.py function main (line 22) | async def main(): FILE: examples/agent_patterns/routing.py function main (line 37) | async def main(): FILE: examples/agent_patterns/streaming_guardrails.py class GuardrailOutput (line 29) | class GuardrailOutput(BaseModel): function check_guardrail (line 49) | async def check_guardrail(text: str) -> GuardrailOutput: function main (line 54) | async def main(): FILE: examples/auto_mode.py function is_auto_mode (line 14) | def is_auto_mode() -> bool: function input_with_fallback (line 19) | def input_with_fallback(prompt: str, fallback: str) -> str: function confirm_with_fallback (line 27) | def confirm_with_fallback(prompt: str, default: bool = True) -> bool: FILE: examples/basic/agent_lifecycle_example.py class CustomAgentHooks (line 19) | class CustomAgentHooks(AgentHooks): method __init__ (line 20) | def __init__(self, display_name: str): method on_start (line 24) | async def on_start(self, context: AgentHookContext, agent: Agent) -> N... method on_end (line 31) | async def on_end(self, context: RunContextWrapper, agent: Agent, outpu... method on_handoff (line 37) | async def on_handoff(self, context: RunContextWrapper, agent: Agent, s... method on_tool_start (line 47) | async def on_tool_start(self, context: RunContextWrapper, agent: Agent... method on_tool_end (line 53) | async def on_tool_end( function random_number (line 66) | def random_number(max: int) -> int: function multiply_by_two (line 83) | def multiply_by_two(x: int) -> int: class FinalResult (line 88) | class FinalResult(BaseModel): function main (line 110) | async def main() -> None: FILE: examples/basic/dynamic_system_prompt.py class CustomContext (line 10) | class CustomContext: function custom_instructions (line 14) | def custom_instructions( function main (line 32) | async def main(): FILE: examples/basic/hello_world.py function main (line 6) | async def main(): FILE: examples/basic/hello_world_gpt_5.py function main (line 15) | async def main(): FILE: examples/basic/hello_world_gpt_oss.py function main (line 24) | async def main(): FILE: examples/basic/image_tool_output.py function fetch_random_image (line 11) | def fetch_random_image() -> ToolOutputImage | ToolOutputImageDict: function main (line 21) | async def main(): FILE: examples/basic/lifecycle_example.py class LoggingHooks (line 23) | class LoggingHooks(AgentHooks[Any]): method on_start (line 24) | async def on_start( method on_end (line 32) | async def on_end( class ExampleHooks (line 41) | class ExampleHooks(RunHooks): method __init__ (line 42) | def __init__(self): method _usage_to_str (line 45) | def _usage_to_str(self, usage: Usage) -> str: method on_agent_start (line 48) | async def on_agent_start(self, context: AgentHookContext, agent: Agent... method on_llm_start (line 55) | async def on_llm_start( method on_llm_end (line 65) | async def on_llm_end( method on_agent_end (line 71) | async def on_agent_end(self, context: RunContextWrapper, agent: Agent,... method on_tool_start (line 81) | async def on_tool_start(self, context: RunContextWrapper, agent: Agent... method on_tool_end (line 90) | async def on_tool_end( method on_handoff (line 101) | async def on_handoff( function random_number (line 116) | def random_number(max: int) -> int: function multiply_by_two (line 122) | def multiply_by_two(x: int) -> int: class FinalResult (line 127) | class FinalResult(BaseModel): function main (line 149) | async def main() -> None: FILE: examples/basic/local_file.py function file_to_base64 (line 10) | def file_to_base64(file_path: str) -> str: function main (line 15) | async def main(): FILE: examples/basic/local_image.py function image_to_base64 (line 10) | def image_to_base64(image_path): function main (line 16) | async def main(): FILE: examples/basic/non_strict_output_type.py class OutputType (line 22) | class OutputType: class CustomOutputSchema (line 27) | class CustomOutputSchema(AgentOutputSchemaBase): method is_plain_text (line 30) | def is_plain_text(self) -> bool: method name (line 33) | def name(self) -> str: method json_schema (line 36) | def json_schema(self) -> dict[str, Any]: method is_strict_json_schema (line 42) | def is_strict_json_schema(self) -> bool: method validate_json (line 45) | def validate_json(self, json_str: str) -> Any: function main (line 51) | async def main(): FILE: examples/basic/previous_response_id.py function main (line 18) | async def main(): function main_stream (line 38) | async def main_stream(): FILE: examples/basic/prompt_template.py class DynamicContext (line 24) | class DynamicContext: method __init__ (line 25) | def __init__(self, prompt_id: str): function _get_dynamic_prompt (line 31) | async def _get_dynamic_prompt(data: GenerateDynamicPromptData): function dynamic_prompt (line 42) | async def dynamic_prompt(prompt_id: str): function static_prompt (line 54) | async def static_prompt(prompt_id: str): FILE: examples/basic/remote_image.py function main (line 8) | async def main(): FILE: examples/basic/remote_pdf.py function main (line 8) | async def main(): FILE: examples/basic/retry.py function format_error (line 15) | def format_error(error: object) -> str: function main (line 21) | async def main() -> None: FILE: examples/basic/retry_litellm.py function format_error (line 15) | def format_error(error: object) -> str: function main (line 21) | async def main() -> None: FILE: examples/basic/stream_function_call_args.py function write_file (line 10) | def write_file(filename: Annotated[str, "Name of the file"], content: st... function create_config (line 16) | def create_config( function main (line 25) | async def main(): FILE: examples/basic/stream_items.py function how_many_jokes (line 8) | def how_many_jokes() -> int: function main (line 13) | async def main(): FILE: examples/basic/stream_text.py function main (line 8) | async def main(): FILE: examples/basic/stream_ws.py function lookup_order (line 39) | def lookup_order(order_id: str) -> dict[str, Any]: function submit_refund (line 73) | def submit_refund(order_id: str, amount: float, reason: str) -> dict[str... function ask_approval (line 85) | def ask_approval(question: str) -> bool: function run_streamed_turn (line 90) | async def run_streamed_turn( function main (line 162) | async def main() -> None: FILE: examples/basic/tool_guardrails.py function send_email (line 18) | def send_email(to: str, subject: str, body: str) -> str: function get_user_data (line 24) | def get_user_data(user_id: str) -> dict[str, str]: function get_contact_info (line 37) | def get_contact_info(user_id: str) -> dict[str, str]: function reject_sensitive_words (line 48) | def reject_sensitive_words(data: ToolInputGuardrailData) -> ToolGuardrai... function block_sensitive_output (line 77) | def block_sensitive_output(data: ToolOutputGuardrailData) -> ToolGuardra... function reject_phone_numbers (line 92) | def reject_phone_numbers(data: ToolOutputGuardrailData) -> ToolGuardrail... function main (line 115) | async def main(): FILE: examples/basic/tools.py class Weather (line 9) | class Weather(BaseModel): function get_weather (line 16) | def get_weather(city: Annotated[str, "The city to get the weather for"])... function main (line 29) | async def main(): FILE: examples/basic/usage_tracking.py class Weather (line 8) | class Weather(BaseModel): function get_weather (line 15) | def get_weather(city: str) -> Weather: function print_usage (line 20) | def print_usage(usage: Usage) -> None: function main (line 30) | async def main() -> None: FILE: examples/customer_service/main.py class AirlineAgentContext (line 29) | class AirlineAgentContext(BaseModel): function faq_lookup_tool (line 42) | async def faq_lookup_tool(question: str) -> str: function update_seat (line 68) | async def update_seat( function on_seat_booking_handoff (line 89) | async def on_seat_booking_handoff(context: RunContextWrapper[AirlineAgen... function main (line 143) | async def main(): FILE: examples/financial_research_agent/agents/financials_agent.py class AnalysisSummary (line 14) | class AnalysisSummary(BaseModel): FILE: examples/financial_research_agent/agents/planner_agent.py class FinancialSearchItem (line 17) | class FinancialSearchItem(BaseModel): class FinancialSearchPlan (line 25) | class FinancialSearchPlan(BaseModel): FILE: examples/financial_research_agent/agents/risk_agent.py class AnalysisSummary (line 13) | class AnalysisSummary(BaseModel): FILE: examples/financial_research_agent/agents/verifier_agent.py class VerificationResult (line 14) | class VerificationResult(BaseModel): FILE: examples/financial_research_agent/agents/writer_agent.py class FinancialReportData (line 16) | class FinancialReportData(BaseModel): FILE: examples/financial_research_agent/main.py function main (line 12) | async def main() -> None: FILE: examples/financial_research_agent/manager.py function _summary_extractor (line 20) | async def _summary_extractor(run_result: RunResult | RunResultStreaming)... class FinancialResearchManager (line 27) | class FinancialResearchManager: method __init__ (line 32) | def __init__(self) -> None: method run (line 36) | async def run(self, query: str) -> None: method _plan_searches (line 64) | async def _plan_searches(self, query: str) -> FinancialSearchPlan: method _perform_searches (line 74) | async def _perform_searches(self, search_plan: FinancialSearchPlan) ->... method _search (line 103) | async def _search(self, item: FinancialSearchItem) -> str | None: method _write_report (line 111) | async def _write_report(self, query: str, search_results: Sequence[str... method _verify_report (line 143) | async def _verify_report(self, report: FinancialReportData) -> Verific... FILE: examples/financial_research_agent/printer.py class Printer (line 8) | class Printer: method __init__ (line 14) | def __init__(self, console: Console) -> None: method end (line 20) | def end(self) -> None: method hide_done_checkmark (line 23) | def hide_done_checkmark(self, item_id: str) -> None: method update_item (line 26) | def update_item( method mark_item_done (line 34) | def mark_item_done(self, item_id: str) -> None: method flush (line 38) | def flush(self) -> None: FILE: examples/handoffs/message_filter.py function random_number_tool (line 12) | def random_number_tool(max: int) -> int: function spanish_handoff_message_filter (line 17) | def spanish_handoff_message_filter(handoff_message_data: HandoffInputDat... function main (line 66) | async def main(): FILE: examples/handoffs/message_filter_streaming.py function random_number_tool (line 12) | def random_number_tool(max: int) -> int: function spanish_handoff_message_filter (line 17) | def spanish_handoff_message_filter(handoff_message_data: HandoffInputDat... function main (line 66) | async def main(): FILE: examples/hosted_mcp/connectors.py function main (line 13) | async def main(verbose: bool, stream: bool): FILE: examples/hosted_mcp/human_in_the_loop.py function prompt_for_interruption (line 10) | def prompt_for_interruption( function _drain_stream (line 31) | async def _drain_stream( function main (line 45) | async def main(verbose: bool, stream: bool) -> None: FILE: examples/hosted_mcp/on_approval.py function prompt_approval (line 18) | def prompt_approval(request: MCPToolApprovalRequest) -> MCPToolApprovalF... function main (line 30) | async def main(verbose: bool, stream: bool) -> None: FILE: examples/hosted_mcp/simple.py function main (line 10) | async def main(verbose: bool, stream: bool, repo: str): FILE: examples/mcp/filesystem_example/main.py function run (line 9) | async def run(mcp_server: MCPServer): function main (line 35) | async def main(): FILE: examples/mcp/get_all_mcp_tools_example/main.py function list_tools (line 13) | async def list_tools(server: MCPServer, *, convert_to_strict: bool) -> l... function prompt_user_approval (line 27) | def prompt_user_approval(interruption_name: str) -> bool: function resolve_interruptions (line 43) | async def resolve_interruptions(agent: Agent, result: Any) -> Any: function main (line 60) | async def main(): FILE: examples/mcp/git_example/main.py function run (line 9) | async def run(mcp_server: MCPServer, directory_path: str): function main (line 29) | async def main(): FILE: examples/mcp/manager_example/app.py class AddRequest (line 18) | class AddRequest(BaseModel): class RunRequest (line 23) | class RunRequest(BaseModel): class ReconnectRequest (line 27) | class ReconnectRequest(BaseModel): function lifespan (line 32) | async def lifespan(app: FastAPI): function health (line 59) | async def health() -> dict[str, object]: function list_tools (line 75) | async def list_tools() -> dict[str, object]: function add (line 84) | async def add(req: AddRequest) -> dict[str, object]: function run_agent (line 93) | async def run_agent(req: RunRequest) -> dict[str, object]: function reconnect (line 112) | async def reconnect(req: ReconnectRequest) -> dict[str, object]: function _get_active_servers (line 120) | def _get_active_servers() -> list[MCPServer]: FILE: examples/mcp/manager_example/mcp_server.py function add (line 16) | def add(a: int, b: int) -> int: function echo (line 21) | def echo(message: str) -> str: FILE: examples/mcp/prompt_server/main.py function _choose_port (line 16) | def _choose_port() -> int: function get_instructions_from_prompt (line 31) | async def get_instructions_from_prompt(mcp_server: MCPServer, prompt_nam... function demo_code_review (line 49) | async def demo_code_review(mcp_server: MCPServer): function show_available_prompts (line 82) | async def show_available_prompts(mcp_server: MCPServer): function main (line 93) | async def main(): FILE: examples/mcp/prompt_server/server.py function generate_code_review_instructions (line 14) | def generate_code_review_instructions( FILE: examples/mcp/sse_example/main.py function run (line 13) | async def run(mcp_server: MCPServer): function main (line 40) | async def main(): FILE: examples/mcp/sse_example/server.py function add (line 10) | def add(a: int, b: int) -> int: function get_secret_word (line 17) | def get_secret_word() -> str: function get_current_weather (line 23) | def get_current_weather(city: str) -> str: FILE: examples/mcp/sse_remote_example/main.py function main (line 7) | async def main(): FILE: examples/mcp/streamable_http_remote_example/main.py function main (line 7) | async def main(): FILE: examples/mcp/streamablehttp_custom_client_example/main.py function _choose_port (line 24) | def _choose_port() -> int: function create_custom_http_client (line 39) | def create_custom_http_client( function run_with_custom_client (line 71) | async def run_with_custom_client(mcp_server: MCPServer): function main (line 87) | async def main(): FILE: examples/mcp/streamablehttp_custom_client_example/server.py function add (line 14) | def add(a: int, b: int) -> int: function get_secret_word (line 21) | def get_secret_word() -> str: FILE: examples/mcp/streamablehttp_example/main.py function _choose_port (line 16) | def _choose_port() -> int: function run (line 31) | async def run(mcp_server: MCPServer): function main (line 58) | async def main(): FILE: examples/mcp/streamablehttp_example/server.py function add (line 15) | def add(a: int, b: int) -> int: function get_secret_word (line 22) | def get_secret_word() -> str: function get_current_weather (line 28) | def get_current_weather(city: str) -> str: FILE: examples/mcp/tool_filter_example/main.py function run_with_auto_approval (line 11) | async def run_with_auto_approval(agent: Agent[Any], message: str) -> str... function main (line 24) | async def main(): FILE: examples/memory/advanced_sqlite_session_example.py function get_weather (line 16) | async def get_weather(city: str) -> str: function main (line 22) | async def main(): FILE: examples/memory/compaction_session_example.py function main (line 14) | async def main(): FILE: examples/memory/compaction_session_stateless_example.py function main (line 13) | async def main(): FILE: examples/memory/dapr_session_example.py function ping_with_retry (line 87) | async def ping_with_retry( function main (line 102) | async def main(): function demonstrate_advanced_features (line 230) | async def demonstrate_advanced_features(): function setup_instructions (line 299) | async def setup_instructions(): function demonstrate_multi_store (line 377) | async def demonstrate_multi_store(): function _write_text_file (line 435) | def _write_text_file(path: Path, content: str, overwrite: bool) -> None: function _docker_available (line 441) | def _docker_available() -> bool: function _container_running (line 445) | def _container_running(name: str): function _ensure_container (line 462) | def _ensure_container(name: str, run_args: list[str]) -> None: function setup_environment (line 482) | def setup_environment(components_dir: str = "./components", overwrite: b... FILE: examples/memory/encrypted_session_example.py function main (line 17) | async def main(): FILE: examples/memory/file_hitl_example.py function main (line 22) | async def main() -> None: function create_lookup_customer_profile_tool (line 119) | def create_lookup_customer_profile_tool( function format_tool_arguments (line 135) | def format_tool_arguments(interruption: Any) -> str: function prompt_yes_no (line 147) | async def prompt_yes_no(question: str) -> bool: FILE: examples/memory/file_session.py class FileSession (line 20) | class FileSession(Session): method __init__ (line 25) | def __init__(self, *, dir: str | Path | None = None, session_id: str |... method _ensure_session_id (line 31) | async def _ensure_session_id(self) -> str: method get_session_id (line 42) | async def get_session_id(self) -> str: method get_items (line 46) | async def get_items(self, limit: int | None = None) -> list[Any]: method add_items (line 53) | async def add_items(self, items: list[Any]) -> None: method pop_item (line 62) | async def pop_item(self) -> Any | None: method clear_session (line 71) | async def clear_session(self) -> None: method _items_path (line 86) | def _items_path(self, session_id: str) -> Path: method _state_path (line 89) | def _state_path(self, session_id: str) -> Path: method _read_items (line 92) | async def _read_items(self, session_id: str) -> list[Any]: method _write_items (line 101) | async def _write_items(self, session_id: str, items: list[Any]) -> None: method load_state_json (line 107) | async def load_state_json(self) -> dict[str, Any] | None: method save_state_json (line 118) | async def save_state_json(self, state: dict[str, Any]) -> None: FILE: examples/memory/hitl_session_scenario.py function tool_output_for (line 31) | def tool_output_for(name: str, message: str) -> str: function approval_echo (line 44) | def approval_echo(query: str) -> str: function approval_note (line 54) | def approval_note(query: str) -> str: class ScenarioStep (line 60) | class ScenarioStep: function run_scenario_step (line 68) | async def run_scenario_step( function run_file_session_scenario (line 144) | async def run_file_session_scenario(*, model: str | Model | None = None)... function run_openai_session_scenario (line 207) | async def run_openai_session_scenario(*, model: str | Model | None = Non... function get_conversation_id (line 273) | async def get_conversation_id(session: OpenAIConversationsSession) -> str: function get_user_text (line 277) | def get_user_text(item: TResponseInputItem) -> str | None: function get_item_type (line 294) | def get_item_type(item: TResponseInputItem) -> str: function is_function_call (line 300) | def is_function_call(item: TResponseInputItem) -> bool: function is_function_call_output (line 304) | def is_function_call_output(item: TResponseInputItem) -> bool: function find_last_item (line 308) | def find_last_item(items: list[TResponseInputItem], predicate: Any) -> d... function extract_call_id (line 316) | def extract_call_id(item: dict[str, Any]) -> str | None: function cast_str (line 320) | def cast_str(value: Any) -> str | None: function log_session_summary (line 324) | def log_session_summary(items: list[TResponseInputItem], label: str) -> ... function format_output (line 360) | def format_output(output: Any) -> str: function truncate_text (line 378) | def truncate_text(text: str, max_length: int = 140) -> str: function main (line 387) | async def main() -> None: FILE: examples/memory/memory_session_hitl_example.py function _needs_approval (line 15) | async def _needs_approval(_ctx, _params, _call_id) -> bool: function get_weather (line 21) | def get_weather(location: str) -> str: function prompt_yes_no (line 44) | async def prompt_yes_no(question: str) -> bool: function main (line 56) | async def main(): FILE: examples/memory/openai_session_example.py function main (line 13) | async def main(): FILE: examples/memory/openai_session_hitl_example.py function _needs_approval (line 15) | async def _needs_approval(_ctx, _params, _call_id) -> bool: function get_weather (line 21) | def get_weather(location: str) -> str: function prompt_yes_no (line 44) | async def prompt_yes_no(question: str) -> bool: function main (line 56) | async def main(): FILE: examples/memory/redis_session_example.py function main (line 17) | async def main(): function demonstrate_advanced_features (line 149) | async def demonstrate_advanced_features(): FILE: examples/memory/sqlalchemy_session_example.py function main (line 7) | async def main(): FILE: examples/memory/sqlite_session_example.py function main (line 13) | async def main(): FILE: examples/model_providers/custom_example_agent.py function get_weather (line 36) | def get_weather(city: str): function main (line 41) | async def main(): FILE: examples/model_providers/custom_example_global.py function get_weather (line 45) | def get_weather(city: str): function main (line 50) | async def main(): FILE: examples/model_providers/custom_example_provider.py class CustomModelProvider (line 43) | class CustomModelProvider(ModelProvider): method get_model (line 44) | def get_model(self, model_name: str | None) -> Model: function get_weather (line 52) | def get_weather(city: str): function main (line 57) | async def main(): FILE: examples/model_providers/litellm_auto.py function get_weather (line 20) | def get_weather(city: str): class Result (line 25) | class Result(BaseModel): function main (line 30) | async def main(): FILE: examples/model_providers/litellm_provider.py function get_weather (line 22) | def get_weather(city: str): function main (line 27) | async def main(model: str, api_key: str): FILE: examples/realtime/app/agent.py function faq_lookup_tool (line 17) | async def faq_lookup_tool(question: str) -> str: function update_seat (line 42) | async def update_seat(confirmation_number: str, new_seat: str) -> str: function get_weather (line 54) | def get_weather(city: str) -> str: function get_starting_agent (line 100) | def get_starting_agent() -> RealtimeAgent: FILE: examples/realtime/app/server.py class RealtimeWebSocketManager (line 38) | class RealtimeWebSocketManager: method __init__ (line 39) | def __init__(self): method connect (line 44) | async def connect(self, websocket: WebSocket, session_id: str): method disconnect (line 73) | async def disconnect(self, session_id: str): method send_audio (line 82) | async def send_audio(self, session_id: str, audio_bytes: bytes): method send_client_event (line 86) | async def send_client_event(self, session_id: str, event: dict[str, An... method send_user_message (line 100) | async def send_user_message(self, session_id: str, message: RealtimeUs... method approve_tool_call (line 107) | async def approve_tool_call(self, session_id: str, call_id: str, *, al... method reject_tool_call (line 114) | async def reject_tool_call(self, session_id: str, call_id: str, *, alw... method interrupt (line 121) | async def interrupt(self, session_id: str) -> None: method _process_events (line 128) | async def _process_events(self, session_id: str): method _sanitize_history_item (line 140) | def _sanitize_history_item(self, item: RealtimeItem) -> dict[str, Any]: method _serialize_event (line 157) | async def _serialize_event(self, event: RealtimeSessionEvent) -> dict[... function lifespan (line 215) | async def lifespan(app: FastAPI): function websocket_endpoint (line 223) | async def websocket_endpoint(websocket: WebSocket, session_id: str): function read_index (line 383) | async def read_index(): FILE: examples/realtime/app/static/app.js class RealtimeDemo (line 1) | class RealtimeDemo { method constructor (line 2) | constructor() { method initializeElements (line 26) | initializeElements() { method setupEventListeners (line 38) | setupEventListeners() { method generateSessionId (line 99) | generateSessionId() { method connect (line 103) | async connect() { method disconnect (line 132) | disconnect() { method updateConnectionUI (line 139) | updateConnectionUI() { method toggleMute (line 155) | toggleMute() { method updateMuteUI (line 160) | updateMuteUI() { method readFileAsDataURL (line 173) | readFileAsDataURL(file) { method prepareDataURL (line 182) | async prepareDataURL(file) { method startContinuousCapture (line 211) | async startContinuousCapture() { method stopContinuousCapture (line 267) | stopContinuousCapture() { method handleRealtimeEvent (line 296) | handleRealtimeEvent(event) { method updateLastMessageFromHistory (line 334) | updateLastMessageFromHistory(history) { method syncMissingFromHistory (line 385) | syncMissingFromHistory(history) { method addMessageFromItem (line 397) | addMessageFromItem(item) { method addMessage (line 439) | addMessage(type, content) { method addImageMessage (line 454) | addImageMessage(role, imageUrl, caption = '') { method addUserImageMessage (line 483) | addUserImageMessage(imageUrl, caption = '') { method addRawEvent (line 487) | addRawEvent(event) { method addToolEvent (line 516) | addToolEvent(event) { method promptForToolApproval (line 562) | promptForToolApproval(event) { method playAudio (line 582) | async playAudio(audioBase64) { method ensurePlaybackNode (line 605) | async ensurePlaybackNode() { method flushPendingPlaybackChunks (line 649) | flushPendingPlaybackChunks() { method decodeBase64ToInt16 (line 672) | decodeBase64ToInt16(audioBase64) { method stopAudioPlayback (line 687) | stopAudioPlayback() { method scrollToBottom (line 705) | scrollToBottom() { FILE: examples/realtime/app/static/audio-playback.worklet.js class PCMPlaybackProcessor (line 1) | class PCMPlaybackProcessor extends AudioWorkletProcessor { method constructor (line 2) | constructor() { method reset (line 55) | reset() { method hasPendingAudio (line 62) | hasPendingAudio() { method pullSample (line 69) | pullSample() { method process (line 92) | process(inputs, outputs) { FILE: examples/realtime/app/static/audio-recorder.worklet.js class PCMRecorderProcessor (line 1) | class PCMRecorderProcessor extends AudioWorkletProcessor { method constructor (line 2) | constructor() { method flushBuffer (line 11) | flushBuffer() { method process (line 24) | process(inputs) { FILE: examples/realtime/cli/demo.py function get_weather (line 38) | def get_weather(city: str) -> str: function _truncate_str (line 50) | def _truncate_str(s: str, max_length: int) -> str: class NoUIDemo (line 56) | class NoUIDemo: method __init__ (line 57) | def __init__(self) -> None: method _output_callback (line 84) | def _output_callback(self, outdata, frames: int, time, status) -> None: method run (line 208) | async def run(self) -> None: method start_audio_recording (line 257) | async def start_audio_recording(self) -> None: method capture_audio (line 272) | async def capture_audio(self) -> None: method _on_event (line 324) | async def _on_event(self, event: RealtimeSessionEvent) -> None: method _compute_rms (line 362) | def _compute_rms(self, samples: np.ndarray[Any, np.dtype[Any]]) -> float: method _update_playback_rms (line 369) | def _update_playback_rms(self, samples: np.ndarray[Any, np.dtype[Any]]... FILE: examples/realtime/twilio/server.py class TwilioWebSocketManager (line 21) | class TwilioWebSocketManager: method __init__ (line 22) | def __init__(self): method new_session (line 25) | async def new_session(self, websocket: WebSocket) -> TwilioHandler: function root (line 40) | async def root(): function incoming_call (line 46) | async def incoming_call(request: Request): function media_stream_endpoint (line 61) | async def media_stream_endpoint(websocket: WebSocket): FILE: examples/realtime/twilio/twilio_handler.py function get_weather (line 24) | def get_weather(city: str) -> str: function get_current_time (line 30) | def get_current_time() -> str: class TwilioHandler (line 45) | class TwilioHandler: method __init__ (line 46) | def __init__(self, twilio_websocket: WebSocket): method start (line 85) | async def start(self) -> None: method wait_until_done (line 123) | async def wait_until_done(self) -> None: method _realtime_session_loop (line 128) | async def _realtime_session_loop(self) -> None: method _twilio_message_loop (line 137) | async def _twilio_message_loop(self) -> None: method _handle_realtime_event (line 149) | async def _handle_realtime_event(self, event: RealtimeSessionEvent) ->... method _handle_twilio_message (line 194) | async def _handle_twilio_message(self, message: dict[str, Any]) -> None: method _handle_media_event (line 214) | async def _handle_media_event(self, message: dict[str, Any]) -> None: method _handle_mark_event (line 234) | async def _handle_mark_event(self, message: dict[str, Any]) -> None: method _flush_audio_buffer (line 252) | async def _flush_audio_buffer(self) -> None: method _buffer_flush_loop (line 284) | async def _buffer_flush_loop(self) -> None: FILE: examples/realtime/twilio_sip/agents.py function faq_lookup_tool (line 20) | async def faq_lookup_tool(question: str) -> str: function update_customer_record (line 36) | async def update_customer_record(customer_id: str, note: str) -> str: function get_starting_agent (line 84) | def get_starting_agent() -> RealtimeAgent: FILE: examples/realtime/twilio_sip/server.py function _get_env (line 32) | def _get_env(name: str) -> str: function accept_call (line 53) | async def accept_call(call_id: str) -> None: function observe_call (line 99) | async def observe_call(call_id: str) -> None: function _track_call_task (line 174) | def _track_call_task(call_id: str) -> None: function openai_webhook (line 191) | async def openai_webhook(request: Request) -> Response: function healthcheck (line 210) | async def healthcheck() -> dict[str, str]: FILE: examples/reasoning_content/gpt_oss_stream.py function main (line 29) | async def main(): FILE: examples/reasoning_content/main.py function stream_with_reasoning_content (line 27) | async def stream_with_reasoning_content(): function get_response_with_reasoning_content (line 70) | async def get_response_with_reasoning_content(): function main (line 117) | async def main(): FILE: examples/reasoning_content/runner_example.py function main (line 23) | async def main(): FILE: examples/research_bot/agents/planner_agent.py class WebSearchItem (line 12) | class WebSearchItem(BaseModel): class WebSearchPlan (line 20) | class WebSearchPlan(BaseModel): FILE: examples/research_bot/agents/writer_agent.py class ReportData (line 18) | class ReportData(BaseModel): FILE: examples/research_bot/main.py function main (line 8) | async def main() -> None: FILE: examples/research_bot/manager.py class ResearchManager (line 16) | class ResearchManager: method __init__ (line 17) | def __init__(self): method run (line 21) | async def run(self, query: str) -> None: method _plan_searches (line 52) | async def _plan_searches(self, query: str) -> WebSearchPlan: method _perform_searches (line 65) | async def _perform_searches(self, search_plan: WebSearchPlan) -> list[... method _search (line 94) | async def _search(self, item: WebSearchItem) -> str | None: method _write_report (line 105) | async def _write_report(self, query: str, search_results: list[str]) -... FILE: examples/research_bot/printer.py class Printer (line 8) | class Printer: method __init__ (line 9) | def __init__(self, console: Console): method end (line 15) | def end(self) -> None: method hide_done_checkmark (line 18) | def hide_done_checkmark(self, item_id: str) -> None: method update_item (line 21) | def update_item( method mark_item_done (line 29) | def mark_item_done(self, item_id: str) -> None: method flush (line 33) | def flush(self) -> None: FILE: examples/run_examples.py class ExampleScript (line 54) | class ExampleScript: method relpath (line 59) | def relpath(self) -> str: method module (line 63) | def module(self) -> str: method command (line 68) | def command(self) -> list[str]: class ExampleResult (line 74) | class ExampleResult: function normalize_relpath (line 82) | def normalize_relpath(relpath: str) -> str: function parse_args (line 87) | def parse_args() -> argparse.Namespace: function detect_tags (line 176) | def detect_tags(path: Path, source: str) -> set[str]: function discover_examples (line 208) | def discover_examples(filters: Iterable[str]) -> list[ExampleScript]: function should_skip (line 235) | def should_skip( function format_command (line 249) | def format_command(cmd: Sequence[str]) -> str: function display_path (line 253) | def display_path(path: Path) -> str: function env_flag (line 260) | def env_flag(name: str) -> bool | None: function load_auto_skip (line 267) | def load_auto_skip() -> set[str]: function write_main_log_line (line 275) | def write_main_log_line(handle, line: str) -> None: function ensure_dirs (line 280) | def ensure_dirs(path: Path, is_file: bool | None = None) -> None: function parse_rerun_from_log (line 294) | def parse_rerun_from_log(log_path: Path) -> list[str]: function run_examples (line 312) | def run_examples(examples: Sequence[ExampleScript], args: argparse.Names... function main (line 533) | def main() -> int: FILE: examples/tools/apply_patch.py class ApprovalTracker (line 13) | class ApprovalTracker: method __init__ (line 14) | def __init__(self) -> None: method fingerprint (line 17) | def fingerprint(self, operation: ApplyPatchOperation, relative_path: s... method remember (line 26) | def remember(self, fingerprint: str) -> None: method is_approved (line 29) | def is_approved(self, fingerprint: str) -> bool: class WorkspaceEditor (line 33) | class WorkspaceEditor: method __init__ (line 34) | def __init__(self, root: Path, approvals: ApprovalTracker, auto_approv... method create_file (line 39) | def create_file(self, operation: ApplyPatchOperation) -> ApplyPatchRes... method update_file (line 48) | def update_file(self, operation: ApplyPatchOperation) -> ApplyPatchRes... method delete_file (line 58) | def delete_file(self, operation: ApplyPatchOperation) -> ApplyPatchRes... method _relative_path (line 65) | def _relative_path(self, value: str) -> str: method _resolve (line 69) | def _resolve(self, relative: str, ensure_parent: bool = False) -> Path: method _require_approval (line 81) | def _require_approval(self, operation: ApplyPatchOperation, display_pa... function main (line 99) | async def main(auto_approve: bool, model: str) -> None: FILE: examples/tools/code_interpreter.py function _get_field (line 8) | def _get_field(obj: Any, key: str) -> Any: function main (line 14) | async def main(): FILE: examples/tools/codex.py function on_codex_stream (line 34) | async def on_codex_stream(payload: CodexToolStreamEvent) -> None: function _timestamp (line 93) | def _timestamp() -> str: function log (line 97) | def log(message: str) -> None: function main (line 104) | async def main() -> None: FILE: examples/tools/codex_same_thread.py function on_codex_stream (line 25) | async def on_codex_stream(payload: CodexToolStreamEvent) -> None: function _timestamp (line 44) | def _timestamp() -> str: function log (line 48) | def log(message: str) -> None: function read_context_value (line 55) | def read_context_value(context: Mapping[str, str] | BaseModel, key: str)... function main (line 62) | async def main() -> None: FILE: examples/tools/computer_use.py class LocalPlaywrightComputer (line 58) | class LocalPlaywrightComputer(AsyncComputer): method __init__ (line 61) | def __init__(self): method _get_browser_and_page (line 66) | async def _get_browser_and_page(self) -> tuple[Browser, Page]: method __aenter__ (line 75) | async def __aenter__(self): method __aexit__ (line 81) | async def __aexit__(self, exc_type, exc_val, exc_tb): method open (line 88) | async def open(self) -> "LocalPlaywrightComputer": method close (line 93) | async def close(self) -> None: method playwright (line 98) | def playwright(self) -> Playwright: method browser (line 103) | def browser(self) -> Browser: method page (line 108) | def page(self) -> Page: method dimensions (line 113) | def dimensions(self) -> tuple[int, int]: method screenshot (line 116) | async def screenshot(self) -> str: method click (line 121) | async def click(self, x: int, y: int, button: Button = "left") -> None: method double_click (line 130) | async def double_click(self, x: int, y: int) -> None: method scroll (line 133) | async def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -... method type (line 137) | async def type(self, text: str) -> None: method wait (line 140) | async def wait(self) -> None: method move (line 143) | async def move(self, x: int, y: int) -> None: method keypress (line 146) | async def keypress(self, keys: list[str]) -> None: method drag (line 153) | async def drag(self, path: list[tuple[int, int]]) -> None: function run_agent (line 163) | async def run_agent( function singleton_computer (line 178) | async def singleton_computer() -> None: function computer_per_request (line 184) | async def computer_per_request() -> None: FILE: examples/tools/container_shell_inline_skill.py function build_skill_zip_bundle (line 18) | def build_skill_zip_bundle() -> bytes: function build_inline_skill (line 28) | def build_inline_skill() -> ShellToolInlineSkill: function extract_container_id (line 42) | def extract_container_id(raw_responses: list[ModelResponse]) -> str | None: function main (line 53) | async def main(model: str) -> None: FILE: examples/tools/container_shell_skill_reference.py function resolve_skill_reference (line 20) | def resolve_skill_reference() -> ShellToolSkillReference: function extract_container_id (line 32) | def extract_container_id(raw_responses: list[ModelResponse]) -> str | None: function main (line 43) | async def main(model: str) -> None: FILE: examples/tools/file_search.py function main (line 8) | async def main(): FILE: examples/tools/image_generator.py function _get_field (line 14) | def _get_field(obj: Any, key: str) -> Any: function open_file (line 20) | def open_file(path: str) -> None: function main (line 31) | async def main(): FILE: examples/tools/local_shell_skill.py function build_local_skill (line 12) | def build_local_skill() -> ShellToolLocalSkill: function main (line 20) | async def main(model: str) -> None: FILE: examples/tools/shell.py class ShellExecutor (line 25) | class ShellExecutor: method __init__ (line 28) | def __init__(self, cwd: Path | None = None): method __call__ (line 31) | async def __call__(self, request: ShellCommandRequest) -> ShellResult: function prompt_shell_approval (line 77) | async def prompt_shell_approval(commands: Sequence[str]) -> bool: function main (line 88) | async def main(prompt: str, model: str) -> None: FILE: examples/tools/shell_human_in_the_loop.py class ShellExecutor (line 22) | class ShellExecutor: method __init__ (line 25) | def __init__(self, cwd: Path | None = None): method __call__ (line 28) | async def __call__(self, request: ShellCommandRequest) -> ShellResult: function prompt_shell_approval (line 74) | async def prompt_shell_approval(commands: Sequence[str]) -> tuple[bool, ... function _extract_commands (line 90) | def _extract_commands(approval_item: ToolApprovalItem) -> Sequence[str]: function main (line 104) | async def main(prompt: str, model: str) -> None: FILE: examples/tools/tool_search.py function get_customer_profile (line 46) | def get_customer_profile( function list_open_orders (line 54) | def list_open_orders( function get_invoice_status (line 62) | def get_invoice_status( function get_shipping_eta (line 70) | def get_shipping_eta( function get_shipping_credit_balance (line 78) | def get_shipping_credit_balance( function loaded_paths (line 121) | def loaded_paths(result: Any) -> list[str]: function print_result (line 163) | def print_result(title: str, result: Any, registered_paths: list[str]) -... function run_namespaced_example (line 181) | async def run_namespaced_example() -> None: function run_top_level_example (line 193) | async def run_top_level_example() -> None: function main (line 205) | async def main() -> None: FILE: examples/tools/web_search.py function main (line 6) | async def main(): FILE: examples/tools/web_search_filters.py function _get_field (line 13) | def _get_field(obj: Any, key: str) -> Any: function _normalized_source_urls (line 23) | def _normalized_source_urls(sources: Any) -> list[str]: function main (line 70) | async def main(): FILE: examples/voice/static/main.py function get_weather (line 34) | def get_weather(city: str) -> str: class WorkflowCallbacks (line 61) | class WorkflowCallbacks(SingleAgentWorkflowCallbacks): method on_run (line 62) | def on_run(self, workflow: SingleAgentVoiceWorkflow, transcription: st... function main (line 66) | async def main(): FILE: examples/voice/static/util.py function _record_audio (line 9) | def _record_audio(screen: curses.window) -> npt.NDArray[np.float32]: function record_audio (line 50) | def record_audio(): class AudioPlayer (line 58) | class AudioPlayer: method __enter__ (line 59) | def __enter__(self): method __exit__ (line 64) | def __exit__(self, exc_type, exc_value, traceback): method add_audio (line 68) | def add_audio(self, audio_data: npt.NDArray[np.int16]): FILE: examples/voice/streamed/main.py class Header (line 36) | class Header(Static): method render (line 42) | def render(self) -> str: class AudioStatusIndicator (line 46) | class AudioStatusIndicator(Static): method render (line 52) | def render(self) -> str: class RealtimeApp (line 61) | class RealtimeApp(App[None]): method __init__ (line 124) | def __init__(self) -> None: method _on_transcription (line 139) | def _on_transcription(self, transcription: str) -> None: method compose (line 146) | def compose(self) -> ComposeResult: method on_mount (line 153) | async def on_mount(self) -> None: method start_voice_pipeline (line 157) | async def start_voice_pipeline(self) -> None: method send_mic_audio (line 177) | async def send_mic_audio(self) -> None: method on_key (line 211) | async def on_key(self, event: events.Key) -> None: FILE: examples/voice/streamed/my_workflow.py function get_weather (line 11) | def get_weather(city: str) -> str: class MyWorkflow (line 38) | class MyWorkflow(VoiceWorkflowBase): method __init__ (line 39) | def __init__(self, secret_word: str, on_start: Callable[[str], None]): method run (line 51) | async def run(self, transcription: str) -> AsyncIterator[str]: FILE: src/agents/__init__.py function set_default_openai_key (line 228) | def set_default_openai_key(key: str, use_for_tracing: bool = True) -> None: function set_default_openai_client (line 243) | def set_default_openai_client(client: AsyncOpenAI, use_for_tracing: bool... function set_default_openai_api (line 256) | def set_default_openai_api(api: Literal["chat_completions", "responses"]... function set_default_openai_responses_transport (line 263) | def set_default_openai_responses_transport(transport: Literal["http", "w... function enable_verbose_stdout_logging (line 272) | def enable_verbose_stdout_logging(): FILE: src/agents/_config.py function set_default_openai_key (line 8) | def set_default_openai_key(key: str, use_for_tracing: bool) -> None: function set_default_openai_client (line 15) | def set_default_openai_client(client: AsyncOpenAI, use_for_tracing: bool... function set_default_openai_api (line 22) | def set_default_openai_api(api: Literal["chat_completions", "responses"]... function set_default_openai_responses_transport (line 29) | def set_default_openai_responses_transport(transport: Literal["http", "w... FILE: src/agents/_debug.py function _debug_flag_enabled (line 4) | def _debug_flag_enabled(flag: str, default: bool = False) -> bool: function _load_dont_log_model_data (line 12) | def _load_dont_log_model_data() -> bool: function _load_dont_log_tool_data (line 16) | def _load_dont_log_tool_data() -> bool: FILE: src/agents/_mcp_tool_metadata.py class MCPToolMetadata (line 9) | class MCPToolMetadata: function _get_mapping_or_attr (line 16) | def _get_mapping_or_attr(value: Any, key: str) -> Any: function _get_non_empty_string (line 22) | def _get_non_empty_string(value: Any) -> str | None: function resolve_mcp_tool_title (line 28) | def resolve_mcp_tool_title(tool: Any) -> str | None: function resolve_mcp_tool_description (line 38) | def resolve_mcp_tool_description(tool: Any) -> str | None: function resolve_mcp_tool_description_for_model (line 43) | def resolve_mcp_tool_description_for_model(tool: Any) -> str: function extract_mcp_tool_metadata (line 54) | def extract_mcp_tool_metadata(tool: Any) -> MCPToolMetadata: function collect_mcp_list_tools_metadata (line 62) | def collect_mcp_list_tools_metadata(items: Iterable[Any]) -> dict[tuple[... FILE: src/agents/_tool_identity.py class SerializedFunctionToolLookupKey (line 21) | class SerializedFunctionToolLookupKey(TypedDict, total=False): function get_mapping_or_attr (line 29) | def get_mapping_or_attr(value: Any, key: str) -> Any: function tool_qualified_name (line 36) | def tool_qualified_name(name: str | None, namespace: str | None = None) ... function tool_trace_name (line 45) | def tool_trace_name(name: str | None, namespace: str | None = None) -> s... function is_reserved_synthetic_tool_namespace (line 52) | def is_reserved_synthetic_tool_namespace(name: str | None, namespace: st... function get_tool_call_namespace (line 63) | def get_tool_call_namespace(tool_call: Any) -> str | None: function get_tool_call_name (line 69) | def get_tool_call_name(tool_call: Any) -> str | None: function get_tool_call_qualified_name (line 75) | def get_tool_call_qualified_name(tool_call: Any) -> str | None: function get_function_tool_lookup_key (line 83) | def get_function_tool_lookup_key( function get_function_tool_lookup_key_for_call (line 97) | def get_function_tool_lookup_key_for_call(tool_call: Any) -> FunctionToo... function get_function_tool_lookup_key_for_tool (line 105) | def get_function_tool_lookup_key_for_tool(tool: Any) -> FunctionToolLook... function serialize_function_tool_lookup_key (line 115) | def serialize_function_tool_lookup_key( function deserialize_function_tool_lookup_key (line 135) | def deserialize_function_tool_lookup_key(data: Any) -> FunctionToolLooku... function get_tool_call_trace_name (line 156) | def get_tool_call_trace_name(tool_call: Any) -> str | None: function get_tool_trace_name_for_tool (line 164) | def get_tool_trace_name_for_tool(tool: Any) -> str | None: function _remove_tool_call_namespace (line 174) | def _remove_tool_call_namespace(tool_call: Any) -> Any: function has_function_tool_shape (line 194) | def has_function_tool_shape(tool: Any) -> bool: function get_function_tool_public_name (line 201) | def get_function_tool_public_name(tool: Any) -> str | None: function get_function_tool_namespace (line 209) | def get_function_tool_namespace(tool: Any) -> str | None: function get_explicit_function_tool_namespace (line 214) | def get_explicit_function_tool_namespace(tool: Any) -> str | None: function get_function_tool_namespace_description (line 222) | def get_function_tool_namespace_description(tool: Any) -> str | None: function is_deferred_top_level_function_tool (line 228) | def is_deferred_top_level_function_tool(tool: Any) -> bool: function get_function_tool_dispatch_name (line 237) | def get_function_tool_dispatch_name(tool: Any) -> str | None: function get_function_tool_lookup_keys (line 245) | def get_function_tool_lookup_keys(tool: Any) -> tuple[FunctionToolLookup... function should_allow_bare_name_approval_alias (line 266) | def should_allow_bare_name_approval_alias(tool: Any, all_tools: Sequence... function get_deferred_top_level_function_tool_lookup_key (line 284) | def get_deferred_top_level_function_tool_lookup_key( function validate_function_tool_namespace_shape (line 294) | def validate_function_tool_namespace_shape( function validate_function_tool_lookup_configuration (line 310) | def validate_function_tool_lookup_configuration(tools: Sequence[Any]) ->... function build_function_tool_lookup_map (line 352) | def build_function_tool_lookup_map(tools: Sequence[Any]) -> dict[Functio... function get_function_tool_approval_keys (line 362) | def get_function_tool_approval_keys( function normalize_tool_call_for_function_tool (line 413) | def normalize_tool_call_for_function_tool(tool_call: Any, tool: Any) -> ... function get_function_tool_qualified_name (line 428) | def get_function_tool_qualified_name(tool: Any) -> str | None: function get_function_tool_trace_name (line 433) | def get_function_tool_trace_name(tool: Any) -> str | None: FILE: src/agents/agent.py class ToolsToFinalOutputResult (line 74) | class ToolsToFinalOutputResult: function _validate_codex_tool_name_collisions (line 95) | def _validate_codex_tool_name_collisions(tools: list[Tool]) -> None: class AgentToolStreamEvent (line 121) | class AgentToolStreamEvent(TypedDict): class StopAtTools (line 134) | class StopAtTools(TypedDict): class MCPConfig (line 139) | class MCPConfig(TypedDict): class AgentBase (line 155) | class AgentBase(Generic[TContext]): method get_mcp_tools (line 183) | async def get_mcp_tools(self, run_context: RunContextWrapper[TContext]... method get_all_tools (line 197) | async def get_all_tools(self, run_context: RunContextWrapper[TContext]... class Agent (line 221) | class Agent(AgentBase, Generic[TContext]): method __post_init__ (line 322) | def __post_init__(self): method clone (line 455) | def clone(self, **kwargs: Any) -> Agent[TContext]: method as_tool (line 470) | def as_tool( method get_system_prompt (line 875) | async def get_system_prompt(self, run_context: RunContextWrapper[TCont... method get_prompt (line 904) | async def get_prompt( FILE: src/agents/agent_output.py class AgentOutputSchemaBase (line 16) | class AgentOutputSchemaBase(abc.ABC): method is_plain_text (line 22) | def is_plain_text(self) -> bool: method name (line 27) | def name(self) -> str: method json_schema (line 32) | def json_schema(self) -> dict[str, Any]: method is_strict_json_schema (line 39) | def is_strict_json_schema(self) -> bool: method validate_json (line 47) | def validate_json(self, json_str: str) -> Any: class AgentOutputSchema (line 55) | class AgentOutputSchema(AgentOutputSchemaBase): method __init__ (line 79) | def __init__(self, output_type: type[Any], strict_json_schema: bool = ... method is_plain_text (line 122) | def is_plain_text(self) -> bool: method is_strict_json_schema (line 126) | def is_strict_json_schema(self) -> bool: method json_schema (line 130) | def json_schema(self) -> dict[str, Any]: method validate_json (line 136) | def validate_json(self, json_str: str) -> Any: method name (line 166) | def name(self) -> str: function _is_subclass_of_base_model_or_dict (line 171) | def _is_subclass_of_base_model_or_dict(t: Any) -> bool: function _type_to_str (line 183) | def _type_to_str(t: type[Any]) -> str: FILE: src/agents/agent_tool_input.py class AgentAsToolInput (line 21) | class AgentAsToolInput(BaseModel): class StructuredInputSchemaInfo (line 28) | class StructuredInputSchemaInfo: class StructuredToolInputBuilderOptions (line 35) | class StructuredToolInputBuilderOptions(TypedDict, total=False): function default_tool_input_builder (line 50) | def default_tool_input_builder(options: StructuredToolInputBuilderOption... function resolve_agent_tool_input (line 79) | async def resolve_agent_tool_input( function build_structured_input_schema_info (line 110) | def build_structured_input_schema_info( function is_agent_tool_input (line 123) | def is_agent_tool_input(value: Any) -> bool: function _has_only_input_field (line 128) | def _has_only_input_field(value: dict[str, Any]) -> bool: class _SchemaSummaryField (line 134) | class _SchemaSummaryField: class _SchemaFieldDescription (line 142) | class _SchemaFieldDescription: class _SchemaSummary (line 148) | class _SchemaSummary: function _build_schema_summary (line 153) | def _build_schema_summary(parameters: dict[str, Any]) -> str | None: function _format_schema_summary (line 160) | def _format_schema_summary(summary: _SchemaSummary) -> str: function _summarize_json_schema (line 171) | def _summarize_json_schema(schema: dict[str, Any]) -> _SchemaSummary | N... function _describe_json_schema_field (line 209) | def _describe_json_schema_field( function _read_schema_description (line 248) | def _read_schema_description(value: Any) -> str | None: function _format_enum_label (line 257) | def _format_enum_label(values: list[Any] | None) -> str: function _format_literal_label (line 265) | def _format_literal_label(schema: dict[str, Any]) -> str: FILE: src/agents/agent_tool_state.py function get_agent_tool_state_scope (line 30) | def get_agent_tool_state_scope(context: Any) -> str | None: function set_agent_tool_state_scope (line 36) | def set_agent_tool_state_scope(context: Any, scope_id: str | None) -> None: function _tool_call_signature (line 52) | def _tool_call_signature( function _scoped_tool_call_signature (line 66) | def _scoped_tool_call_signature( function _index_agent_tool_run_result (line 73) | def _index_agent_tool_run_result( function _drop_agent_tool_run_result (line 85) | def _drop_agent_tool_run_result(tool_call_obj_id: int) -> None: function _register_tool_call_ref (line 107) | def _register_tool_call_ref(tool_call: ResponseFunctionToolCall, tool_ca... function record_agent_tool_run_result (line 119) | def record_agent_tool_run_result( function _tool_call_obj_matches_scope (line 132) | def _tool_call_obj_matches_scope(tool_call_obj_id: int, *, scope_id: str... function consume_agent_tool_run_result (line 140) | def consume_agent_tool_run_result( function peek_agent_tool_run_result (line 167) | def peek_agent_tool_run_result( function drop_agent_tool_run_result (line 190) | def drop_agent_tool_run_result( FILE: src/agents/apply_diff.py class Chunk (line 14) | class Chunk: class ParserState (line 21) | class ParserState: class ParsedUpdateDiff (line 28) | class ParsedUpdateDiff: class ReadSectionResult (line 34) | class ReadSectionResult: function apply_diff (line 52) | def apply_diff(input: str, diff: str, mode: ApplyDiffMode = "default") -... function _normalize_diff_lines (line 68) | def _normalize_diff_lines(diff: str) -> list[str]: function _detect_newline_from_text (line 75) | def _detect_newline_from_text(text: str) -> str: function _detect_newline (line 79) | def _detect_newline(input: str, diff: str, mode: ApplyDiffMode) -> str: function _normalize_text_newlines (line 87) | def _normalize_text_newlines(text: str) -> str: function _is_done (line 92) | def _is_done(state: ParserState, prefixes: Sequence[str]) -> bool: function _read_str (line 100) | def _read_str(state: ParserState, prefix: str) -> str: function _parse_create_diff (line 110) | def _parse_create_diff(lines: list[str], newline: str) -> str: function _parse_update_diff (line 126) | def _parse_update_diff(lines: list[str], input: str) -> ParsedUpdateDiff: function _advance_cursor_to_anchor (line 171) | def _advance_cursor_to_anchor( function _read_section (line 197) | def _read_section(lines: list[str], start_index: int) -> ReadSectionResult: class ContextMatch (line 276) | class ContextMatch: function _find_context (line 281) | def _find_context(lines: list[str], context: list[str], start: int, eof:... function _find_context_core (line 292) | def _find_context_core(lines: list[str], context: list[str], start: int)... function _equals_slice (line 309) | def _equals_slice( function _apply_chunks (line 320) | def _apply_chunks(input: str, chunks: list[Chunk], newline: str) -> str: FILE: src/agents/computer.py class Computer (line 8) | class Computer(abc.ABC): method environment (line 13) | def environment(self) -> Environment | None: method dimensions (line 18) | def dimensions(self) -> tuple[int, int] | None: method screenshot (line 23) | def screenshot(self) -> str: method click (line 27) | def click(self, x: int, y: int, button: Button) -> None: method double_click (line 31) | def double_click(self, x: int, y: int) -> None: method scroll (line 35) | def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: method type (line 39) | def type(self, text: str) -> None: method wait (line 43) | def wait(self) -> None: method move (line 47) | def move(self, x: int, y: int) -> None: method keypress (line 51) | def keypress(self, keys: list[str]) -> None: method drag (line 55) | def drag(self, path: list[tuple[int, int]]) -> None: class AsyncComputer (line 59) | class AsyncComputer(abc.ABC): method environment (line 64) | def environment(self) -> Environment | None: method dimensions (line 69) | def dimensions(self) -> tuple[int, int] | None: method screenshot (line 74) | async def screenshot(self) -> str: method click (line 78) | async def click(self, x: int, y: int, button: Button) -> None: method double_click (line 82) | async def double_click(self, x: int, y: int) -> None: method scroll (line 86) | async def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -... method type (line 90) | async def type(self, text: str) -> None: method wait (line 94) | async def wait(self) -> None: method move (line 98) | async def move(self, x: int, y: int) -> None: method keypress (line 102) | async def keypress(self, keys: list[str]) -> None: method drag (line 106) | async def drag(self, path: list[tuple[int, int]]) -> None: FILE: src/agents/editor.py class ApplyPatchOperation (line 16) | class ApplyPatchOperation: class ApplyPatchResult (line 26) | class ApplyPatchResult: class ApplyPatchEditor (line 34) | class ApplyPatchEditor(Protocol): method create_file (line 37) | def create_file( method update_file (line 41) | def update_file( method delete_file (line 45) | def delete_file( FILE: src/agents/exceptions.py class RunErrorDetails (line 21) | class RunErrorDetails: method __str__ (line 32) | def __str__(self) -> str: class AgentsException (line 36) | class AgentsException(Exception): method __init__ (line 41) | def __init__(self, *args: object) -> None: class MaxTurnsExceeded (line 46) | class MaxTurnsExceeded(AgentsException): method __init__ (line 51) | def __init__(self, message: str): class ModelBehaviorError (line 56) | class ModelBehaviorError(AgentsException): method __init__ (line 63) | def __init__(self, message: str): class UserError (line 68) | class UserError(AgentsException): method __init__ (line 73) | def __init__(self, message: str): class MCPToolCancellationError (line 78) | class MCPToolCancellationError(AgentsException): method __init__ (line 83) | def __init__(self, message: str): class ToolTimeoutError (line 88) | class ToolTimeoutError(AgentsException): method __init__ (line 94) | def __init__(self, tool_name: str, timeout_seconds: float): class InputGuardrailTripwireTriggered (line 100) | class InputGuardrailTripwireTriggered(AgentsException): method __init__ (line 106) | def __init__(self, guardrail_result: InputGuardrailResult): class OutputGuardrailTripwireTriggered (line 113) | class OutputGuardrailTripwireTriggered(AgentsException): method __init__ (line 119) | def __init__(self, guardrail_result: OutputGuardrailResult): class ToolInputGuardrailTripwireTriggered (line 126) | class ToolInputGuardrailTripwireTriggered(AgentsException): method __init__ (line 135) | def __init__(self, guardrail: ToolInputGuardrail[Any], output: ToolGua... class ToolOutputGuardrailTripwireTriggered (line 141) | class ToolOutputGuardrailTripwireTriggered(AgentsException): method __init__ (line 150) | def __init__(self, guardrail: ToolOutputGuardrail[Any], output: ToolGu... FILE: src/agents/extensions/experimental/codex/codex.py class _UnsetType (line 14) | class _UnsetType: class Codex (line 21) | class Codex: method __init__ (line 23) | def __init__(self, options: CodexOptions | Mapping[str, Any] | None = ... method __init__ (line 26) | def __init__( method __init__ (line 36) | def __init__( method start_thread (line 69) | def start_thread(self, options: ThreadOptions | Mapping[str, Any] | No... method resume_thread (line 77) | def resume_thread( function _normalize_env (line 89) | def _normalize_env(options: CodexOptions) -> dict[str, str] | None: FILE: src/agents/extensions/experimental/codex/codex_options.py class CodexOptions (line 11) | class CodexOptions: function coerce_codex_options (line 24) | def coerce_codex_options( FILE: src/agents/extensions/experimental/codex/codex_tool.py class CodexToolInputItem (line 77) | class CodexToolInputItem(BaseModel): method validate_item (line 85) | def validate_item(self) -> CodexToolInputItem: class CodexToolParameters (line 107) | class CodexToolParameters(BaseModel): method validate_thread_id (line 126) | def validate_thread_id(self) -> CodexToolParameters: class CodexToolRunContextParameters (line 138) | class CodexToolRunContextParameters(BaseModel): class OutputSchemaPrimitive (line 150) | class OutputSchemaPrimitive(TypedDict, total=False): class OutputSchemaArray (line 156) | class OutputSchemaArray(TypedDict, total=False): class OutputSchemaPropertyDescriptor (line 165) | class OutputSchemaPropertyDescriptor(TypedDict, total=False): class OutputSchemaDescriptor (line 171) | class OutputSchemaDescriptor(TypedDict, total=False): class CodexToolResult (line 179) | class CodexToolResult: method as_dict (line 184) | def as_dict(self) -> dict[str, Any]: method __str__ (line 191) | def __str__(self) -> str: class CodexToolStreamEvent (line 196) | class CodexToolStreamEvent(_DictLike): class CodexToolOptions (line 203) | class CodexToolOptions: class CodexToolCallArguments (line 225) | class CodexToolCallArguments(TypedDict): class _UnsetType (line 230) | class _UnsetType: function codex_tool (line 237) | def codex_tool( function _coerce_tool_options (line 431) | def _coerce_tool_options( function _validate_run_context_thread_id_key (line 459) | def _validate_run_context_thread_id_key(value: Any) -> str: function _resolve_codex_tool_name (line 470) | def _resolve_codex_tool_name(configured_name: str | None) -> str: function _resolve_run_context_thread_id_key (line 490) | def _resolve_run_context_thread_id_key( function _normalize_name_for_context_key (line 507) | def _normalize_name_for_context_key(value: str) -> str: function _validate_default_run_context_thread_id_suffix (line 514) | def _validate_default_run_context_thread_id_suffix(value: str) -> str: function _parse_tool_input (line 533) | def _parse_tool_input(parameters_model: type[BaseModel], input_json: str... function _normalize_parameters (line 549) | def _normalize_parameters(params: BaseModel) -> CodexToolCallArguments: function _build_codex_input (line 570) | def _build_codex_input(args: CodexToolCallArguments) -> Input: function _resolve_codex_options (line 576) | def _resolve_codex_options( function _resolve_default_codex_api_key (line 599) | def _resolve_default_codex_api_key(options: CodexOptions | None) -> str ... function _create_codex_resolver (line 623) | def _create_codex_resolver( function _resolve_thread_options (line 644) | def _resolve_thread_options( function _build_turn_options (line 668) | def _build_turn_options( function _resolve_output_schema (line 687) | def _resolve_output_schema( function _looks_like_descriptor (line 707) | def _looks_like_descriptor(option: Mapping[str, Any]) -> bool: function _validate_descriptor (line 714) | def _validate_descriptor(option: Mapping[str, Any]) -> OutputSchemaDescr... function _is_valid_field (line 743) | def _is_valid_field(field: Any) -> bool: function _build_codex_output_schema (line 760) | def _build_codex_output_schema(descriptor: OutputSchemaDescriptor) -> di... function _build_codex_output_schema_field (line 786) | def _build_codex_output_schema_field(field: OutputSchemaField) -> dict[s... function _get_thread (line 803) | def _get_thread(codex: Codex, thread_id: str | None, defaults: ThreadOpt... function _normalize_thread_id (line 809) | def _normalize_thread_id(value: Any) -> str | None: function _resolve_call_thread_id (line 821) | def _resolve_call_thread_id( function _read_thread_id_from_run_context (line 840) | def _read_thread_id_from_run_context(ctx: RunContextWrapper[Any], key: s... function _validate_run_context_thread_id_context (line 862) | def _validate_run_context_thread_id_context(ctx: RunContextWrapper[Any],... function _store_thread_id_in_run_context (line 913) | def _store_thread_id_in_run_context( function _try_store_thread_id_in_run_context_after_error (line 944) | def _try_store_thread_id_in_run_context_after_error( function _set_pydantic_context_value (line 960) | def _set_pydantic_context_value(context: BaseModel, key: str, value: str... function _get_or_create_persisted_thread (line 989) | def _get_or_create_persisted_thread( function _to_agent_usage (line 1008) | def _to_agent_usage(usage: Usage) -> AgentsUsage: function _consume_events (line 1019) | async def _consume_events( function _handle_item_started (line 1118) | def _handle_item_started( function _handle_item_updated (line 1182) | def _handle_item_updated( function _handle_item_completed (line 1200) | def _handle_item_completed( function _truncate_span_string (line 1237) | def _truncate_span_string(value: str, max_chars: int | None) -> str: function _json_char_size (line 1252) | def _json_char_size(value: Any) -> int: function _drop_empty_string_fields (line 1259) | def _drop_empty_string_fields(data: dict[str, Any]) -> dict[str, Any]: function _stringify_span_value (line 1263) | def _stringify_span_value(value: Any) -> str: function _maybe_as_dict (line 1274) | def _maybe_as_dict(value: Any) -> Any: function _truncate_span_value (line 1284) | def _truncate_span_value(value: Any, max_chars: int | None) -> Any: function _enforce_span_data_budget (line 1307) | def _enforce_span_data_budget(data: dict[str, Any], max_chars: int | Non... function _merge_span_data (line 1422) | def _merge_span_data( function _apply_span_updates (line 1431) | def _apply_span_updates( function _update_command_span (line 1443) | def _update_command_span( function _update_mcp_tool_span (line 1461) | def _update_mcp_tool_span( function _update_reasoning_span (line 1478) | def _update_reasoning_span(span: Any, item: ReasoningItem, span_data_max... function _build_default_response (line 1486) | def _build_default_response(args: CodexToolCallArguments) -> str: function _is_command_execution_item (line 1491) | def _is_command_execution_item(item: ThreadItem) -> TypeGuard[CommandExe... function _is_mcp_tool_call_item (line 1495) | def _is_mcp_tool_call_item(item: ThreadItem) -> TypeGuard[McpToolCallItem]: function _is_reasoning_item (line 1499) | def _is_reasoning_item(item: ThreadItem) -> TypeGuard[ReasoningItem]: FILE: src/agents/extensions/experimental/codex/events.py class ThreadStartedEvent (line 16) | class ThreadStartedEvent(_DictLike): class TurnStartedEvent (line 22) | class TurnStartedEvent(_DictLike): class Usage (line 27) | class Usage(_DictLike): class TurnCompletedEvent (line 34) | class TurnCompletedEvent(_DictLike): class ThreadError (line 40) | class ThreadError(_DictLike): class TurnFailedEvent (line 45) | class TurnFailedEvent(_DictLike): class ItemStartedEvent (line 51) | class ItemStartedEvent(_DictLike): class ItemUpdatedEvent (line 57) | class ItemUpdatedEvent(_DictLike): class ItemCompletedEvent (line 63) | class ItemCompletedEvent(_DictLike): class ThreadErrorEvent (line 69) | class ThreadErrorEvent(_DictLike): class _UnknownThreadEvent (line 75) | class _UnknownThreadEvent(_DictLike): function _coerce_thread_error (line 93) | def _coerce_thread_error(raw: ThreadError | Mapping[str, Any]) -> Thread... function coerce_usage (line 101) | def coerce_usage(raw: Usage | Mapping[str, Any]) -> Usage: function coerce_thread_event (line 113) | def coerce_thread_event(raw: ThreadEvent | Mapping[str, Any]) -> ThreadE... FILE: src/agents/extensions/experimental/codex/exec.py class CodexExecArgs (line 26) | class CodexExecArgs: class CodexExec (line 47) | class CodexExec: method __init__ (line 48) | def __init__( method run (line 61) | async def run(self, args: CodexExecArgs) -> AsyncGenerator[str, None]: method _build_env (line 211) | def _build_env(self, args: CodexExecArgs) -> dict[str, str]: function _watch_signal (line 231) | async def _watch_signal(signal: asyncio.Event, process: asyncio.subproce... function _platform_target_triple (line 237) | def _platform_target_triple() -> str: function find_codex_path (line 261) | def find_codex_path() -> str: function _resolve_subprocess_stream_limit_bytes (line 279) | def _resolve_subprocess_stream_limit_bytes(explicit_value: int | None) -... function _validate_subprocess_stream_limit_bytes (line 296) | def _validate_subprocess_stream_limit_bytes(value: int) -> int: FILE: src/agents/extensions/experimental/codex/items.py class CommandExecutionItem (line 25) | class CommandExecutionItem(_DictLike): class FileUpdateChange (line 35) | class FileUpdateChange(_DictLike): class FileChangeItem (line 41) | class FileChangeItem(_DictLike): class McpToolCallResult (line 49) | class McpToolCallResult(_DictLike): class McpToolCallError (line 55) | class McpToolCallError(_DictLike): class McpToolCallItem (line 60) | class McpToolCallItem(_DictLike): class AgentMessageItem (line 72) | class AgentMessageItem(_DictLike): class ReasoningItem (line 79) | class ReasoningItem(_DictLike): class WebSearchItem (line 86) | class WebSearchItem(_DictLike): class ErrorItem (line 93) | class ErrorItem(_DictLike): class TodoItem (line 100) | class TodoItem(_DictLike): class TodoListItem (line 106) | class TodoListItem(_DictLike): class _UnknownThreadItem (line 113) | class _UnknownThreadItem(_DictLike): function is_agent_message_item (line 132) | def is_agent_message_item(item: ThreadItem) -> TypeGuard[AgentMessageItem]: function _coerce_file_update_change (line 136) | def _coerce_file_update_change( function _coerce_mcp_tool_call_result (line 149) | def _coerce_mcp_tool_call_result( function _coerce_mcp_tool_call_error (line 163) | def _coerce_mcp_tool_call_error( function coerce_thread_item (line 173) | def coerce_thread_item(raw: ThreadItem | Mapping[str, Any]) -> ThreadItem: FILE: src/agents/extensions/experimental/codex/output_schema_file.py class OutputSchemaFile (line 14) | class OutputSchemaFile: function _is_plain_json_object (line 20) | def _is_plain_json_object(schema: Any) -> bool: function create_output_schema_file (line 24) | def create_output_schema_file(schema: dict[str, Any] | None) -> OutputSc... FILE: src/agents/extensions/experimental/codex/payloads.py class _DictLike (line 8) | class _DictLike: method __getitem__ (line 9) | def __getitem__(self, key: str) -> Any: method get (line 14) | def get(self, key: str, default: Any = None) -> Any: method __contains__ (line 19) | def __contains__(self, key: object) -> bool: method keys (line 24) | def keys(self) -> Iterable[str]: method as_dict (line 27) | def as_dict(self) -> dict[str, Any]: method _field_names (line 30) | def _field_names(self) -> list[str]: FILE: src/agents/extensions/experimental/codex/thread.py function _aclosing (line 31) | async def _aclosing( class TextInput (line 40) | class TextInput(TypedDict): class LocalImageInput (line 45) | class LocalImageInput(TypedDict): class Turn (line 55) | class Turn: class StreamedTurn (line 65) | class StreamedTurn: class Thread (line 72) | class Thread: method __init__ (line 73) | def __init__( method id (line 87) | def id(self) -> str | None: method run_streamed (line 90) | async def run_streamed( method _run_streamed_internal (line 96) | async def _run_streamed_internal( method run (line 162) | async def run(self, input: Input, turn_options: TurnOptions | None = N... function _normalize_input (line 191) | def _normalize_input(input: Input) -> tuple[str, list[str]]: function _parse_event (line 210) | def _parse_event(raw: str) -> ThreadEvent: FILE: src/agents/extensions/experimental/codex/thread_options.py class ThreadOptions (line 18) | class ThreadOptions: function coerce_thread_options (line 41) | def coerce_thread_options( FILE: src/agents/extensions/experimental/codex/turn_options.py class TurnOptions (line 14) | class TurnOptions: function coerce_turn_options (line 23) | def coerce_turn_options( FILE: src/agents/extensions/handoff_filters.py function remove_all_tools (line 29) | def remove_all_tools(handoff_input_data: HandoffInputData) -> HandoffInp... function _remove_tools_from_items (line 49) | def _remove_tools_from_items(items: tuple[RunItem, ...]) -> tuple[RunIte... function _remove_tool_types_from_input (line 66) | def _remove_tool_types_from_input( FILE: src/agents/extensions/handoff_prompt.py function prompt_with_handoff_instructions (line 15) | def prompt_with_handoff_instructions(prompt: str) -> str: FILE: src/agents/extensions/memory/__init__.py function __getattr__ (line 37) | def __getattr__(name: str) -> Any: FILE: src/agents/extensions/memory/advanced_sqlite_session.py class AdvancedSQLiteSession (line 20) | class AdvancedSQLiteSession(SQLiteSession): method __init__ (line 23) | def __init__( method _init_structure_tables (line 53) | def _init_structure_tables(self): method add_items (line 125) | async def add_items(self, items: list[TResponseInputItem]) -> None: method get_items (line 138) | async def get_items( method store_run_usage (line 249) | async def store_run_usage(self, result: RunResult) -> None: method _get_next_turn_number (line 267) | def _get_next_turn_number(self, branch_id: str) -> int: method _get_next_branch_turn_number (line 290) | def _get_next_branch_turn_number(self, branch_id: str) -> int: method _get_current_turn_number (line 313) | def _get_current_turn_number(self) -> int: method _add_structure_metadata (line 332) | async def _add_structure_metadata(self, items: list[TResponseInputItem... method _cleanup_orphaned_messages (line 444) | async def _cleanup_orphaned_messages(self) -> int: method _classify_message_type (line 488) | def _classify_message_type(self, item: TResponseInputItem) -> str: method _extract_tool_name (line 506) | def _extract_tool_name(self, item: TResponseInputItem) -> str | None: method _is_user_message (line 560) | def _is_user_message(self, item: TResponseInputItem) -> bool: method create_branch_from_turn (line 571) | async def create_branch_from_turn( method create_branch_from_content (line 637) | async def create_branch_from_content( method switch_to_branch (line 660) | async def switch_to_branch(self, branch_id: str) -> None: method delete_branch (line 693) | async def delete_branch(self, branch_id: str, force: bool = False) -> ... method list_branches (line 773) | async def list_branches(self) -> list[dict[str, Any]]: method _copy_messages_to_new_branch (line 821) | async def _copy_messages_to_new_branch(self, new_branch_id: str, from_... method get_conversation_turns (line 905) | async def get_conversation_turns(self, branch_id: str | None = None) -... method find_turns_by_content (line 962) | async def find_turns_by_content( method get_conversation_by_turns (line 1018) | async def get_conversation_by_turns( method get_tool_usage (line 1056) | async def get_tool_usage(self, branch_id: str | None = None) -> list[t... method get_session_usage (line 1114) | async def get_session_usage(self, branch_id: str | None = None) -> dic... method get_turn_usage (line 1174) | async def get_turn_usage( method _update_turn_usage_internal (line 1280) | async def _update_turn_usage_internal(self, user_turn_number: int, usa... FILE: src/agents/extensions/memory/async_sqlite_session.py class AsyncSQLiteSession (line 17) | class AsyncSQLiteSession(SessionABC): method __init__ (line 27) | def __init__( method _init_db_for_connection (line 51) | async def _init_db_for_connection(self, conn: aiosqlite.Connection) ->... method _get_connection (line 85) | async def _get_connection(self) -> aiosqlite.Connection: method _locked_connection (line 99) | async def _locked_connection(self) -> AsyncIterator[aiosqlite.Connecti... method get_items (line 105) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 153) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 189) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 223) | async def clear_session(self) -> None: method close (line 236) | async def close(self) -> None: FILE: src/agents/extensions/memory/dapr_session.py class DaprSession (line 57) | class DaprSession(SessionABC): method __init__ (line 62) | def __init__( method from_address (line 101) | def from_address( method _get_read_metadata (line 141) | def _get_read_metadata(self) -> dict[str, str]: method _get_state_options (line 152) | def _get_state_options(self, *, concurrency: Concurrency | None = None... method _get_metadata (line 165) | def _get_metadata(self) -> dict[str, str]: method _serialize_item (line 172) | async def _serialize_item(self, item: TResponseInputItem) -> str: method _deserialize_item (line 176) | async def _deserialize_item(self, item: str) -> TResponseInputItem: method _decode_messages (line 180) | def _decode_messages(self, data: bytes | None) -> list[Any]: method _calculate_retry_delay (line 192) | def _calculate_retry_delay(self, attempt: int) -> float: method _is_concurrency_conflict (line 198) | def _is_concurrency_conflict(self, error: Exception) -> bool: method _handle_concurrency_conflict (line 221) | async def _handle_concurrency_conflict(self, error: Exception, attempt... method get_items (line 235) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 274) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 327) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 371) | async def clear_session(self) -> None: method close (line 387) | async def close(self) -> None: method __aenter__ (line 397) | async def __aenter__(self) -> DaprSession: method __aexit__ (line 401) | async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: method ping (line 405) | async def ping(self) -> bool: FILE: src/agents/extensions/memory/encrypt_session.py class EncryptedEnvelope (line 44) | class EncryptedEnvelope(TypedDict): function _ensure_fernet_key_bytes (line 53) | def _ensure_fernet_key_bytes(master_key: str) -> bytes: function _derive_session_fernet_key (line 69) | def _derive_session_fernet_key(master_key_bytes: bytes, session_id: str)... function _to_json_bytes (line 80) | def _to_json_bytes(obj: Any) -> bytes: function _from_json_bytes (line 84) | def _from_json_bytes(data: bytes) -> Any: function _is_encrypted_envelope (line 88) | def _is_encrypted_envelope(item: object) -> TypeGuard[EncryptedEnvelope]: class EncryptedSession (line 99) | class EncryptedSession(SessionABC): method __init__ (line 113) | def __init__( method __getattr__ (line 136) | def __getattr__(self, name): method session_settings (line 140) | def session_settings(self) -> SessionSettings | None: method session_settings (line 145) | def session_settings(self, value: SessionSettings | None) -> None: method _wrap (line 149) | def _wrap(self, item: TResponseInputItem) -> EncryptedEnvelope: method _unwrap (line 162) | def _unwrap(self, item: TResponseInputItem | EncryptedEnvelope) -> TRe... method get_items (line 173) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 182) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 186) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 195) | async def clear_session(self) -> None: FILE: src/agents/extensions/memory/redis_session.py class RedisSession (line 42) | class RedisSession(SessionABC): method __init__ (line 47) | def __init__( method from_url (line 82) | def from_url( method _serialize_item (line 118) | async def _serialize_item(self, item: TResponseInputItem) -> str: method _deserialize_item (line 122) | async def _deserialize_item(self, item: str) -> TResponseInputItem: method _get_next_id (line 126) | async def _get_next_id(self) -> int: method _set_ttl_if_configured (line 131) | async def _set_ttl_if_configured(self, *keys: str) -> None: method get_items (line 143) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 182) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 224) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 248) | async def clear_session(self) -> None: method close (line 258) | async def close(self) -> None: method ping (line 268) | async def ping(self) -> bool: FILE: src/agents/extensions/memory/sqlalchemy_session.py class SQLAlchemySession (line 55) | class SQLAlchemySession(SessionABC): method _get_table_init_lock (line 66) | def _get_table_init_lock( method __init__ (line 81) | def __init__( method from_url (line 168) | def from_url( method _serialize_item (line 196) | async def _serialize_item(self, item: TResponseInputItem) -> str: method _deserialize_item (line 200) | async def _deserialize_item(self, item: str) -> TResponseInputItem: method _ensure_tables (line 207) | async def _ensure_tables(self) -> None: method get_items (line 227) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 279) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 326) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 363) | async def clear_session(self) -> None: method engine (line 376) | def engine(self) -> AsyncEngine: FILE: src/agents/extensions/models/litellm_model.py function _patch_litellm_serializer_warnings (line 62) | def _patch_litellm_serializer_warnings() -> None: class InternalChatCompletionMessage (line 121) | class InternalChatCompletionMessage(ChatCompletionMessage): class InternalToolCall (line 130) | class InternalToolCall(ChatCompletionMessageFunctionToolCall): class LitellmModel (line 139) | class LitellmModel(Model): method __init__ (line 145) | def __init__( method get_retry_advice (line 157) | def get_retry_advice(self, request: ModelRetryAdviceRequest) -> ModelR... method get_response (line 162) | async def get_response( method stream_response (line 276) | async def stream_response( method _fetch_response (line 339) | async def _fetch_response( method _fetch_response (line 354) | async def _fetch_response( method _fetch_response (line 368) | async def _fetch_response( method _convert_gemini_extra_content_to_provider_specific_fields (line 562) | def _convert_gemini_extra_content_to_provider_specific_fields( method _fix_tool_message_ordering (line 621) | def _fix_tool_message_ordering( method _remove_not_given (line 736) | def _remove_not_given(self, value: Any) -> Any: method _merge_headers (line 741) | def _merge_headers(self, model_settings: ModelSettings): class LitellmConverter (line 745) | class LitellmConverter: method convert_message_to_openai (line 747) | def convert_message_to_openai( method convert_annotations_to_openai (line 813) | def convert_annotations_to_openai( method convert_tool_call_to_openai (line 836) | def convert_tool_call_to_openai( FILE: src/agents/extensions/models/litellm_provider.py class LitellmProvider (line 9) | class LitellmProvider(ModelProvider): method get_model (line 22) | def get_model(self, model_name: str | None) -> Model: FILE: src/agents/extensions/tool_output_trimmer.py class ToolOutputTrimmer (line 44) | class ToolOutputTrimmer: method __post_init__ (line 70) | def __post_init__(self) -> None: method __call__ (line 81) | def __call__(self, data: CallModelData[Any]) -> ModelInputData: method _find_recent_boundary (line 147) | def _find_recent_boundary(self, items: list[Any]) -> int: method _build_call_id_to_names (line 165) | def _build_call_id_to_names(self, items: list[Any]) -> dict[str, tuple... method _trim_function_call_output (line 186) | def _trim_function_call_output( method _trim_tool_search_output (line 212) | def _trim_tool_search_output(self, item: dict[str, Any]) -> tuple[dict... method _trim_legacy_tool_search_results (line 234) | def _trim_legacy_tool_search_results( method _trim_tool_search_tool (line 256) | def _trim_tool_search_tool(self, tool: Any) -> Any: method _trim_json_schema (line 277) | def _trim_json_schema(self, schema: dict[str, Any]) -> dict[str, Any]: method _serialize_json_like (line 294) | def _serialize_json_like(self, value: Any) -> str: FILE: src/agents/extensions/visualization.py function get_main_graph (line 9) | def get_main_graph(agent: Agent) -> str: function get_all_nodes (line 33) | def get_all_nodes( function get_all_edges (line 98) | def get_all_edges( function draw_graph (line 147) | def draw_graph(agent: Agent, filename: str | None = None) -> graphviz.So... FILE: src/agents/function_schema.py class FuncSchema (line 21) | class FuncSchema: method to_call_args (line 42) | def to_call_args(self, data: BaseModel) -> tuple[list[Any], dict[str, ... class FuncDocumentation (line 78) | class FuncDocumentation: function _detect_docstring_style (line 94) | def _detect_docstring_style(doc: str) -> DocstringStyle: function _suppress_griffe_logging (line 135) | def _suppress_griffe_logging(): function generate_func_documentation (line 146) | def generate_func_documentation( function _strip_annotated (line 188) | def _strip_annotated(annotation: Any) -> tuple[Any, tuple[Any, ...]]: function _extract_description_from_metadata (line 204) | def _extract_description_from_metadata(metadata: tuple[Any, ...]) -> str... function _extract_field_info_from_metadata (line 213) | def _extract_field_info_from_metadata(metadata: tuple[Any, ...]) -> Fiel... function function_schema (line 222) | def function_schema( FILE: src/agents/guardrail.py class GuardrailFunctionOutput (line 20) | class GuardrailFunctionOutput: class InputGuardrailResult (line 36) | class InputGuardrailResult: class OutputGuardrailResult (line 49) | class OutputGuardrailResult: class InputGuardrail (line 72) | class InputGuardrail(Generic[TContext]): method get_name (line 105) | def get_name(self) -> str: method run (line 111) | async def run( class OutputGuardrail (line 134) | class OutputGuardrail(Generic[TContext]): method get_name (line 159) | def get_name(self) -> str: method run (line 165) | async def run( function input_guardrail (line 202) | def input_guardrail( function input_guardrail (line 208) | def input_guardrail( function input_guardrail (line 214) | def input_guardrail( function input_guardrail (line 224) | def input_guardrail( function output_guardrail (line 284) | def output_guardrail( function output_guardrail (line 290) | def output_guardrail( function output_guardrail (line 296) | def output_guardrail( function output_guardrail (line 305) | def output_guardrail( FILE: src/agents/handoffs/__init__.py class HandoffInputData (line 43) | class HandoffInputData: method clone (line 73) | def clone(self, **kwargs: Any) -> HandoffInputData: class Handoff (line 94) | class Handoff(Generic[TContext, TAgent]): method get_transfer_message (line 162) | def get_transfer_message(self, agent: AgentBase[Any]) -> str: method default_tool_name (line 166) | def default_tool_name(cls, agent: AgentBase[Any]) -> str: method default_tool_description (line 170) | def default_tool_description(cls, agent: AgentBase[Any]) -> str: function handoff (line 178) | def handoff( function handoff (line 190) | def handoff( function handoff (line 204) | def handoff( function handoff (line 216) | def handoff( FILE: src/agents/handoffs/history.py function set_conversation_history_wrappers (line 40) | def set_conversation_history_wrappers( function reset_conversation_history_wrappers (line 57) | def reset_conversation_history_wrappers() -> None: function get_conversation_history_wrappers (line 65) | def get_conversation_history_wrappers() -> tuple[str, str]: function nest_handoff_history (line 71) | def nest_handoff_history( function default_handoff_history_mapper (line 115) | def default_handoff_history_mapper( function _normalize_input_history (line 124) | def _normalize_input_history( function _run_item_to_plain_input (line 132) | def _run_item_to_plain_input(run_item: RunItem) -> TResponseInputItem: function _build_summary_message (line 136) | def _build_summary_message(transcript: list[TResponseInputItem]) -> TRes... function _format_transcript_item (line 161) | def _format_transcript_item(item: TResponseInputItem) -> str: function _stringify_content (line 180) | def _stringify_content(content: Any) -> str: function _flatten_nested_history_messages (line 191) | def _flatten_nested_history_messages( function _extract_nested_history_transcript (line 204) | def _extract_nested_history_transcript( function _parse_summary_line (line 226) | def _parse_summary_line(line: str) -> TResponseInputItem | None: function _split_role_and_name (line 249) | def _split_role_and_name(role_text: str) -> tuple[str, str | None]: function _should_forward_pre_item (line 259) | def _should_forward_pre_item(input_item: TResponseInputItem) -> bool: function _should_forward_new_item (line 268) | def _should_forward_new_item(input_item: TResponseInputItem) -> bool: FILE: src/agents/items.py class RunItemBase (line 90) | class RunItemBase(Generic[T], abc.ABC): method __post_init__ (line 106) | def __post_init__(self) -> None: method __getattribute__ (line 110) | def __getattribute__(self, name: str) -> Any: method release_agent (line 115) | def release_agent(self) -> None: method _get_agent_via_weakref (line 126) | def _get_agent_via_weakref(self, attr_name: str, ref_name: str) -> Any: method to_input_item (line 143) | def to_input_item(self) -> TResponseInputItem: class MessageOutputItem (line 156) | class MessageOutputItem(RunItemBase[ResponseOutputMessage]): class ToolSearchCallItem (line 166) | class ToolSearchCallItem(RunItemBase[ToolSearchCallRawItem]): method to_input_item (line 174) | def to_input_item(self) -> TResponseInputItem: class ToolSearchOutputItem (line 180) | class ToolSearchOutputItem(RunItemBase[ToolSearchOutputRawItem]): method to_input_item (line 188) | def to_input_item(self) -> TResponseInputItem: function _tool_search_item_to_input_item (line 193) | def _tool_search_item_to_input_item( function _output_item_to_input_item (line 208) | def _output_item_to_input_item(raw_item: Any) -> TResponseInputItem: function _copy_tool_search_mapping (line 224) | def _copy_tool_search_mapping(raw_item: Mapping[str, Any]) -> dict[str, ... function coerce_tool_search_call_raw_item (line 232) | def coerce_tool_search_call_raw_item(raw_item: Any) -> ToolSearchCallRaw... function coerce_tool_search_output_raw_item (line 247) | def coerce_tool_search_output_raw_item(raw_item: Any) -> ToolSearchOutpu... class HandoffCallItem (line 265) | class HandoffCallItem(RunItemBase[ResponseFunctionToolCall]): class HandoffOutputItem (line 275) | class HandoffOutputItem(RunItemBase[TResponseInputItem]): method __post_init__ (line 300) | def __post_init__(self) -> None: method __getattribute__ (line 306) | def __getattribute__(self, name: str) -> Any: method release_agent (line 316) | def release_agent(self) -> None: class ToolCallItem (line 347) | class ToolCallItem(RunItemBase[Any]): class ToolCallOutputItem (line 372) | class ToolCallOutputItem(RunItemBase[Any]): method to_input_item (line 385) | def to_input_item(self) -> TResponseInputItem: class ReasoningItem (line 416) | class ReasoningItem(RunItemBase[ResponseReasoningItem]): class MCPListToolsItem (line 426) | class MCPListToolsItem(RunItemBase[McpListTools]): class MCPApprovalRequestItem (line 436) | class MCPApprovalRequestItem(RunItemBase[McpApprovalRequest]): class MCPApprovalResponseItem (line 446) | class MCPApprovalResponseItem(RunItemBase[McpApprovalResponse]): class CompactionItem (line 456) | class CompactionItem(RunItemBase[TResponseInputItem]): method to_input_item (line 461) | def to_input_item(self) -> TResponseInputItem: class ToolApprovalItem (line 477) | class ToolApprovalItem(RunItemBase[Any]): method __post_init__ (line 503) | def __post_init__(self) -> None: method __hash__ (line 534) | def __hash__(self) -> int: method __eq__ (line 538) | def __eq__(self, other: object) -> bool: method name (line 543) | def name(self) -> str | None: method qualified_name (line 556) | def qualified_name(self) -> str | None: method arguments (line 563) | def arguments(self) -> str | None: method _extract_call_id (line 585) | def _extract_call_id(self) -> str | None: method call_id (line 592) | def call_id(self) -> str | None: method to_input_item (line 596) | def to_input_item(self) -> TResponseInputItem: class ModelResponse (line 624) | class ModelResponse: method to_input_items (line 641) | def to_input_items(self) -> list[TResponseInputItem]: class ItemHelpers (line 649) | class ItemHelpers: method extract_last_content (line 651) | def extract_last_content(cls, message: TResponseOutputItem) -> str: method extract_last_text (line 667) | def extract_last_text(cls, message: TResponseOutputItem) -> str | None: method extract_text (line 679) | def extract_text(cls, message: TResponseOutputItem) -> str | None: method input_to_new_input_list (line 692) | def input_to_new_input_list( method text_message_outputs (line 706) | def text_message_outputs(cls, items: list[RunItem]) -> str: method text_message_output (line 715) | def text_message_output(cls, message: MessageOutputItem) -> str: method tool_call_output_item (line 724) | def tool_call_output_item( method _convert_tool_output (line 743) | def _convert_tool_output(cls, output: Any) -> str | ResponseFunctionCa... method _maybe_get_output_as_structured_function_output (line 768) | def _maybe_get_output_as_structured_function_output( method _convert_single_tool_output_pydantic_model (line 786) | def _convert_single_tool_output_pydantic_model( FILE: src/agents/lifecycle.py class RunHooksBase (line 13) | class RunHooksBase(Generic[TContext, TAgent]): method on_llm_start (line 18) | async def on_llm_start( method on_llm_end (line 28) | async def on_llm_end( method on_agent_start (line 37) | async def on_agent_start(self, context: AgentHookContext[TContext], ag... method on_agent_end (line 46) | async def on_agent_end( method on_handoff (line 61) | async def on_handoff( method on_tool_start (line 70) | async def on_tool_start( method on_tool_end (line 79) | async def on_tool_end( class AgentHooksBase (line 90) | class AgentHooksBase(Generic[TContext, TAgent]): method on_start (line 97) | async def on_start(self, context: AgentHookContext[TContext], agent: T... method on_end (line 107) | async def on_end( method on_handoff (line 122) | async def on_handoff( method on_tool_start (line 132) | async def on_tool_start( method on_tool_end (line 141) | async def on_tool_end( method on_llm_start (line 151) | async def on_llm_start( method on_llm_end (line 161) | async def on_llm_end( FILE: src/agents/mcp/manager.py class _ServerCommand (line 14) | class _ServerCommand: class _ServerWorker (line 20) | class _ServerWorker: method __init__ (line 21) | def __init__( method is_done (line 34) | def is_done(self) -> bool: method connect (line 37) | async def connect(self) -> None: method cleanup (line 40) | async def cleanup(self) -> None: method _submit (line 43) | async def _submit(self, action: str, timeout_seconds: float | None) ->... method _run (line 51) | async def _run(self) -> None: function _run_with_timeout_in_task (line 71) | async def _run_with_timeout_in_task( class MCPServerManager (line 108) | class MCPServerManager(AbstractAsyncContextManager["MCPServerManager"]): method __init__ (line 146) | def __init__( method active_servers (line 173) | def active_servers(self) -> list[MCPServer]: method all_servers (line 178) | def all_servers(self) -> list[MCPServer]: method __aenter__ (line 182) | async def __aenter__(self) -> MCPServerManager: method __aexit__ (line 186) | async def __aexit__(self, exc_type, exc_val, exc_tb) -> bool | None: method connect_all (line 190) | async def connect_all(self) -> list[MCPServer]: method reconnect (line 228) | async def reconnect(self, *, failed_only: bool = True) -> list[MCPServ... method cleanup_all (line 255) | async def cleanup_all(self) -> None: method _run_with_timeout (line 269) | async def _run_with_timeout( method _attempt_connect (line 274) | async def _attempt_connect( method _refresh_active_servers (line 297) | def _refresh_active_servers(self) -> None: method _record_failure (line 304) | def _record_failure(self, server: MCPServer, exc: BaseException, phase... method _run_connect (line 311) | async def _run_connect(self, server: MCPServer) -> None: method _cleanup_server (line 318) | async def _cleanup_server(self, server: MCPServer) -> None: method _cleanup_servers (line 336) | async def _cleanup_servers(self, servers: Iterable[MCPServer]) -> None: method _connect_all_parallel (line 349) | async def _connect_all_parallel(self, servers: list[MCPServer]) -> None: method _get_worker (line 379) | def _get_worker(self, server: MCPServer) -> _ServerWorker: method _remove_failed_server (line 390) | def _remove_failed_server(self, server: MCPServer) -> None: method _servers_to_connect (line 397) | def _servers_to_connect(self, servers: Iterable[MCPServer]) -> list[MC... method _unique_servers (line 404) | def _unique_servers(servers: Iterable[MCPServer]) -> list[MCPServer]: FILE: src/agents/mcp/server.py class RequireApprovalToolList (line 42) | class RequireApprovalToolList(TypedDict, total=False): class RequireApprovalObject (line 46) | class RequireApprovalObject(TypedDict, total=False): class _SharedSessionRequestNeedsIsolation (line 66) | class _SharedSessionRequestNeedsIsolation(Exception): class _IsolatedSessionRetryFailed (line 70) | class _IsolatedSessionRetryFailed(Exception): class _UnsetType (line 74) | class _UnsetType: class MCPServer (line 97) | class MCPServer(abc.ABC): method __init__ (line 100) | def __init__( method connect (line 132) | async def connect(self): method name (line 141) | def name(self) -> str: method cleanup (line 146) | async def cleanup(self): method list_tools (line 153) | async def list_tools( method call_tool (line 162) | async def call_tool( method cached_tools (line 172) | def cached_tools(self) -> list[MCPTool] | None: method list_prompts (line 182) | async def list_prompts( method get_prompt (line 189) | async def get_prompt( method _normalize_needs_approval (line 196) | def _normalize_needs_approval( method _get_needs_approval_for_tool (line 251) | def _get_needs_approval_for_tool( method _get_failure_error_function (line 279) | def _get_failure_error_function( class _MCPServerWithClientSession (line 288) | class _MCPServerWithClientSession(MCPServer, abc.ABC): method cached_tools (line 292) | def cached_tools(self) -> list[MCPTool] | None: method __init__ (line 295) | def __init__( method _maybe_serialize_request (line 366) | async def _maybe_serialize_request(self, func: Callable[[], Awaitable[... method _apply_tool_filter (line 372) | async def _apply_tool_filter( method _apply_static_tool_filter (line 392) | def _apply_static_tool_filter( method _apply_dynamic_tool_filter (line 410) | async def _apply_dynamic_tool_filter( method create_streams (line 453) | def create_streams( method __aenter__ (line 459) | async def __aenter__(self): method __aexit__ (line 463) | async def __aexit__(self, exc_type, exc_value, traceback): method invalidate_tools_cache (line 466) | def invalidate_tools_cache(self): method _extract_http_error_from_exception (line 470) | def _extract_http_error_from_exception(self, e: BaseException) -> Exce... method _raise_user_error_for_http_error (line 485) | def _raise_user_error_for_http_error(self, http_error: Exception) -> N... method _run_with_retries (line 499) | async def _run_with_retries(self, func: Callable[[], Awaitable[T]]) -> T: method connect (line 511) | async def connect(self): method list_tools (line 580) | async def list_tools( method call_tool (line 620) | async def call_tool( method _validate_required_parameters (line 657) | def _validate_required_parameters( method list_prompts (line 691) | async def list_prompts( method get_prompt (line 701) | async def get_prompt( method cleanup (line 711) | async def cleanup(self): class MCPServerStdioParams (line 789) | class MCPServerStdioParams(TypedDict): class MCPServerStdio (line 818) | class MCPServerStdio(_MCPServerWithClientSession): method __init__ (line 824) | def __init__( method create_streams (line 900) | def create_streams( method name (line 907) | def name(self) -> str: class MCPServerSseParams (line 912) | class MCPServerSseParams(TypedDict): class MCPServerSse (line 939) | class MCPServerSse(_MCPServerWithClientSession): method __init__ (line 945) | def __init__( method create_streams (line 1015) | def create_streams( method name (line 1032) | def name(self) -> str: class MCPServerStreamableHttpParams (line 1037) | class MCPServerStreamableHttpParams(TypedDict): class MCPServerStreamableHttp (line 1066) | class MCPServerStreamableHttp(_MCPServerWithClientSession): method __init__ (line 1072) | def __init__( method create_streams (line 1144) | def create_streams( method _isolated_client_session (line 1162) | async def _isolated_client_session(self): method _call_tool_with_session (line 1179) | async def _call_tool_with_session( method _should_retry_in_isolated_session (line 1190) | def _should_retry_in_isolated_session(self, exc: BaseException) -> bool: method _call_tool_with_shared_session (line 1211) | async def _call_tool_with_shared_session( method _call_tool_with_isolated_retry (line 1230) | async def _call_tool_with_isolated_retry( method call_tool (line 1277) | async def call_tool( method name (line 1352) | def name(self) -> str: method session_id (line 1357) | def session_id(self) -> str | None: FILE: src/agents/mcp/util.py class HttpClientFactory (line 53) | class HttpClientFactory(Protocol): method __call__ (line 60) | def __call__( class ToolFilterContext (line 69) | class ToolFilterContext: class ToolFilterStatic (line 97) | class ToolFilterStatic(TypedDict): class MCPToolMetaContext (line 117) | class MCPToolMetaContext: function create_static_tool_filter (line 150) | def create_static_tool_filter( class MCPUtil (line 177) | class MCPUtil: method get_all_function_tools (line 181) | async def get_all_function_tools( method get_function_tools (line 212) | async def get_function_tools( method to_function_tool (line 238) | def to_function_tool( method _merge_mcp_meta (line 292) | def _merge_mcp_meta( method _resolve_meta (line 306) | async def _resolve_meta( method invoke_mcp_tool (line 334) | async def invoke_mcp_tool( FILE: src/agents/memory/openai_conversations_session.py function start_openai_conversations_session (line 12) | async def start_openai_conversations_session(openai_client: AsyncOpenAI ... class OpenAIConversationsSession (line 23) | class OpenAIConversationsSession(SessionABC): method __init__ (line 26) | def __init__( method session_id (line 42) | def session_id(self) -> str: method session_id (line 61) | def session_id(self, value: str) -> None: method _get_session_id (line 65) | async def _get_session_id(self) -> str: method _clear_session_id (line 70) | async def _clear_session_id(self) -> None: method get_items (line 73) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 100) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 110) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 121) | async def clear_session(self) -> None: FILE: src/agents/memory/openai_responses_compaction_session.py function select_compaction_candidate_items (line 27) | def select_compaction_candidate_items( function default_should_trigger_compaction (line 51) | def default_should_trigger_compaction(context: dict[str, Any]) -> bool: function is_openai_model_name (line 56) | def is_openai_model_name(model: str) -> bool: class OpenAIResponsesCompactionSession (line 75) | class OpenAIResponsesCompactionSession(SessionABC, OpenAIResponsesCompac... method __init__ (line 83) | def __init__( method client (line 135) | def client(self) -> AsyncOpenAI: method _resolve_compaction_mode_for_response (line 140) | def _resolve_compaction_mode_for_response( method run_compaction (line 157) | async def run_compaction(self, args: OpenAIResponsesCompactionArgs | N... method get_items (line 241) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method _defer_compaction (line 244) | async def _defer_compaction(self, response_id: str, store: bool | None... method _get_deferred_compaction_response_id (line 264) | def _get_deferred_compaction_response_id(self) -> str | None: method _clear_deferred_compaction (line 267) | def _clear_deferred_compaction(self) -> None: method add_items (line 270) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 279) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 286) | async def clear_session(self) -> None: method _ensure_compaction_candidates (line 292) | async def _ensure_compaction_candidates( function _strip_orphaned_assistant_ids (line 310) | def _strip_orphaned_assistant_ids( function _resolve_compaction_mode (line 342) | def _resolve_compaction_mode( FILE: src/agents/memory/session.py class Session (line 14) | class Session(Protocol): method get_items (line 24) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 36) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 44) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 52) | async def clear_session(self) -> None: class SessionABC (line 57) | class SessionABC(ABC): method get_items (line 71) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 84) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 93) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 102) | async def clear_session(self) -> None: class OpenAIResponsesCompactionArgs (line 107) | class OpenAIResponsesCompactionArgs(TypedDict, total=False): class OpenAIResponsesCompactionAwareSession (line 132) | class OpenAIResponsesCompactionAwareSession(Session, Protocol): method run_compaction (line 135) | async def run_compaction(self, args: OpenAIResponsesCompactionArgs | N... function is_openai_responses_compaction_aware_session (line 140) | def is_openai_responses_compaction_aware_session( FILE: src/agents/memory/session_settings.py function resolve_session_limit (line 12) | def resolve_session_limit( class SessionSettings (line 25) | class SessionSettings: method resolve (line 35) | def resolve(self, override: SessionSettings | None) -> SessionSettings: method to_dict (line 49) | def to_dict(self) -> dict[str, Any]: FILE: src/agents/memory/sqlite_session.py class SQLiteSession (line 14) | class SQLiteSession(SessionABC): method __init__ (line 24) | def __init__( method _get_connection (line 65) | def _get_connection(self) -> sqlite3.Connection: method _init_db_for_connection (line 83) | def _init_db_for_connection(self, conn: sqlite3.Connection) -> None: method get_items (line 117) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 173) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 217) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 258) | async def clear_session(self) -> None: method close (line 276) | def close(self) -> None: FILE: src/agents/model_settings.py class _OmitTypeAnnotation (line 24) | class _OmitTypeAnnotation: method __get_pydantic_core_schema__ (line 26) | def __get_pydantic_core_schema__( class MCPToolChoice (line 54) | class MCPToolChoice: class ModelSettings (line 65) | class ModelSettings: method resolve (line 166) | def resolve(self, override: ModelSettings | None) -> ModelSettings: method to_json_dict (line 192) | def to_json_dict(self) -> dict[str, Any]: function _merge_retry_settings (line 196) | def _merge_retry_settings( function _merge_backoff_settings (line 214) | def _merge_backoff_settings( FILE: src/agents/models/_openai_retry.py function _iter_error_chain (line 14) | def _iter_error_chain(error: Exception) -> Iterator[Exception]: function _header_lookup (line 24) | def _header_lookup(headers: Any, key: str) -> str | None: function _get_header_value (line 36) | def _get_header_value(error: Exception, key: str) -> str | None: function _parse_retry_after_ms (line 52) | def _parse_retry_after_ms(value: str | None) -> float | None: function _parse_retry_after (line 62) | def _parse_retry_after(value: str | None) -> float | None: function _get_status_code (line 81) | def _get_status_code(error: Exception) -> int | None: function _get_request_id (line 94) | def _get_request_id(error: Exception) -> str | None: function _get_error_code (line 102) | def _get_error_code(error: Exception) -> str | None: function _is_stateful_request (line 121) | def _is_stateful_request(request: ModelRetryAdviceRequest) -> bool: function _build_normalized_error (line 125) | def _build_normalized_error( function get_openai_retry_advice (line 146) | def get_openai_retry_advice(request: ModelRetryAdviceRequest) -> ModelRe... FILE: src/agents/models/_openai_shared.py function set_default_openai_key (line 18) | def set_default_openai_key(key: str) -> None: function get_default_openai_key (line 23) | def get_default_openai_key() -> str | None: function set_default_openai_client (line 27) | def set_default_openai_client(client: AsyncOpenAI) -> None: function get_default_openai_client (line 32) | def get_default_openai_client() -> AsyncOpenAI | None: function set_use_responses_by_default (line 36) | def set_use_responses_by_default(use_responses: bool) -> None: function get_use_responses_by_default (line 41) | def get_use_responses_by_default() -> bool: function set_use_responses_websocket_by_default (line 45) | def set_use_responses_websocket_by_default(use_responses_websocket: bool... function get_use_responses_websocket_by_default (line 49) | def get_use_responses_websocket_by_default() -> bool: function set_default_openai_responses_transport (line 53) | def set_default_openai_responses_transport(transport: OpenAIResponsesTra... function get_default_openai_responses_transport (line 60) | def get_default_openai_responses_transport() -> OpenAIResponsesTransport: FILE: src/agents/models/_retry_runtime.py function provider_managed_retries_disabled (line 18) | def provider_managed_retries_disabled(disabled: bool) -> Iterator[None]: function should_disable_provider_managed_retries (line 26) | def should_disable_provider_managed_retries() -> bool: function websocket_pre_event_retries_disabled (line 31) | def websocket_pre_event_retries_disabled(disabled: bool) -> Iterator[None]: function should_disable_websocket_pre_event_retries (line 39) | def should_disable_websocket_pre_event_retries() -> bool: FILE: src/agents/models/chatcmpl_converter.py class Converter (line 72) | class Converter: method convert_tool_choice (line 74) | def convert_tool_choice( method convert_response_format (line 100) | def convert_response_format( method message_to_output_items (line 116) | def message_to_output_items( method maybe_easy_input_message (line 237) | def maybe_easy_input_message(cls, item: Any) -> EasyInputMessageParam ... method maybe_input_message (line 256) | def maybe_input_message(cls, item: Any) -> Message | None: method maybe_file_search_call (line 272) | def maybe_file_search_call(cls, item: Any) -> ResponseFileSearchToolCa... method maybe_function_tool_call (line 278) | def maybe_function_tool_call(cls, item: Any) -> ResponseFunctionToolCa... method maybe_function_tool_call_output (line 284) | def maybe_function_tool_call_output( method maybe_item_reference (line 293) | def maybe_item_reference(cls, item: Any) -> ItemReference | None: method maybe_response_output_message (line 299) | def maybe_response_output_message(cls, item: Any) -> ResponseOutputMes... method maybe_reasoning_message (line 310) | def maybe_reasoning_message(cls, item: Any) -> ResponseReasoningItemPa... method extract_text_content (line 316) | def extract_text_content( method extract_all_content (line 333) | def extract_all_content( method items_to_messages (line 425) | def items_to_messages( method tool_to_openai (line 808) | def tool_to_openai(cls, tool: Tool) -> ChatCompletionToolParam: method convert_handoff_tool (line 830) | def convert_handoff_tool(cls, handoff: Handoff[Any, Any]) -> ChatCompl... FILE: src/agents/models/chatcmpl_helpers.py class ChatCmplHelpers (line 24) | class ChatCmplHelpers: method is_openai (line 26) | def is_openai(cls, client: AsyncOpenAI): method get_store_param (line 30) | def get_store_param(cls, client: AsyncOpenAI, model_settings: ModelSet... method get_stream_options_param (line 36) | def get_stream_options_param( method convert_logprobs_for_output_text (line 52) | def convert_logprobs_for_output_text( method convert_logprobs_for_text_delta (line 78) | def convert_logprobs_for_text_delta( method clean_gemini_tool_call_id (line 103) | def clean_gemini_tool_call_id(cls, tool_call_id: str, model: str | Non... FILE: src/agents/models/chatcmpl_stream_handler.py class Part (line 51) | class Part: method __init__ (line 52) | def __init__(self, text: str, type: str): class StreamingState (line 58) | class StreamingState: class SequenceNumber (line 76) | class SequenceNumber: method __init__ (line 77) | def __init__(self): method get_and_increment (line 80) | def get_and_increment(self) -> int: class ChatCmplStreamHandler (line 86) | class ChatCmplStreamHandler: method _finish_reasoning_summary_part (line 88) | def _finish_reasoning_summary_part( method _finish_reasoning_item (line 119) | def _finish_reasoning_item( method handle_stream (line 149) | async def handle_stream( FILE: src/agents/models/default_models.py function _is_gpt_5_none_effort_model (line 28) | def _is_gpt_5_none_effort_model(model_name: str) -> bool: function gpt_5_reasoning_settings_required (line 32) | def gpt_5_reasoning_settings_required(model_name: str) -> bool: function is_gpt_5_default (line 43) | def is_gpt_5_default() -> bool: function get_default_model (line 52) | def get_default_model() -> str: function get_default_model_settings (line 59) | def get_default_model_settings(model: Optional[str] = None) -> ModelSett... FILE: src/agents/models/interface.py class ModelTracing (line 20) | class ModelTracing(enum.Enum): method is_disabled (line 30) | def is_disabled(self) -> bool: method include_data (line 33) | def include_data(self) -> bool: class Model (line 37) | class Model(abc.ABC): method close (line 40) | async def close(self) -> None: method get_retry_advice (line 48) | def get_retry_advice(self, request: ModelRetryAdviceRequest) -> ModelR... method get_response (line 57) | async def get_response( method stream_response (line 92) | def stream_response( class ModelProvider (line 127) | class ModelProvider(abc.ABC): method get_model (line 134) | def get_model(self, model_name: str | None) -> Model: method aclose (line 144) | async def aclose(self) -> None: FILE: src/agents/models/multi_provider.py class MultiProviderMap (line 15) | class MultiProviderMap: method __init__ (line 18) | def __init__(self): method has_prefix (line 21) | def has_prefix(self, prefix: str) -> bool: method get_mapping (line 25) | def get_mapping(self) -> dict[str, ModelProvider]: method set_mapping (line 29) | def set_mapping(self, mapping: dict[str, ModelProvider]): method get_provider (line 33) | def get_provider(self, prefix: str) -> ModelProvider | None: method add_provider (line 41) | def add_provider(self, prefix: str, provider: ModelProvider): method remove_provider (line 50) | def remove_provider(self, prefix: str): class MultiProvider (line 59) | class MultiProvider(ModelProvider): method __init__ (line 72) | def __init__( method _get_prefix_and_model_name (line 132) | def _get_prefix_and_model_name(self, model_name: str | None) -> tuple[... method _create_fallback_provider (line 141) | def _create_fallback_provider(self, prefix: str) -> ModelProvider: method _validate_openai_prefix_mode (line 150) | def _validate_openai_prefix_mode(mode: str) -> MultiProviderOpenAIPref... method _validate_unknown_prefix_mode (line 156) | def _validate_unknown_prefix_mode(mode: str) -> MultiProviderUnknownPr... method _get_fallback_provider (line 163) | def _get_fallback_provider(self, prefix: str | None) -> ModelProvider: method _resolve_prefixed_model (line 172) | def _resolve_prefixed_model( method get_model (line 197) | def get_model(self, model_name: str | None) -> Model: method aclose (line 224) | async def aclose(self) -> None: FILE: src/agents/models/openai_chatcompletions.py class OpenAIChatCompletionsModel (line 48) | class OpenAIChatCompletionsModel(Model): method __init__ (line 53) | def __init__( method _non_null_or_omit (line 63) | def _non_null_or_omit(self, value: Any) -> Any: method get_retry_advice (line 66) | def get_retry_advice(self, request: ModelRetryAdviceRequest) -> ModelR... method _validate_official_openai_input_content_types (line 69) | def _validate_official_openai_input_content_types( method get_response (line 99) | async def get_response( method _attach_logprobs_to_output (line 200) | def _attach_logprobs_to_output( method stream_response (line 212) | async def stream_response( method _fetch_response (line 277) | async def _fetch_response( method _fetch_response (line 292) | async def _fetch_response( method _fetch_response (line 306) | async def _fetch_response( method _get_client (line 444) | def _get_client(self) -> AsyncOpenAI: method _merge_headers (line 453) | def _merge_headers(self, model_settings: ModelSettings): FILE: src/agents/models/openai_provider.py function shared_http_client (line 27) | def shared_http_client() -> httpx.AsyncClient: class OpenAIProvider (line 34) | class OpenAIProvider(ModelProvider): method __init__ (line 35) | def __init__( method _get_client (line 100) | def _get_client(self) -> AsyncOpenAI: method _get_running_loop (line 115) | def _get_running_loop(self) -> asyncio.AbstractEventLoop | None: method _close_ws_models_for_loop (line 121) | async def _close_ws_models_for_loop( method _close_models (line 141) | async def _close_models(self, models: list[Model]) -> None: method _clear_ws_loop_cache_entry (line 145) | def _clear_ws_loop_cache_entry( method _collect_unique_cached_models (line 154) | def _collect_unique_cached_models( method _prune_closed_ws_loop_caches (line 166) | def _prune_closed_ws_loop_caches(self) -> None: method get_model (line 178) | def get_model(self, model_name: str | None) -> Model: method aclose (line 218) | async def aclose(self) -> None: FILE: src/agents/models/openai_responses.py class _NamespaceToolParam (line 91) | class _NamespaceToolParam(TypedDict): function _json_dumps_default (line 98) | def _json_dumps_default(value: Any) -> Any: function _is_openai_omitted_value (line 115) | def _is_openai_omitted_value(value: Any) -> bool: function _require_responses_tool_param (line 119) | def _require_responses_tool_param(value: object) -> ResponsesToolParam: function _is_response_includable (line 130) | def _is_response_includable(value: object) -> TypeGuard[ResponseIncludab... function _coerce_response_includables (line 134) | def _coerce_response_includables(values: Sequence[str]) -> list[Response... function _materialize_responses_tool_params (line 145) | def _materialize_responses_tool_params( function _refresh_openai_client_api_key_if_supported (line 158) | async def _refresh_openai_client_api_key_if_supported(client: Any) -> None: function _construct_response_stream_event_from_payload (line 165) | def _construct_response_stream_event_from_payload( class _WebsocketRequestTimeouts (line 184) | class _WebsocketRequestTimeouts: class _ResponseStreamWithRequestId (line 191) | class _ResponseStreamWithRequestId: method __init__ (line 201) | def __init__( method __aiter__ (line 216) | def __aiter__(self) -> _ResponseStreamWithRequestId: method __anext__ (line 219) | async def __anext__(self) -> ResponseStreamEvent: method aclose (line 236) | async def aclose(self) -> None: method close (line 243) | async def close(self) -> None: method _attach_request_id (line 246) | def _attach_request_id(self, event: ResponseStreamEvent) -> None: method _cleanup_once (line 259) | async def _cleanup_once(self) -> None: method _cleanup_after_exhaustion (line 265) | async def _cleanup_after_exhaustion(self) -> None: method _close_stream_once (line 274) | async def _close_stream_once(self) -> None: class ResponsesWebSocketError (line 291) | class ResponsesWebSocketError(RuntimeError): method __init__ (line 294) | def __init__(self, payload: Mapping[str, Any]): method _coerce_optional_str (line 316) | def _coerce_optional_str(value: Any) -> str | None: function _iter_retry_error_chain (line 320) | def _iter_retry_error_chain(error: Exception): function _get_wrapped_websocket_replay_safety (line 330) | def _get_wrapped_websocket_replay_safety(error: Exception) -> str | None: function _did_start_websocket_response (line 335) | def _did_start_websocket_response(error: Exception) -> bool: function _is_never_sent_websocket_error (line 339) | def _is_never_sent_websocket_error(error: Exception) -> bool: function _is_ambiguous_websocket_replay_error (line 349) | def _is_ambiguous_websocket_replay_error(error: Exception) -> bool: function _get_websocket_timeout_phase (line 359) | def _get_websocket_timeout_phase(error: Exception) -> str | None: function _should_retry_pre_event_websocket_disconnect (line 370) | def _should_retry_pre_event_websocket_disconnect() -> bool: class OpenAIResponsesModel (line 374) | class OpenAIResponsesModel(Model): method __init__ (line 379) | def __init__( method _non_null_or_omit (line 390) | def _non_null_or_omit(self, value: Any) -> Any: method get_retry_advice (line 393) | def get_retry_advice(self, request: ModelRetryAdviceRequest) -> ModelR... method _maybe_aclose_async_iterator (line 396) | async def _maybe_aclose_async_iterator(self, iterator: Any) -> None: method _schedule_async_iterator_close (line 408) | def _schedule_async_iterator_close(self, iterator: Any) -> None: method _consume_background_cleanup_task_result (line 413) | def _consume_background_cleanup_task_result(task: asyncio.Task[Any]) -... method get_response (line 421) | async def get_response( method stream_response (line 499) | async def stream_response( method _fetch_response (line 586) | async def _fetch_response( method _fetch_response (line 601) | async def _fetch_response( method _fetch_response (line 615) | async def _fetch_response( method _build_response_create_kwargs (line 670) | def _build_response_create_kwargs( method _remove_openai_responses_api_incompatible_fields (line 816) | def _remove_openai_responses_api_incompatible_fields(self, list_input:... method _clean_item_for_openai (line 843) | def _clean_item_for_openai(self, item: Any) -> Any | None: method _get_client (line 862) | def _get_client(self) -> AsyncOpenAI: method _merge_headers (line 871) | def _merge_headers(self, model_settings: ModelSettings): class OpenAIResponsesWSModel (line 879) | class OpenAIResponsesWSModel(OpenAIResponsesModel): method __init__ (line 889) | def __init__( method get_retry_advice (line 908) | def get_retry_advice(self, request: ModelRetryAdviceRequest) -> ModelR... method _get_ws_request_lock (line 965) | def _get_ws_request_lock(self) -> asyncio.Lock: method _fetch_response (line 977) | async def _fetch_response( method _fetch_response (line 992) | async def _fetch_response( method _fetch_response (line 1006) | async def _fetch_response( method _iter_websocket_response_events (line 1059) | async def _iter_websocket_response_events( method _should_wrap_pre_event_websocket_disconnect (line 1196) | def _should_wrap_pre_event_websocket_disconnect(self, exc: Exception) ... method _get_websocket_request_timeouts (line 1214) | def _get_websocket_request_timeouts(self, timeout: Any) -> _WebsocketR... method _await_websocket_with_timeout (line 1237) | async def _await_websocket_with_timeout( method _prepare_websocket_request (line 1267) | async def _prepare_websocket_request( method _merge_websocket_headers (line 1310) | def _merge_websocket_headers(self, extra_headers: Mapping[str, Any]) -... method _prepare_websocket_url (line 1330) | def _prepare_websocket_url(self, extra_query: Any) -> str: method _ensure_websocket_connection (line 1371) | async def _ensure_websocket_connection( method _is_websocket_connection_reusable (line 1402) | def _is_websocket_connection_reusable(self, connection: Any) -> bool: method close (line 1425) | async def close(self) -> None: method _get_current_loop_ws_request_lock (line 1437) | def _get_current_loop_ws_request_lock(self) -> asyncio.Lock | None: method _force_abort_websocket_connection (line 1451) | def _force_abort_websocket_connection(self, connection: Any) -> None: method _force_drop_websocket_connection_sync (line 1467) | def _force_drop_websocket_connection_sync(self) -> None: method _clear_websocket_connection_state (line 1477) | def _clear_websocket_connection_state(self) -> None: method _drop_websocket_connection (line 1483) | async def _drop_websocket_connection(self) -> None: method _open_websocket_connection (line 1495) | async def _open_websocket_connection( class ConvertedTools (line 1520) | class ConvertedTools: class Converter (line 1525) | class Converter: method _convert_shell_environment (line 1527) | def _convert_shell_environment(cls, environment: ShellToolEnvironment ... method convert_tool_choice (line 1540) | def convert_tool_choice( method _validate_required_tool_choice (line 1613) | def _validate_required_tool_choice( method _validate_named_function_tool_choice (line 1633) | def _validate_named_function_tool_choice( method _has_computer_tool (line 1710) | def _has_computer_tool(cls, tools: Sequence[Tool] | None) -> bool: method _has_unresolved_computer_tool (line 1714) | def _has_unresolved_computer_tool(cls, tools: Sequence[Tool] | None) -... method _is_preview_computer_model (line 1722) | def _is_preview_computer_model(cls, model: str | ChatModel | None) -> ... method _is_ga_computer_model (line 1726) | def _is_ga_computer_model(cls, model: str | ChatModel | None) -> bool: method resolve_computer_tool_model (line 1730) | def resolve_computer_tool_model( method _should_use_preview_computer_tool (line 1741) | def _should_use_preview_computer_tool( method _convert_builtin_computer_tool_choice (line 1761) | def _convert_builtin_computer_tool_choice( method get_response_format (line 1783) | def get_response_format( method convert_tools (line 1799) | def convert_tools( method _convert_function_tool (line 1884) | def _convert_function_tool( method _convert_preview_computer_tool (line 1902) | def _convert_preview_computer_tool(cls, tool: ComputerTool[Any]) -> Re... method _convert_tool (line 1927) | def _convert_tool( method _convert_handoff_tool (line 2005) | def _convert_handoff_tool(cls, handoff: Handoff) -> ResponsesToolParam: FILE: src/agents/models/reasoning_content_replay.py class ReasoningContentSource (line 9) | class ReasoningContentSource: class ReasoningContentReplayContext (line 23) | class ReasoningContentReplayContext: function default_should_replay_reasoning_content (line 39) | def default_should_replay_reasoning_content(context: ReasoningContentRep... FILE: src/agents/prompts.py class Prompt (line 22) | class Prompt(TypedDict): class GenerateDynamicPromptData (line 36) | class GenerateDynamicPromptData: function _coerce_prompt_dict (line 50) | def _coerce_prompt_dict(prompt: Prompt | dict[object, object]) -> Prompt: class PromptUtil (line 55) | class PromptUtil: method to_model_input (line 57) | async def to_model_input( FILE: src/agents/realtime/_default_tracker.py class ModelAudioState (line 11) | class ModelAudioState: class ModelAudioTracker (line 16) | class ModelAudioTracker: method __init__ (line 17) | def __init__(self) -> None: method set_audio_format (line 22) | def set_audio_format(self, format: RealtimeAudioFormat) -> None: method on_audio_delta (line 26) | def on_audio_delta(self, item_id: str, item_content_index: int, audio_... method on_interrupted (line 37) | def on_interrupted(self) -> None: method get_state (line 41) | def get_state(self, item_id: str, item_content_index: int) -> ModelAud... method get_last_audio_item (line 45) | def get_last_audio_item(self) -> tuple[str, int] | None: FILE: src/agents/realtime/_util.py function calculate_audio_length_ms (line 10) | def calculate_audio_length_ms(format: RealtimeAudioFormat | None, audio_... FILE: src/agents/realtime/agent.py class RealtimeAgent (line 27) | class RealtimeAgent(AgentBase, Generic[TContext]): method clone (line 82) | def clone(self, **kwargs: Any) -> RealtimeAgent[TContext]: method get_system_prompt (line 90) | async def get_system_prompt(self, run_context: RunContextWrapper[TCont... FILE: src/agents/realtime/audio_formats.py function to_realtime_audio_format (line 16) | def to_realtime_audio_format( FILE: src/agents/realtime/config.py class RealtimeClientMessage (line 48) | class RealtimeClientMessage(TypedDict): class RealtimeInputAudioTranscriptionConfig (line 58) | class RealtimeInputAudioTranscriptionConfig(TypedDict): class RealtimeInputAudioNoiseReductionConfig (line 71) | class RealtimeInputAudioNoiseReductionConfig(TypedDict): class RealtimeTurnDetectionConfig (line 78) | class RealtimeTurnDetectionConfig(TypedDict): class RealtimeAudioInputConfig (line 109) | class RealtimeAudioInputConfig(TypedDict, total=False): class RealtimeAudioOutputConfig (line 118) | class RealtimeAudioOutputConfig(TypedDict, total=False): class RealtimeAudioConfig (line 126) | class RealtimeAudioConfig(TypedDict, total=False): class RealtimeSessionModelSettings (line 133) | class RealtimeSessionModelSettings(TypedDict): class RealtimeGuardrailsSettings (line 188) | class RealtimeGuardrailsSettings(TypedDict): class RealtimeModelTracingConfig (line 199) | class RealtimeModelTracingConfig(TypedDict): class RealtimeRunConfig (line 212) | class RealtimeRunConfig(TypedDict): class RealtimeUserInputText (line 236) | class RealtimeUserInputText(TypedDict): class RealtimeUserInputImage (line 246) | class RealtimeUserInputImage(TypedDict, total=False): class RealtimeUserInputMessage (line 254) | class RealtimeUserInputMessage(TypedDict): FILE: src/agents/realtime/events.py class RealtimeEventInfo (line 17) | class RealtimeEventInfo: class RealtimeAgentStartEvent (line 23) | class RealtimeAgentStartEvent: class RealtimeAgentEndEvent (line 36) | class RealtimeAgentEndEvent: class RealtimeHandoffEvent (line 49) | class RealtimeHandoffEvent: class RealtimeToolStart (line 65) | class RealtimeToolStart: class RealtimeToolEnd (line 84) | class RealtimeToolEnd: class RealtimeToolApprovalRequired (line 106) | class RealtimeToolApprovalRequired: class RealtimeRawModelEvent (line 128) | class RealtimeRawModelEvent: class RealtimeAudioEnd (line 141) | class RealtimeAudioEnd: class RealtimeAudio (line 157) | class RealtimeAudio: class RealtimeAudioInterrupted (line 176) | class RealtimeAudioInterrupted: class RealtimeError (line 194) | class RealtimeError: class RealtimeHistoryUpdated (line 207) | class RealtimeHistoryUpdated: class RealtimeHistoryAdded (line 220) | class RealtimeHistoryAdded: class RealtimeGuardrailTripped (line 233) | class RealtimeGuardrailTripped: class RealtimeInputAudioTimeoutTriggered (line 249) | class RealtimeInputAudioTimeoutTriggered: FILE: src/agents/realtime/handoffs.py function realtime_handoff (line 30) | def realtime_handoff( function realtime_handoff (line 41) | def realtime_handoff( function realtime_handoff (line 54) | def realtime_handoff( function realtime_handoff (line 65) | def realtime_handoff( FILE: src/agents/realtime/items.py class InputText (line 8) | class InputText(BaseModel): class InputAudio (line 21) | class InputAudio(BaseModel): class InputImage (line 37) | class InputImage(BaseModel): class AssistantText (line 53) | class AssistantText(BaseModel): class AssistantAudio (line 66) | class AssistantAudio(BaseModel): class SystemMessageItem (line 82) | class SystemMessageItem(BaseModel): class UserMessageItem (line 104) | class UserMessageItem(BaseModel): class AssistantMessageItem (line 126) | class AssistantMessageItem(BaseModel): class RealtimeToolCallItem (line 158) | class RealtimeToolCallItem(BaseModel): class RealtimeResponse (line 193) | class RealtimeResponse(BaseModel): FILE: src/agents/realtime/model.py class RealtimePlaybackState (line 18) | class RealtimePlaybackState(TypedDict): class RealtimePlaybackTracker (line 29) | class RealtimePlaybackTracker: method __init__ (line 35) | def __init__(self) -> None: method on_play_bytes (line 41) | def on_play_bytes(self, item_id: str, item_content_index: int, bytes: ... method on_play_ms (line 52) | def on_play_ms(self, item_id: str, item_content_index: int, ms: float)... method on_interrupted (line 67) | def on_interrupted(self) -> None: method set_audio_format (line 72) | def set_audio_format(self, format: RealtimeAudioFormat) -> None: method get_state (line 80) | def get_state(self) -> RealtimePlaybackState: class RealtimeModelListener (line 98) | class RealtimeModelListener(abc.ABC): method on_event (line 102) | async def on_event(self, event: RealtimeModelEvent) -> None: class RealtimeModelConfig (line 107) | class RealtimeModelConfig(TypedDict): class RealtimeModel (line 151) | class RealtimeModel(abc.ABC): method connect (line 155) | async def connect(self, options: RealtimeModelConfig) -> None: method add_listener (line 160) | def add_listener(self, listener: RealtimeModelListener) -> None: method remove_listener (line 165) | def remove_listener(self, listener: RealtimeModelListener) -> None: method send_event (line 170) | async def send_event(self, event: RealtimeModelSendEvent) -> None: method close (line 175) | async def close(self) -> None: FILE: src/agents/realtime/model_events.py class RealtimeModelErrorEvent (line 14) | class RealtimeModelErrorEvent: class RealtimeModelToolCallEvent (line 23) | class RealtimeModelToolCallEvent: class RealtimeModelAudioEvent (line 37) | class RealtimeModelAudioEvent: class RealtimeModelAudioInterruptedEvent (line 53) | class RealtimeModelAudioInterruptedEvent: class RealtimeModelAudioDoneEvent (line 66) | class RealtimeModelAudioDoneEvent: class RealtimeModelInputAudioTranscriptionCompletedEvent (line 79) | class RealtimeModelInputAudioTranscriptionCompletedEvent: class RealtimeModelInputAudioTimeoutTriggeredEvent (line 89) | class RealtimeModelInputAudioTimeoutTriggeredEvent: class RealtimeModelTranscriptDeltaEvent (line 100) | class RealtimeModelTranscriptDeltaEvent: class RealtimeModelItemUpdatedEvent (line 111) | class RealtimeModelItemUpdatedEvent: class RealtimeModelItemDeletedEvent (line 120) | class RealtimeModelItemDeletedEvent: class RealtimeModelConnectionStatusEvent (line 129) | class RealtimeModelConnectionStatusEvent: class RealtimeModelTurnStartedEvent (line 138) | class RealtimeModelTurnStartedEvent: class RealtimeModelTurnEndedEvent (line 145) | class RealtimeModelTurnEndedEvent: class RealtimeModelOtherEvent (line 152) | class RealtimeModelOtherEvent: class RealtimeModelExceptionEvent (line 161) | class RealtimeModelExceptionEvent: class RealtimeModelRawServerEvent (line 171) | class RealtimeModelRawServerEvent: FILE: src/agents/realtime/model_inputs.py class RealtimeModelRawClientMessage (line 12) | class RealtimeModelRawClientMessage(TypedDict): class RealtimeModelInputTextContent (line 20) | class RealtimeModelInputTextContent(TypedDict): class RealtimeModelInputImageContent (line 27) | class RealtimeModelInputImageContent(TypedDict, total=False): class RealtimeModelUserInputMessage (line 41) | class RealtimeModelUserInputMessage(TypedDict): class RealtimeModelSendRawMessage (line 57) | class RealtimeModelSendRawMessage: class RealtimeModelSendUserInput (line 65) | class RealtimeModelSendUserInput: class RealtimeModelSendAudio (line 73) | class RealtimeModelSendAudio: class RealtimeModelSendToolOutput (line 81) | class RealtimeModelSendToolOutput: class RealtimeModelSendInterrupt (line 95) | class RealtimeModelSendInterrupt: class RealtimeModelSendSessionUpdate (line 103) | class RealtimeModelSendSessionUpdate: FILE: src/agents/realtime/openai_realtime.py function get_api_key (line 175) | async def get_api_key(key: str | Callable[[], MaybeAwaitable[str]] | Non... function get_server_event_type_adapter (line 195) | def get_server_event_type_adapter() -> TypeAdapter[AllRealtimeServerEven... function _collect_enabled_handoffs (line 202) | async def _collect_enabled_handoffs( function _build_model_settings_from_agent (line 225) | async def _build_model_settings_from_agent( class TransportConfig (line 256) | class TransportConfig(TypedDict): class OpenAIRealtimeWebSocketModel (line 271) | class OpenAIRealtimeWebSocketModel(RealtimeModel): method __init__ (line 274) | def __init__(self, *, transport_config: TransportConfig | None = None)... method connect (line 289) | async def connect(self, options: RealtimeModelConfig) -> None: method _create_websocket_connection (line 342) | async def _create_websocket_connection( method _send_tracing_config (line 374) | async def _send_tracing_config( method add_listener (line 391) | def add_listener(self, listener: RealtimeModelListener) -> None: method remove_listener (line 396) | def remove_listener(self, listener: RealtimeModelListener) -> None: method _emit_event (line 401) | async def _emit_event(self, event: RealtimeModelEvent) -> None: method _listen_for_messages (line 407) | async def _listen_for_messages(self): method send_event (line 444) | async def send_event(self, event: RealtimeModelSendEvent) -> None: method _send_raw_message (line 466) | async def _send_raw_message(self, event: OpenAIRealtimeClientEvent) ->... method _send_user_input (line 472) | async def _send_user_input(self, event: RealtimeModelSendUserInput) ->... method _send_audio (line 477) | async def _send_audio(self, event: RealtimeModelSendAudio) -> None: method _send_tool_output (line 485) | async def _send_tool_output(self, event: RealtimeModelSendToolOutput) ... method _get_playback_state (line 504) | def _get_playback_state(self) -> RealtimePlaybackState: method _get_audio_limits (line 527) | def _get_audio_limits(self, item_id: str, item_content_index: int) -> ... method _send_interrupt (line 534) | async def _send_interrupt(self, event: RealtimeModelSendInterrupt) -> ... method _send_session_update (line 595) | async def _send_session_update(self, event: RealtimeModelSendSessionUp... method _handle_audio_delta (line 599) | async def _handle_audio_delta(self, parsed: ResponseAudioDeltaEvent) -... method _handle_output_item (line 616) | async def _handle_output_item(self, item: ConversationItem) -> None: method _handle_conversation_item (line 655) | async def _handle_conversation_item( method close (line 664) | async def close(self) -> None: method _cancel_response (line 677) | async def _cancel_response(self) -> None: method _handle_ws_event (line 682) | async def _handle_ws_event(self, event: dict[str, Any]): method _update_created_session (line 887) | def _update_created_session( method _normalize_session_payload (line 909) | def _normalize_session_payload( method _is_transcription_session (line 938) | def _is_transcription_session(payload: Mapping[str, object]) -> bool: method _extract_audio_format (line 947) | def _extract_audio_format(session: OpenAISessionCreateRequest) -> str ... method _normalize_audio_format (line 955) | def _normalize_audio_format(fmt: object) -> str: method _read_format_type (line 970) | def _read_format_type(fmt: object) -> str | None: method _normalize_turn_detection_config (line 990) | def _normalize_turn_detection_config(config: object) -> object: method _update_session_config (line 1011) | async def _update_session_config(self, model_settings: RealtimeSession... method _get_session_config (line 1017) | def _get_session_config( method _tools_to_session_tools (line 1151) | def _tools_to_session_tools( class OpenAIRealtimeSIPModel (line 1184) | class OpenAIRealtimeSIPModel(OpenAIRealtimeWebSocketModel): method build_initial_session_payload (line 1188) | async def build_initial_session_payload( method connect (line 1223) | async def connect(self, options: RealtimeModelConfig) -> None: class _ConversionHelper (line 1232) | class _ConversionHelper: method conversation_item_to_realtime_message_item (line 1234) | def conversation_item_to_realtime_message_item( method try_convert_raw_message (line 1268) | def try_convert_raw_message( method convert_tracing_config (line 1280) | def convert_tracing_config( method convert_user_input_to_conversation_item (line 1294) | def convert_user_input_to_conversation_item( method convert_user_input_to_item_create (line 1350) | def convert_user_input_to_item_create( method convert_audio_to_input_audio_buffer_append (line 1359) | def convert_audio_to_input_audio_buffer_append( method convert_tool_output (line 1369) | def convert_tool_output(cls, event: RealtimeModelSendToolOutput) -> Op... method convert_interrupt (line 1380) | def convert_interrupt( FILE: src/agents/realtime/runner.py class RealtimeRunner (line 18) | class RealtimeRunner: method __init__ (line 30) | def __init__( method run (line 49) | async def run( FILE: src/agents/realtime/session.py function _serialize_tool_output (line 73) | def _serialize_tool_output(output: Any) -> str: class RealtimeSession (line 96) | class RealtimeSession(RealtimeModelListener): method __init__ (line 116) | def __init__( method model (line 166) | def model(self) -> RealtimeModel: method __aenter__ (line 170) | async def __aenter__(self) -> RealtimeSession: method enter (line 196) | async def enter(self) -> RealtimeSession: method __aexit__ (line 203) | async def __aexit__(self, _exc_type: Any, _exc_val: Any, _exc_tb: Any)... method __aiter__ (line 207) | async def __aiter__(self) -> AsyncIterator[RealtimeSessionEvent]: method close (line 222) | async def close(self) -> None: method send_message (line 226) | async def send_message(self, message: RealtimeUserInput) -> None: method send_audio (line 230) | async def send_audio(self, audio: bytes, *, commit: bool = False) -> N... method interrupt (line 234) | async def interrupt(self) -> None: method update_agent (line 238) | async def update_agent(self, agent: RealtimeAgent) -> None: method on_event (line 251) | async def on_event(self, event: RealtimeModelEvent) -> None: method _put_event (line 425) | async def _put_event(self, event: RealtimeSessionEvent) -> None: method _function_needs_approval (line 429) | async def _function_needs_approval( method _build_tool_approval_item (line 448) | def _build_tool_approval_item( method _maybe_request_tool_approval (line 460) | async def _maybe_request_tool_approval( method _send_tool_rejection (line 499) | async def _send_tool_rejection( method _resolve_approval_rejection_message (line 529) | async def _resolve_approval_rejection_message(self, *, tool: FunctionT... method approve_tool_call (line 572) | async def approve_tool_call(self, call_id: str, *, always: bool = Fals... method reject_tool_call (line 586) | async def reject_tool_call( method _handle_tool_call (line 606) | async def _handle_tool_call( method _get_new_history (line 734) | def _get_new_history( method _run_output_guardrails (line 905) | async def _run_output_guardrails(self, text: str, response_id: str) ->... method _enqueue_guardrail_task (line 970) | def _enqueue_guardrail_task(self, text: str, response_id: str) -> None: method _on_guardrail_task_done (line 979) | def _on_guardrail_task_done(self, task: asyncio.Task[Any]) -> None: method _cleanup_guardrail_tasks (line 998) | def _cleanup_guardrail_tasks(self) -> None: method _enqueue_tool_call_task (line 1004) | def _enqueue_tool_call_task( method _on_tool_call_task_done (line 1012) | def _on_tool_call_task_done(self, task: asyncio.Task[Any]) -> None: method _cleanup_tool_call_tasks (line 1036) | def _cleanup_tool_call_tasks(self) -> None: method _cleanup (line 1042) | async def _cleanup(self) -> None: method _get_updated_model_settings_from_agent (line 1060) | async def _get_updated_model_settings_from_agent( method _get_handoffs (line 1091) | async def _get_handoffs( FILE: src/agents/repl.py function run_demo_loop (line 15) | async def run_demo_loop( FILE: src/agents/responses_websocket_session.py class ResponsesWebSocketSession (line 23) | class ResponsesWebSocketSession: method __post_init__ (line 29) | def __post_init__(self) -> None: method _validate_provider_alignment (line 32) | def _validate_provider_alignment(self) -> MultiProvider: method aclose (line 44) | async def aclose(self) -> None: method _prepare_runner_kwargs (line 48) | def _prepare_runner_kwargs(self, method_name: str, kwargs: Mapping[str... method run (line 58) | async def run( method run_streamed (line 68) | def run_streamed( function responses_websocket_session (line 80) | async def responses_websocket_session( FILE: src/agents/result.py class AgentToolInvocation (line 55) | class AgentToolInvocation: function _populate_state_from_result (line 68) | def _populate_state_from_result( function _input_items_for_result (line 116) | def _input_items_for_result( class RunResultBase (line 148) | class RunResultBase(abc.ABC): method __get_pydantic_core_schema__ (line 190) | def __get_pydantic_core_schema__( method last_agent (line 201) | def last_agent(self) -> Agent[Any]: method release_agents (line 204) | def release_agents(self, *, release_new_items: bool = True) -> None: method __del__ (line 218) | def __del__(self) -> None: method _release_last_agent_reference (line 230) | def _release_last_agent_reference(self) -> None: method final_output_as (line 233) | def final_output_as(self, cls: type[T], raise_if_incorrect_type: bool ... method to_input_list (line 251) | def to_input_list( method agent_tool_invocation (line 272) | def agent_tool_invocation(self) -> AgentToolInvocation | None: method last_response_id (line 289) | def last_response_id(self) -> str | None: class RunResult (line 298) | class RunResult(RunResultBase): method __post_init__ (line 334) | def __post_init__(self) -> None: method last_agent (line 338) | def last_agent(self) -> Agent[Any]: method _release_last_agent_reference (line 349) | def _release_last_agent_reference(self) -> None: method to_state (line 357) | def to_state(self) -> RunState[Any]: method __str__ (line 404) | def __str__(self) -> str: class RunResultStreaming (line 409) | class RunResultStreaming(RunResultBase): method __post_init__ (line 497) | def __post_init__(self, _run_impl_task: asyncio.Task[Any] | None) -> N... method last_agent (line 507) | def last_agent(self) -> Agent[Any]: method _release_last_agent_reference (line 520) | def _release_last_agent_reference(self) -> None: method cancel (line 528) | def cancel(self, mode: Literal["immediate", "after_turn"] = "immediate... method stream_events (line 576) | async def stream_events(self) -> AsyncIterator[StreamEvent]: method _create_error_details (line 647) | def _create_error_details(self) -> RunErrorDetails: method _check_errors (line 659) | def _check_errors(self): method _cleanup_tasks (line 701) | def _cleanup_tasks(self): method __str__ (line 711) | def __str__(self) -> str: method _await_task_safely (line 714) | async def _await_task_safely(self, task: asyncio.Task[Any] | None) -> ... method _drain_event_queue (line 730) | def _drain_event_queue(self) -> None: method _drain_input_guardrail_queue (line 742) | def _drain_input_guardrail_queue(self) -> None: method to_state (line 750) | def to_state(self) -> RunState[Any]: FILE: src/agents/retry.py class ModelRetryBackoffSettings (line 17) | class ModelRetryBackoffSettings: method to_json_dict (line 32) | def to_json_dict(self) -> dict[str, Any]: function _coerce_backoff_settings (line 39) | def _coerce_backoff_settings( class ModelRetryNormalizedError (line 51) | class ModelRetryNormalizedError: method __init__ (line 63) | def __init__( class ModelRetryAdvice (line 94) | class ModelRetryAdvice: class ModelRetryAdviceRequest (line 105) | class ModelRetryAdviceRequest: class RetryDecision (line 116) | class RetryDecision: class RetryPolicyContext (line 127) | class RetryPolicyContext: function _mark_retry_capabilities (line 143) | def _mark_retry_capabilities( function retry_policy_retries_safe_transport_errors (line 154) | def retry_policy_retries_safe_transport_errors(policy: RetryPolicy | Non... function retry_policy_retries_all_transient_errors (line 158) | def retry_policy_retries_all_transient_errors(policy: RetryPolicy | None... class ModelRetrySettings (line 163) | class ModelRetrySettings: method __post_init__ (line 175) | def __post_init__(self) -> None: method to_json_dict (line 178) | def to_json_dict(self) -> dict[str, Any]: function _coerce_decision (line 186) | def _coerce_decision(value: bool | RetryDecision) -> RetryDecision: function _evaluate_policy (line 192) | async def _evaluate_policy( function _with_hard_veto (line 202) | def _with_hard_veto(decision: RetryDecision) -> RetryDecision: function _with_replay_safe_approval (line 207) | def _with_replay_safe_approval(decision: RetryDecision) -> RetryDecision: function _merge_positive_retry_decisions (line 212) | def _merge_positive_retry_decisions( class _RetryPolicies (line 232) | class _RetryPolicies: method never (line 233) | def never(self) -> RetryPolicy: method provider_suggested (line 243) | def provider_suggested(self) -> RetryPolicy: method network_error (line 261) | def network_error(self) -> RetryPolicy: method retry_after (line 271) | def retry_after(self) -> RetryPolicy: method http_status (line 286) | def http_status(self, statuses: Iterable[int]) -> RetryPolicy: method all (line 299) | def all(self, *policies: RetryPolicy) -> RetryPolicy: method any (line 330) | def any(self, *policies: RetryPolicy) -> RetryPolicy: FILE: src/agents/run.py function set_default_agent_runner (line 138) | def set_default_agent_runner(runner: AgentRunner | None) -> None: function get_default_agent_runner (line 147) | def get_default_agent_runner() -> AgentRunner: class Runner (line 156) | class Runner: method run (line 158) | async def run( method run_sync (line 238) | def run_sync( method run_streamed (line 316) | def run_streamed( class AgentRunner (line 391) | class AgentRunner: method run (line 397) | async def run( method run_sync (line 1346) | def run_sync( method run_streamed (line 1429) | def run_streamed( FILE: src/agents/run_config.py function _default_trace_include_sensitive_data (line 30) | def _default_trace_include_sensitive_data() -> bool: class ModelInputData (line 37) | class ModelInputData: class CallModelData (line 45) | class CallModelData(Generic[TContext]): class ToolErrorFormatterArgs (line 58) | class ToolErrorFormatterArgs(Generic[TContext]): class RunConfig (line 84) | class RunConfig: class RunOptions (line 195) | class RunOptions(TypedDict, Generic[TContext]): FILE: src/agents/run_context.py class _ApprovalRecord (line 29) | class _ApprovalRecord: class RunContextWrapper (line 43) | class RunContextWrapper(Generic[TContext]): method _to_str_or_none (line 65) | def _to_str_or_none(value: Any) -> str | None: method _resolve_tool_name (line 76) | def _resolve_tool_name(approval_item: ToolApprovalItem) -> str: method _resolve_tool_namespace (line 88) | def _resolve_tool_namespace(approval_item: ToolApprovalItem) -> str | ... method _resolve_approval_key (line 99) | def _resolve_approval_key(approval_item: ToolApprovalItem) -> str: method _resolve_approval_keys (line 114) | def _resolve_approval_keys(approval_item: ToolApprovalItem) -> tuple[s... method _resolve_tool_lookup_key (line 126) | def _resolve_tool_lookup_key(approval_item: ToolApprovalItem) -> Funct... method _resolve_call_id (line 146) | def _resolve_call_id(approval_item: ToolApprovalItem) -> str | None: method _get_or_create_approval_entry (line 170) | def _get_or_create_approval_entry(self, tool_name: str) -> _ApprovalRe... method is_tool_approved (line 177) | def is_tool_approved(self, tool_name: str, call_id: str) -> bool | None: method _get_approval_status_for_key (line 181) | def _get_approval_status_for_key(self, approval_key: str, call_id: str... method _clear_rejection_message (line 213) | def _clear_rejection_message(record: _ApprovalRecord, call_id: str | N... method _get_rejection_message_for_key (line 219) | def _get_rejection_message_for_key(record: _ApprovalRecord, call_id: s... method get_rejection_message (line 228) | def get_rejection_message( method _apply_approval_decision (line 300) | def _apply_approval_decision( method approve_tool (line 346) | def approve_tool(self, approval_item: ToolApprovalItem, always_approve... method reject_tool (line 354) | def reject_tool( method get_approval_status (line 368) | def get_approval_status( method _rebuild_approvals (line 438) | def _rebuild_approvals(self, approvals: dict[str, dict[str, Any]]) -> ... method _fork_with_tool_input (line 457) | def _fork_with_tool_input(self, tool_input: Any) -> RunContextWrapper[... method _fork_without_tool_input (line 466) | def _fork_without_tool_input(self) -> RunContextWrapper[TContext]: class AgentHookContext (line 476) | class AgentHookContext(RunContextWrapper[TContext]): FILE: src/agents/run_error_handlers.py class RunErrorData (line 16) | class RunErrorData: class RunErrorHandlerInput (line 28) | class RunErrorHandlerInput(Generic[TContext]): class RunErrorHandlerResult (line 35) | class RunErrorHandlerResult: class RunErrorHandlers (line 49) | class RunErrorHandlers(TypedDict, Generic[TContext], total=False): FILE: src/agents/run_internal/_asyncio_progress.py function _get_awaitable_to_wait_on (line 18) | def _get_awaitable_to_wait_on(awaitable: Any) -> Any | None: function _get_sleep_deadline_from_awaitable (line 29) | def _get_sleep_deadline_from_awaitable( function _get_scheduled_future_deadline (line 59) | def _get_scheduled_future_deadline( function _iter_shielded_future_child_tasks (line 83) | def _iter_shielded_future_child_tasks(future: asyncio.Future[Any]) -> tu... function _iter_future_child_tasks (line 97) | def _iter_future_child_tasks(future: asyncio.Future[Any]) -> tuple[async... function _get_self_progress_deadline_for_future (line 107) | def _get_self_progress_deadline_for_future( function _get_self_progress_deadline_for_awaitable (line 151) | def _get_self_progress_deadline_for_awaitable( function get_function_tool_task_progress_deadline (line 179) | def get_function_tool_task_progress_deadline( FILE: src/agents/run_internal/agent_runner_helpers.py function should_cancel_parallel_model_task_on_input_guardrail_trip (line 56) | def should_cancel_parallel_model_task_on_input_guardrail_trip() -> bool: function apply_resumed_conversation_settings (line 72) | def apply_resumed_conversation_settings( function validate_session_conversation_settings (line 90) | def validate_session_conversation_settings( function resolve_trace_settings (line 107) | def resolve_trace_settings( function resolve_resumed_context (line 137) | def resolve_resumed_context( function ensure_context_wrapper (line 154) | def ensure_context_wrapper( function describe_run_state_step (line 163) | def describe_run_state_step(step: object | None) -> str | int | None: function build_generated_items_details (line 178) | def build_generated_items_details( function build_resumed_stream_debug_extra (line 198) | def build_resumed_stream_debug_extra( function finalize_conversation_tracking (line 217) | def finalize_conversation_tracking( function build_interruption_result (line 236) | def build_interruption_result( function append_model_response_if_new (line 282) | def append_model_response_if_new( function input_guardrails_triggered (line 291) | def input_guardrails_triggered(results: list[InputGuardrailResult]) -> b... function update_run_state_for_interruption (line 296) | def update_run_state_for_interruption( function save_turn_items_if_needed (line 316) | async def save_turn_items_if_needed( function resolve_processed_response (line 343) | def resolve_processed_response( FILE: src/agents/run_internal/approvals.py function append_approval_error_output (line 23) | def append_approval_error_output( function filter_tool_approvals (line 43) | def filter_tool_approvals(interruptions: Sequence[Any]) -> list[ToolAppr... function approvals_from_step (line 48) | def approvals_from_step(step: Any) -> list[ToolApprovalItem]: function append_input_items_excluding_approvals (line 56) | def append_input_items_excluding_approvals( function _build_function_tool_call_for_approval_error (line 74) | def _build_function_tool_call_for_approval_error( FILE: src/agents/run_internal/error_handlers.py function build_run_error_data (line 31) | def build_run_error_data( function format_final_output_text (line 57) | def format_final_output_text(agent: Agent[Any], final_output: Any) -> str: function validate_handler_final_output (line 80) | def validate_handler_final_output(agent: Agent[Any], final_output: Any) ... function create_message_output_item (line 110) | def create_message_output_item(agent: Agent[Any], output_text: str) -> M... function resolve_run_error_handler_result (line 128) | async def resolve_run_error_handler_result( FILE: src/agents/run_internal/guardrails.py function run_single_input_guardrail (line 30) | async def run_single_input_guardrail( function run_single_output_guardrail (line 42) | async def run_single_output_guardrail( function run_input_guardrails_with_queue (line 54) | async def run_input_guardrails_with_queue( function run_input_guardrails (line 102) | async def run_input_guardrails( function run_output_guardrails (line 137) | async def run_output_guardrails( function input_guardrail_tripwire_triggered_for_stream (line 171) | async def input_guardrail_tripwire_triggered_for_stream( FILE: src/agents/run_internal/items.py function copy_input_items (line 55) | def copy_input_items(value: str | list[TResponseInputItem]) -> str | lis... function run_item_to_input_item (line 60) | def run_item_to_input_item( function run_items_to_input_items (line 77) | def run_items_to_input_items( function drop_orphan_function_calls (line 90) | def drop_orphan_function_calls( function ensure_input_item_format (line 132) | def ensure_input_item_format(item: TResponseInputItem) -> TResponseInput... function normalize_input_items_for_api (line 141) | def normalize_input_items_for_api(items: list[TResponseInputItem]) -> li... function prepare_model_input_items (line 156) | def prepare_model_input_items( function normalize_resumed_input (line 170) | def normalize_resumed_input( function fingerprint_input_item (line 180) | def fingerprint_input_item(item: Any, *, ignore_ids_for_matching: bool =... function _dedupe_key (line 205) | def _dedupe_key(item: TResponseInputItem) -> str | None: function _should_omit_reasoning_item_ids (line 234) | def _should_omit_reasoning_item_ids(reasoning_item_id_policy: ReasoningI... function _without_reasoning_item_id (line 238) | def _without_reasoning_item_id(item: TResponseInputItem) -> TResponseInp... function deduplicate_input_items (line 250) | def deduplicate_input_items(items: Sequence[TResponseInputItem]) -> list... function deduplicate_input_items_preferring_latest (line 266) | def deduplicate_input_items_preferring_latest( function function_rejection_item (line 275) | def function_rejection_item( function shell_rejection_item (line 292) | def shell_rejection_item( function apply_patch_rejection_item (line 312) | def apply_patch_rejection_item( function extract_mcp_request_id (line 332) | def extract_mcp_request_id(raw_item: Any) -> str | None: function extract_mcp_request_id_from_run (line 357) | def extract_mcp_request_id_from_run(mcp_run: Any) -> str | None: function _completed_call_ids_by_type (line 382) | def _completed_call_ids_by_type(payload: list[TResponseInputItem]) -> di... function _matched_anonymous_tool_search_call_indexes (line 399) | def _matched_anonymous_tool_search_call_indexes(payload: list[TResponseI... function _coerce_to_dict (line 425) | def _coerce_to_dict(value: object) -> dict[str, Any] | None: function _model_dump_without_warnings (line 436) | def _model_dump_without_warnings(value: object) -> dict[str, Any] | None: FILE: src/agents/run_internal/model_retry.py function _iter_error_chain (line 47) | def _iter_error_chain(error: Exception) -> Iterator[Exception]: function _is_conversation_locked_error (line 57) | def _is_conversation_locked_error(error: Exception) -> bool: function _get_header_value (line 63) | def _get_header_value(headers: Any, key: str) -> str | None: function _extract_headers (line 75) | def _extract_headers(error: Exception) -> httpx.Headers | Mapping[str, s... function _parse_retry_after (line 89) | def _parse_retry_after(headers: httpx.Headers | Mapping[str, str] | None... function _get_status_code (line 121) | def _get_status_code(error: Exception) -> int | None: function _get_error_code (line 134) | def _get_error_code(error: Exception) -> str | None: function _get_request_id (line 153) | def _get_request_id(error: Exception) -> str | None: function _is_abort_like_error (line 161) | def _is_abort_like_error(error: Exception) -> bool: function _is_network_like_error (line 174) | def _is_network_like_error(error: Exception) -> bool: function _normalize_retry_error (line 205) | def _normalize_retry_error( function _coerce_retry_decision (line 245) | def _coerce_retry_decision(value: bool | RetryDecision) -> RetryDecision: function _call_retry_policy (line 251) | async def _call_retry_policy( function _default_retry_delay (line 261) | def _default_retry_delay( function _sleep_for_retry (line 293) | async def _sleep_for_retry(delay: float) -> None: function _build_zero_request_usage_entry (line 299) | def _build_zero_request_usage_entry() -> RequestUsage: function _build_request_usage_entry_from_usage (line 309) | def _build_request_usage_entry_from_usage(usage: Usage) -> RequestUsage: function apply_retry_attempt_usage (line 319) | def apply_retry_attempt_usage(usage: Usage, failed_attempts: int) -> Usage: function _close_async_iterator (line 334) | async def _close_async_iterator(iterator: Any) -> None: function _close_async_iterator_quietly (line 347) | async def _close_async_iterator_quietly(iterator: Any | None) -> None: function _get_stream_event_type (line 357) | def _get_stream_event_type(event: TResponseStreamEvent) -> str | None: function _stream_event_blocks_retry (line 365) | def _stream_event_blocks_retry(event: TResponseStreamEvent) -> bool: function _evaluate_retry (line 370) | async def _evaluate_retry( function _is_stateful_request (line 436) | def _is_stateful_request( function _should_preserve_conversation_locked_compatibility (line 444) | def _should_preserve_conversation_locked_compatibility( function _should_disable_provider_managed_retries (line 456) | def _should_disable_provider_managed_retries( function _should_disable_websocket_pre_event_retry (line 494) | def _should_disable_websocket_pre_event_retry( function get_response_with_retry (line 511) | async def get_response_with_retry( function stream_response_with_retry (line 610) | async def stream_response_with_retry( FILE: src/agents/run_internal/oai_conversation.py function _normalize_server_item_id (line 35) | def _normalize_server_item_id(value: Any) -> str | None: function _fingerprint_for_tracker (line 43) | def _fingerprint_for_tracker(item: Any) -> str | None: function _anonymous_tool_search_fingerprint (line 67) | def _anonymous_tool_search_fingerprint(item: Any) -> str | None: function _is_tool_search_item (line 81) | def _is_tool_search_item(item: Any) -> bool: class OpenAIServerConversationTracker (line 88) | class OpenAIServerConversationTracker: method __post_init__ (line 129) | def __post_init__(self): method hydrate_from_state (line 137) | def hydrate_from_state( method track_server_items (line 294) | def track_server_items(self, model_response: ModelResponse | None) -> ... method mark_input_as_sent (line 343) | def mark_input_as_sent(self, items: Sequence[TResponseInputItem]) -> N... method rewind_input (line 378) | def rewind_input(self, items: Sequence[TResponseInputItem]) -> None: method prepare_input (line 401) | def prepare_input( method _register_prepared_item_source (line 501) | def _register_prepared_item_source( method _resolve_prepared_item_source (line 513) | def _resolve_prepared_item_source(self, item: TResponseInputItem) -> T... method _consume_prepared_item_source (line 527) | def _consume_prepared_item_source(self, item: TResponseInputItem) -> T... FILE: src/agents/run_internal/run_loop.py function _should_persist_stream_items (line 233) | async def _should_persist_stream_items( function _prepare_turn_input_items (line 245) | def _prepare_turn_input_items( function _complete_stream_interruption (line 255) | def _complete_stream_interruption( function _save_resumed_stream_items (line 267) | async def _save_resumed_stream_items( function _save_stream_items (line 297) | async def _save_stream_items( function _run_output_guardrails_for_stream (line 328) | async def _run_output_guardrails_for_stream( function _finalize_streamed_final_output (line 351) | async def _finalize_streamed_final_output( function _finalize_streamed_interruption (line 379) | async def _finalize_streamed_interruption( function start_streaming (line 400) | async def start_streaming( function run_single_turn_streamed (line 1087) | async def run_single_turn_streamed( function run_single_turn (line 1481) | async def run_single_turn( function get_new_response (line 1564) | async def get_new_response( FILE: src/agents/run_internal/run_steps.py class QueueCompleteSentinel (line 49) | class QueueCompleteSentinel: class ToolRunHandoff (line 59) | class ToolRunHandoff: class ToolRunFunction (line 65) | class ToolRunFunction: class ToolRunComputerAction (line 71) | class ToolRunComputerAction: class ToolRunMCPApprovalRequest (line 77) | class ToolRunMCPApprovalRequest: class ToolRunLocalShellCall (line 83) | class ToolRunLocalShellCall: class ToolRunShellCall (line 89) | class ToolRunShellCall: class ToolRunApplyPatchCall (line 95) | class ToolRunApplyPatchCall: class ProcessedResponse (line 101) | class ProcessedResponse: method has_tools_or_approvals_to_run (line 113) | def has_tools_or_approvals_to_run(self) -> bool: method has_interruptions (line 128) | def has_interruptions(self) -> bool: class NextStepHandoff (line 134) | class NextStepHandoff: class NextStepFinalOutput (line 139) | class NextStepFinalOutput: class NextStepRunAgain (line 144) | class NextStepRunAgain: class NextStepInterruption (line 149) | class NextStepInterruption: class SingleStepResult (line 157) | class SingleStepResult: method generated_items (line 191) | def generated_items(self) -> list[RunItem]: FILE: src/agents/run_internal/session_persistence.py function prepare_input_with_session (line 53) | async def prepare_input_with_session( function persist_session_items_for_guardrail_trip (line 170) | async def persist_session_items_for_guardrail_trip( function session_items_for_turn (line 195) | def session_items_for_turn(turn_result: SingleStepResult) -> list[RunItem]: function resumed_turn_items (line 205) | def resumed_turn_items(turn_result: SingleStepResult) -> tuple[list[RunI... function update_run_state_after_resume (line 212) | def update_run_state_after_resume( function save_result_to_session (line 227) | async def save_result_to_session( function save_resumed_turn_items (line 362) | async def save_resumed_turn_items( function rewind_session_items (line 386) | async def rewind_session_items( function wait_for_session_cleanup (line 508) | async def wait_for_session_cleanup( function _ignore_ids_for_matching (line 555) | def _ignore_ids_for_matching(session: Session) -> bool: function _sanitize_openai_conversation_item (line 562) | def _sanitize_openai_conversation_item(item: TResponseInputItem) -> TRes... function _fingerprint_or_repr (line 572) | def _fingerprint_or_repr(item: TResponseInputItem, *, ignore_ids_for_mat... function _session_item_key (line 579) | def _session_item_key(item: Any) -> str: function _build_reference_map (line 593) | def _build_reference_map(items: Sequence[Any]) -> dict[str, list[Any]]: function _consume_reference (line 602) | def _consume_reference(ref_map: dict[str, list[Any]], key: str, candidat... function _build_frequency_map (line 616) | def _build_frequency_map(items: Sequence[Any]) -> dict[str, int]: FILE: src/agents/run_internal/streaming.py function stream_step_items_to_queue (line 27) | def stream_step_items_to_queue( function stream_step_result_to_queue (line 65) | def stream_step_result_to_queue( FILE: src/agents/run_internal/tool_actions.py function _serialize_trace_payload (line 73) | def _serialize_trace_payload(payload: Any) -> str: class ComputerAction (line 89) | class ComputerAction: method execute (line 96) | async def execute( method _execute_action_and_capture (line 183) | async def _execute_action_and_capture( method _iter_actions (line 260) | def _iter_actions(tool_call: ResponseComputerToolCall) -> list[Any]: method _get_trace_input_payload (line 270) | def _get_trace_input_payload(cls, tool_call: ResponseComputerToolCall)... method _serialize_action_payload (line 279) | def _serialize_action_payload(action: Any) -> Any: class LocalShellAction (line 289) | class LocalShellAction: method execute (line 293) | async def execute( class ShellAction (line 341) | class ShellAction: method execute (line 345) | async def execute( class ApplyPatchAction (line 523) | class ApplyPatchAction: method execute (line 527) | async def execute( FILE: src/agents/run_internal/tool_execution.py class _FunctionToolFailure (line 164) | class _FunctionToolFailure: class _FunctionToolTaskState (line 173) | class _FunctionToolTaskState: function _background_cleanup_task_exception_message (line 182) | def _background_cleanup_task_exception_message(exc: BaseException) -> st... function _background_post_invoke_task_exception_message (line 194) | def _background_post_invoke_task_exception_message(exc: BaseException) -... function _parent_cancelled_task_exception_message (line 200) | def _parent_cancelled_task_exception_message(exc: BaseException) -> str ... function _consume_function_tool_task_result (line 207) | def _consume_function_tool_task_result( function _get_function_tool_failure_priority (line 233) | def _get_function_tool_failure_priority(error: BaseException) -> int: function _select_function_tool_failure (line 242) | def _select_function_tool_failure( function _merge_late_function_tool_failure (line 261) | def _merge_late_function_tool_failure( function _cancel_function_tool_tasks (line 282) | def _cancel_function_tool_tasks(tasks: set[asyncio.Task[Any]]) -> None: function _attach_function_tool_task_result_callbacks (line 288) | def _attach_function_tool_task_result_callbacks( function _record_completed_function_tool_tasks (line 302) | def _record_completed_function_tool_tasks( function _collect_settled_function_tool_tasks (line 334) | def _collect_settled_function_tool_tasks( function _wait_for_cancelled_function_tool_task_progress (line 357) | async def _wait_for_cancelled_function_tool_task_progress( function _wait_for_function_tool_task_completion (line 398) | async def _wait_for_function_tool_task_completion( function _settle_pending_function_tool_tasks (line 412) | async def _settle_pending_function_tool_tasks( function _drain_cancelled_function_tool_tasks (line 462) | async def _drain_cancelled_function_tool_tasks( function _wait_pending_function_tool_tasks_for_timeout (line 489) | async def _wait_pending_function_tool_tasks_for_timeout( function maybe_reset_tool_choice (line 513) | def maybe_reset_tool_choice( function resolve_enabled_function_tools (line 524) | async def resolve_enabled_function_tools( function initialize_computer_tools (line 547) | async def initialize_computer_tools( function get_mapping_or_attr (line 562) | def get_mapping_or_attr(target: Any, key: str) -> Any: function extract_tool_call_id (line 569) | def extract_tool_call_id(raw: Any) -> str | None: function extract_shell_call_id (line 581) | def extract_shell_call_id(tool_call: Any) -> str: function coerce_shell_call (line 589) | def coerce_shell_call(tool_call: Any) -> ShellCallData: function _parse_apply_patch_json (line 637) | def _parse_apply_patch_json(payload: str, *, label: str) -> dict[str, Any]: function parse_apply_patch_custom_input (line 648) | def parse_apply_patch_custom_input(input_json: str) -> dict[str, Any]: function parse_apply_patch_function_args (line 653) | def parse_apply_patch_function_args(arguments: str) -> dict[str, Any]: function extract_apply_patch_call_id (line 658) | def extract_apply_patch_call_id(tool_call: Any) -> str: function coerce_apply_patch_operation (line 666) | def coerce_apply_patch_operation( function normalize_apply_patch_result (line 701) | def normalize_apply_patch_result( function is_apply_patch_name (line 720) | def is_apply_patch_name(name: str | None, tool: ApplyPatchTool | None) -... function normalize_shell_output (line 732) | def normalize_shell_output(entry: ShellCommandOutput | Mapping[str, Any]... function serialize_shell_output (line 781) | def serialize_shell_output(output: ShellCommandOutput) -> dict[str, Any]: function resolve_exit_code (line 800) | def resolve_exit_code(raw_exit_code: Any, outcome_status: str | None) ->... function render_shell_outputs (line 814) | def render_shell_outputs(outputs: Sequence[ShellCommandOutput]) -> str: function truncate_shell_outputs (line 847) | def truncate_shell_outputs( function normalize_shell_output_entries (line 887) | def normalize_shell_output_entries( function normalize_max_output_length (line 922) | def normalize_max_output_length(value: int | None) -> int | None: function format_shell_error (line 929) | def format_shell_error(error: Exception | BaseException | Any) -> str: function get_trace_tool_error (line 940) | def get_trace_tool_error(*, trace_include_sensitive_data: bool, error_me... function with_tool_function_span (line 945) | async def with_tool_function_span( function build_litellm_json_tool_call (line 967) | def build_litellm_json_tool_call(output: ResponseFunctionToolCall) -> Fu... function resolve_approval_status (line 986) | async def resolve_approval_status( function resolve_approval_interruption (line 1031) | def resolve_approval_interruption( function resolve_approval_rejection_message (line 1045) | async def resolve_approval_rejection_message( function function_needs_approval (line 1101) | async def function_needs_approval( function process_hosted_mcp_approvals (line 1122) | def process_hosted_mcp_approvals( function collect_manual_mcp_approvals (line 1185) | def collect_manual_mcp_approvals( function index_approval_items_by_call_id (line 1247) | def index_approval_items_by_call_id(items: Sequence[RunItem]) -> dict[st... function should_keep_hosted_mcp_item (line 1259) | def should_keep_hosted_mcp_item( class _FunctionToolBatchExecutor (line 1276) | class _FunctionToolBatchExecutor: method __init__ (line 1279) | def __init__( method execute (line 1307) | async def execute( method _create_tool_task (line 1336) | def _create_tool_task(self, tool_run: ToolRunFunction, order: int) -> ... method _drain_pending_tasks (line 1348) | async def _drain_pending_tasks(self) -> None: method _raise_failure_after_draining_siblings (line 1362) | async def _raise_failure_after_draining_siblings( method _partition_pending_tasks (line 1393) | def _partition_pending_tasks(self) -> tuple[set[asyncio.Task[Any]], se... method _drain_cancelled_tasks (line 1399) | async def _drain_cancelled_tasks( method _wait_post_invoke_tasks (line 1414) | async def _wait_post_invoke_tasks( method _cancel_pending_tasks_for_parent_cancellation (line 1429) | def _cancel_pending_tasks_for_parent_cancellation(self) -> None: method _run_single_tool (line 1437) | async def _run_single_tool( method _maybe_execute_tool_approval (line 1506) | async def _maybe_execute_tool_approval( method _execute_single_tool_body (line 1583) | async def _execute_single_tool_body( method _invoke_tool_and_run_post_invoke (line 1624) | async def _invoke_tool_and_run_post_invoke( method _await_invoke_task (line 1680) | async def _await_invoke_task( method _get_nested_tool_interruptions (line 1717) | def _get_nested_tool_interruptions( method _consume_nested_tool_run_result (line 1726) | def _consume_nested_tool_run_result( method _resolve_nested_tool_run_result (line 1737) | def _resolve_nested_tool_run_result( method _build_function_tool_results (line 1751) | def _build_function_tool_results(self) -> list[FunctionToolResult]: function execute_function_tool_calls (line 1793) | async def execute_function_tool_calls( function execute_local_shell_calls (line 1815) | async def execute_local_shell_calls( function execute_shell_calls (line 1840) | async def execute_shell_calls( function execute_apply_patch_calls (line 1865) | async def execute_apply_patch_calls( function execute_computer_actions (line 1890) | async def execute_computer_actions( function execute_approved_tools (line 1940) | async def execute_approved_tools( function _execute_tool_input_guardrails (line 2108) | async def _execute_tool_input_guardrails( function _execute_tool_output_guardrails (line 2142) | async def _execute_tool_output_guardrails( function _normalize_exit_code (line 2180) | def _normalize_exit_code(value: Any) -> int | None: function _is_hosted_mcp_approval_request (line 2190) | def _is_hosted_mcp_approval_request(raw_item: Any) -> bool: FILE: src/agents/run_internal/tool_planning.py function _hashable_identity_value (line 66) | def _hashable_identity_value(value: Any) -> Hashable | None: function _tool_call_identity (line 80) | def _tool_call_identity(raw: Any) -> tuple[str | None, str | None, Hasha... function execute_mcp_approval_requests (line 92) | async def execute_mcp_approval_requests( function _build_tool_output_index (line 133) | def _build_tool_output_index(items: Sequence[RunItem]) -> set[tuple[str,... function _dedupe_tool_call_items (line 151) | def _dedupe_tool_call_items( class ToolExecutionPlan (line 171) | class ToolExecutionPlan: method has_interruptions (line 184) | def has_interruptions(self) -> bool: function _partition_mcp_approval_requests (line 188) | def _partition_mcp_approval_requests( function _collect_mcp_approval_plan (line 202) | def _collect_mcp_approval_plan( function _build_plan_for_fresh_turn (line 228) | def _build_plan_for_fresh_turn( function _build_plan_for_resume_turn (line 257) | def _build_plan_for_resume_turn( function _collect_tool_interruptions (line 291) | def _collect_tool_interruptions( function _build_tool_result_items (line 319) | def _build_tool_result_items( function _make_unique_item_appender (line 341) | def _make_unique_item_appender( function _collect_runs_by_approval (line 359) | async def _collect_runs_by_approval( function _apply_manual_mcp_approvals (line 427) | def _apply_manual_mcp_approvals( function _append_mcp_callback_results (line 448) | async def _append_mcp_callback_results( function _select_function_tool_runs_for_resume (line 467) | async def _select_function_tool_runs_for_resume( function _execute_tool_plan (line 518) | async def _execute_tool_plan( FILE: src/agents/run_internal/tool_use_tracker.py class AgentToolUseTracker (line 46) | class AgentToolUseTracker: method __init__ (line 49) | def __init__(self) -> None: method record_used_tools (line 55) | def record_used_tools(self, agent: Agent[Any], tools: list[ToolRunFunc... method record_processed_response (line 62) | def record_processed_response( method add_tool_use (line 79) | def add_tool_use(self, agent: Agent[Any], tool_names: list[str]) -> None: method has_used_tools (line 94) | def has_used_tools(self, agent: Agent[Any]) -> bool: method as_serializable (line 98) | def as_serializable(self) -> dict[str, list[str]]: method from_serializable (line 109) | def from_serializable(cls, data: dict[str, list[str]]) -> AgentToolUse... function serialize_tool_use_tracker (line 115) | def serialize_tool_use_tracker(tool_use_tracker: AgentToolUseTracker) ->... function hydrate_tool_use_tracker (line 123) | def hydrate_tool_use_tracker( function get_tool_call_types (line 141) | def get_tool_call_types() -> tuple[type, ...]: FILE: src/agents/run_internal/turn_preparation.py function validate_run_hooks (line 30) | def validate_run_hooks( function maybe_filter_model_input (line 48) | async def maybe_filter_model_input( function get_handoffs (line 85) | async def get_handoffs(agent: Agent[Any], context_wrapper: RunContextWra... function get_all_tools (line 108) | async def get_all_tools(agent: Agent[Any], context_wrapper: RunContextWr... function get_output_schema (line 113) | def get_output_schema(agent: Agent[Any]) -> AgentOutputSchemaBase | None: function get_model (line 123) | def get_model(agent: Agent[Any], run_config: RunConfig) -> Model: FILE: src/agents/run_internal/turn_resolution.py function _maybe_finalize_from_tool_results (line 156) | async def _maybe_finalize_from_tool_results( function run_final_output_hooks (line 198) | async def run_final_output_hooks( function execute_final_output_step (line 219) | async def execute_final_output_step( function execute_final_output (line 252) | async def execute_final_output( function execute_handoffs (line 285) | async def execute_handoffs( function check_for_final_output_from_tools (line 464) | async def check_for_final_output_from_tools( function execute_tools_and_side_effects (line 499) | async def execute_tools_and_side_effects( function resolve_interrupted_turn (line 665) | async def resolve_interrupted_turn( function process_model_response (line 1273) | def process_model_response( function get_single_step_result_from_response (line 1685) | async def get_single_step_result_from_response( FILE: src/agents/run_state.py class RunState (line 139) | class RunState(Generic[TContext, TAgent]): method __init__ (line 223) | def __init__( method get_interruptions (line 261) | def get_interruptions(self) -> list[ToolApprovalItem]: method approve (line 270) | def approve(self, approval_item: ToolApprovalItem, always_approve: boo... method reject (line 276) | def reject( method _serialize_approvals (line 297) | def _serialize_approvals(self) -> dict[str, dict[str, Any]]: method _serialize_model_responses (line 319) | def _serialize_model_responses(self) -> list[dict[str, Any]]: method _serialize_original_input (line 331) | def _serialize_original_input(self) -> str | list[Any]: method _serialize_context_payload (line 351) | def _serialize_context_payload( method _serialize_tool_input (line 476) | def _serialize_tool_input(self, tool_input: Any) -> Any: method _current_generated_items_merge_marker (line 493) | def _current_generated_items_merge_marker(self) -> str | None: method _mark_generated_items_merged_with_last_processed (line 514) | def _mark_generated_items_merged_with_last_processed(self) -> None: method _clear_generated_items_last_processed_marker (line 518) | def _clear_generated_items_last_processed_marker(self) -> None: method _merge_generated_items_with_processed (line 522) | def _merge_generated_items_with_processed(self) -> list[RunItem]: method to_json (line 589) | def to_json( method _serialize_processed_response (line 684) | def _serialize_processed_response( method _serialize_current_step (line 725) | def _serialize_current_step(self) -> dict[str, Any] | None: method _serialize_item (line 748) | def _serialize_item(self, item: RunItem) -> dict[str, Any]: method _lookup_function_name (line 790) | def _lookup_function_name(self, call_id: str) -> str: method to_string (line 839) | def to_string( method set_trace (line 863) | def set_trace(self, trace: Trace | None) -> None: method _serialize_trace_data (line 867) | def _serialize_trace_data(self, *, include_tracing_api_key: bool) -> d... method set_tool_use_tracker_snapshot (line 872) | def set_tool_use_tracker_snapshot(self, snapshot: Mapping[str, Sequenc... method set_reasoning_item_id_policy (line 885) | def set_reasoning_item_id_policy(self, policy: Literal["preserve", "om... method get_tool_use_tracker_snapshot (line 889) | def get_tool_use_tracker_snapshot(self) -> dict[str, list[str]]: method from_string (line 897) | async def from_string( method from_json (line 938) | async def from_json( function _get_attr (line 979) | def _get_attr(obj: Any, attr: str, default: Any = None) -> Any: function _describe_context_type (line 984) | def _describe_context_type(value: Any) -> str: function _context_class_path (line 997) | def _context_class_path(value: Any) -> str | None: function _build_context_meta (line 1009) | def _build_context_meta( function _context_meta_requires_deserializer (line 1031) | def _context_meta_requires_deserializer(context_meta: Mapping[str, Any] ... function _context_meta_warning_message (line 1040) | def _context_meta_warning_message(context_meta: Mapping[str, Any] | None... function _transform_field_names (line 1061) | def _transform_field_names( function _serialize_raw_item_value (line 1084) | def _serialize_raw_item_value(raw_item: Any) -> Any: function _ensure_json_compatible (line 1093) | def _ensure_json_compatible(value: Any) -> Any: function _serialize_tool_call_data (line 1100) | def _serialize_tool_call_data(tool_call: Any) -> Any: function _serialize_tool_metadata (line 1105) | def _serialize_tool_metadata( function _serialize_tool_actions (line 1129) | def _serialize_tool_actions( function _serialize_handoffs (line 1155) | def _serialize_handoffs(handoffs: Sequence[Any]) -> list[dict[str, Any]]: function _serialize_mcp_approval_requests (line 1170) | def _serialize_mcp_approval_requests(requests: Sequence[Any]) -> list[di... function _serialize_mcp_tool (line 1184) | def _serialize_mcp_tool(mcp_tool: Any) -> dict[str, Any]: function _serialize_tool_approval_interruption (line 1216) | def _serialize_tool_approval_interruption( function _serialize_tool_action_groups (line 1239) | def _serialize_tool_action_groups( function _serialize_pending_nested_agent_tool_runs (line 1312) | def _serialize_pending_nested_agent_tool_runs( class _SerializedAgentToolRunResult (line 1377) | class _SerializedAgentToolRunResult: method __init__ (line 1380) | def __init__(self, state: RunState[Any, Agent[Any]]) -> None: method to_state (line 1385) | def to_state(self) -> RunState[Any, Agent[Any]]: function _serialize_guardrail_results (line 1389) | def _serialize_guardrail_results( function _serialize_tool_guardrail_results (line 1412) | def _serialize_tool_guardrail_results( function _serialize_last_model_response (line 1437) | def _serialize_last_model_response(model_responses: list[dict[str, Any]]... function _build_named_tool_map (line 1444) | def _build_named_tool_map( function _build_handoffs_map (line 1474) | def _build_handoffs_map(current_agent: Agent[Any]) -> dict[str, Handoff[... function _restore_pending_nested_agent_tool_runs (line 1489) | async def _restore_pending_nested_agent_tool_runs( function _deserialize_processed_response (line 1541) | async def _deserialize_processed_response( function _deserialize_tool_call_raw_item (line 1833) | def _deserialize_tool_call_raw_item(normalized_raw_item: Mapping[str, An... function _resolve_agent_from_data (line 1855) | def _resolve_agent_from_data( function _deserialize_tool_approval_raw_item (line 1872) | def _deserialize_tool_approval_raw_item(normalized_raw_item: Any) -> Any: function _deserialize_tool_approval_item (line 1880) | def _deserialize_tool_approval_item( function _deserialize_tool_call_output_raw_item (line 1913) | def _deserialize_tool_call_output_raw_item( function _parse_guardrail_entry (line 1944) | def _parse_guardrail_entry( function _parse_tool_guardrail_entry (line 1963) | def _parse_tool_guardrail_entry( function _deserialize_input_guardrail_results (line 1992) | def _deserialize_input_guardrail_results( function _deserialize_output_guardrail_results (line 2017) | def _deserialize_output_guardrail_results( function _deserialize_tool_input_guardrail_results (line 2057) | def _deserialize_tool_input_guardrail_results( function _deserialize_tool_output_guardrail_results (line 2082) | def _deserialize_tool_output_guardrail_results( function _build_run_state_from_json (line 2107) | async def _build_run_state_from_json( function _build_agent_map (line 2301) | def _build_agent_map(initial_agent: Agent[Any]) -> dict[str, Agent[Any]]: function _deserialize_model_responses (line 2392) | def _deserialize_model_responses(responses_data: list[dict[str, Any]]) -... function _deserialize_items (line 2428) | def _deserialize_items( function _clone_original_input (line 2617) | def _clone_original_input(original_input: str | list[Any]) -> str | list... FILE: src/agents/stream_events.py class RawResponsesStreamEvent (line 13) | class RawResponsesStreamEvent: class RunItemStreamEvent (line 26) | class RunItemStreamEvent: class AgentUpdatedStreamEvent (line 54) | class AgentUpdatedStreamEvent: FILE: src/agents/strict_schema.py function ensure_strict_json_schema (line 18) | def ensure_strict_json_schema( function _ensure_strict_json_schema (line 30) | def _ensure_strict_json_schema( function resolve_ref (line 149) | def resolve_ref(*, root: dict[str, object], ref: str) -> object: function is_dict (line 165) | def is_dict(obj: object) -> TypeGuard[dict[str, object]]: function is_list (line 171) | def is_list(obj: object) -> TypeGuard[list[object]]: function has_more_than_n_keys (line 175) | def has_more_than_n_keys(obj: dict[str, object], n: int) -> bool: FILE: src/agents/tool.py class ToolOutputText (line 87) | class ToolOutputText(BaseModel): class ToolOutputTextDict (line 94) | class ToolOutputTextDict(TypedDict, total=False): class ToolOutputImage (line 101) | class ToolOutputImage(BaseModel): method check_at_least_one_required_field (line 114) | def check_at_least_one_required_field(self) -> ToolOutputImage: class ToolOutputImageDict (line 121) | class ToolOutputImageDict(TypedDict, total=False): class ToolOutputFileContent (line 130) | class ToolOutputFileContent(BaseModel): method check_at_least_one_required_field (line 144) | def check_at_least_one_required_field(self) -> ToolOutputFileContent: class ToolOutputFileContentDict (line 151) | class ToolOutputFileContentDict(TypedDict, total=False): class ComputerCreate (line 172) | class ComputerCreate(Protocol[ComputerT_co]): method __call__ (line 175) | def __call__(self, *, run_context: RunContextWrapper[Any]) -> MaybeAwa... class ComputerDispose (line 178) | class ComputerDispose(Protocol[ComputerT_contra]): method __call__ (line 181) | def __call__( class ComputerProvider (line 190) | class ComputerProvider(Generic[ComputerT]): class FunctionToolResult (line 205) | class FunctionToolResult: class FunctionTool (line 226) | class FunctionTool: method qualified_name (line 330) | def qualified_name(self) -> str: method __post_init__ (line 336) | def __post_init__(self): method __copy__ (line 344) | def __copy__(self) -> FunctionTool: class _FailureHandlingFunctionToolInvoker (line 357) | class _FailureHandlingFunctionToolInvoker: method __init__ (line 360) | def __init__( method __agents_bind_function_tool__ (line 371) | def __agents_bind_function_tool__( method __call__ (line 385) | async def __call__(self, ctx: ToolContext[Any], input: str) -> Any: function with_function_tool_failure_error_handler (line 402) | def with_function_tool_failure_error_handler( function _build_wrapped_function_tool (line 410) | def _build_wrapped_function_tool( class FileSearchTool (line 462) | class FileSearchTool: method name (line 483) | def name(self): class WebSearchTool (line 488) | class WebSearchTool: method name (line 503) | def name(self): class ComputerTool (line 508) | class ComputerTool(Generic[ComputerT]): method __post_init__ (line 517) | def __post_init__(self) -> None: method name (line 521) | def name(self): method trace_name (line 528) | def trace_name(self): class _ResolvedComputer (line 534) | class _ResolvedComputer: function resolve_computer (line 551) | async def resolve_computer( function dispose_resolved_computers (line 603) | async def dispose_resolved_computers(*, run_context: RunContextWrapper[A... class ComputerToolSafetyCheckData (line 633) | class ComputerToolSafetyCheckData: class MCPToolApprovalRequest (line 650) | class MCPToolApprovalRequest: class MCPToolApprovalFunctionResult (line 660) | class MCPToolApprovalFunctionResult(TypedDict): class ShellOnApprovalFunctionResult (line 684) | class ShellOnApprovalFunctionResult(TypedDict): class ApplyPatchOnApprovalFunctionResult (line 710) | class ApplyPatchOnApprovalFunctionResult(TypedDict): class HostedMCPTool (line 729) | class HostedMCPTool: method name (line 745) | def name(self): class CodeInterpreterTool (line 750) | class CodeInterpreterTool: method name (line 757) | def name(self): class ImageGenerationTool (line 762) | class ImageGenerationTool: method name (line 769) | def name(self): class LocalShellCommandRequest (line 774) | class LocalShellCommandRequest: class LocalShellTool (line 789) | class LocalShellTool: method name (line 800) | def name(self): class ShellToolLocalSkill (line 804) | class ShellToolLocalSkill(TypedDict): class ShellToolSkillReference (line 812) | class ShellToolSkillReference(TypedDict): class ShellToolInlineSkillSource (line 820) | class ShellToolInlineSkillSource(TypedDict): class ShellToolInlineSkill (line 828) | class ShellToolInlineSkill(TypedDict): class ShellToolContainerNetworkPolicyDomainSecret (line 841) | class ShellToolContainerNetworkPolicyDomainSecret(TypedDict): class ShellToolContainerNetworkPolicyAllowlist (line 849) | class ShellToolContainerNetworkPolicyAllowlist(TypedDict): class ShellToolContainerNetworkPolicyDisabled (line 857) | class ShellToolContainerNetworkPolicyDisabled(TypedDict): class ShellToolLocalEnvironment (line 870) | class ShellToolLocalEnvironment(TypedDict): class ShellToolContainerAutoEnvironment (line 877) | class ShellToolContainerAutoEnvironment(TypedDict): class ShellToolContainerReferenceEnvironment (line 887) | class ShellToolContainerReferenceEnvironment(TypedDict): class ShellCallOutcome (line 905) | class ShellCallOutcome: class ShellCommandOutput (line 913) | class ShellCommandOutput: method exit_code (line 923) | def exit_code(self) -> int | None: method status (line 927) | def status(self) -> Literal["completed", "timeout"]: class ShellResult (line 932) | class ShellResult: class ShellActionRequest (line 941) | class ShellActionRequest: class ShellCallData (line 950) | class ShellCallData: class ShellCommandRequest (line 960) | class ShellCommandRequest: function _normalize_shell_tool_environment (line 971) | def _normalize_shell_tool_environment( class ShellTool (line 987) | class ShellTool: method __post_init__ (line 1009) | def __post_init__(self) -> None: method type (line 1030) | def type(self) -> str: class ApplyPatchTool (line 1035) | class ApplyPatchTool: method type (line 1053) | def type(self) -> str: class ToolSearchTool (line 1058) | class ToolSearchTool: method name (line 1070) | def name(self) -> str: function tool_namespace (line 1090) | def tool_namespace( function get_function_tool_responses_only_features (line 1116) | def get_function_tool_responses_only_features(tool: FunctionTool) -> tup... function ensure_function_tool_supports_responses_only_features (line 1126) | def ensure_function_tool_supports_responses_only_features( function ensure_tool_choice_supports_backend (line 1144) | def ensure_tool_choice_supports_backend( function is_responses_tool_search_surface (line 1153) | def is_responses_tool_search_surface(tool: Tool) -> bool: function has_responses_tool_search_surface (line 1162) | def has_responses_tool_search_surface(tools: list[Tool]) -> bool: function is_required_tool_search_surface (line 1167) | def is_required_tool_search_surface(tool: Tool) -> bool: function has_required_tool_search_surface (line 1176) | def has_required_tool_search_surface(tools: list[Tool]) -> bool: function validate_responses_tool_search_configuration (line 1181) | def validate_responses_tool_search_configuration( function prune_orphaned_tool_search_tools (line 1210) | def prune_orphaned_tool_search_tools(tools: list[Tool]) -> list[Tool]: function _extract_json_decode_error (line 1220) | def _extract_json_decode_error(error: BaseException) -> json.JSONDecodeE... function _extract_tool_argument_json_error (line 1229) | def _extract_tool_argument_json_error(error: Exception) -> json.JSONDeco... function _build_handled_function_tool_error_handler (line 1237) | def _build_handled_function_tool_error_handler( function _parse_function_tool_json_input (line 1281) | def _parse_function_tool_json_input(*, tool_name: str, input_json: str) ... function _log_function_tool_invocation (line 1293) | def _log_function_tool_invocation(*, tool_name: str, input_json: str) ->... function default_tool_error_function (line 1301) | def default_tool_error_function(ctx: RunContextWrapper[Any], error: Exce... function default_tool_timeout_error_message (line 1319) | def default_tool_timeout_error_message(*, tool_name: str, timeout_second... function set_function_tool_failure_error_function (line 1324) | def set_function_tool_failure_error_function( function resolve_function_tool_failure_error_function (line 1340) | def resolve_function_tool_failure_error_function( class _FunctionToolCancelledError (line 1349) | class _FunctionToolCancelledError(Exception): method __init__ (line 1354) | def __init__(self, cancelled_error: asyncio.CancelledError): function _coerce_tool_error_for_failure_error_function (line 1360) | def _coerce_tool_error_for_failure_error_function(error: BaseException) ... function maybe_invoke_function_tool_failure_error_function (line 1369) | async def maybe_invoke_function_tool_failure_error_function( function _annotation_expr_name (line 1387) | def _annotation_expr_name(expr: ast.expr) -> str | None: function _string_annotation_mentions_context_type (line 1396) | def _string_annotation_mentions_context_type(annotation: str, *, type_na... function _annotation_expr_mentions_context_type (line 1406) | def _annotation_expr_mentions_context_type(expr: ast.expr, *, type_name:... function _annotation_mentions_context_type (line 1438) | def _annotation_mentions_context_type(annotation: Any, *, context_type: ... function _get_function_tool_invoke_context (line 1464) | def _get_function_tool_invoke_context( function invoke_function_tool (line 1498) | async def invoke_function_tool( function function_tool (line 1543) | def function_tool( function function_tool (line 1567) | def function_tool( function function_tool (line 1589) | def function_tool( function _is_computer_provider (line 1742) | def _is_computer_provider(candidate: object) -> bool: function _validate_function_tool_timeout_config (line 1748) | def _validate_function_tool_timeout_config(tool: FunctionTool) -> None: function _store_computer_initializer (line 1776) | def _store_computer_initializer(tool: ComputerTool[Any]) -> None: function _get_computer_initializer (line 1782) | def _get_computer_initializer(tool: ComputerTool[Any]) -> ComputerConfig... function _track_resolved_computer (line 1792) | def _track_resolved_computer( FILE: src/agents/tool_context.py function _assert_must_pass_tool_call_id (line 20) | def _assert_must_pass_tool_call_id() -> str: function _assert_must_pass_tool_name (line 24) | def _assert_must_pass_tool_name() -> str: function _assert_must_pass_tool_arguments (line 28) | def _assert_must_pass_tool_arguments() -> str: class ToolContext (line 36) | class ToolContext(RunContextWrapper[TContext]): method __init__ (line 60) | def __init__( method qualified_tool_name (line 108) | def qualified_tool_name(self) -> str: method from_agent_context (line 113) | def from_agent_context( FILE: src/agents/tool_guardrails.py class ToolInputGuardrailResult (line 19) | class ToolInputGuardrailResult: class ToolOutputGuardrailResult (line 30) | class ToolOutputGuardrailResult: class RejectContentBehavior (line 40) | class RejectContentBehavior(TypedDict): class RaiseExceptionBehavior (line 47) | class RaiseExceptionBehavior(TypedDict): class AllowBehavior (line 53) | class AllowBehavior(TypedDict): class ToolGuardrailFunctionOutput (line 60) | class ToolGuardrailFunctionOutput: method allow (line 80) | def allow(cls, output_info: Any = None) -> ToolGuardrailFunctionOutput: method reject_content (line 92) | def reject_content(cls, message: str, output_info: Any = None) -> Tool... method raise_exception (line 108) | def raise_exception(cls, output_info: Any = None) -> ToolGuardrailFunc... class ToolInputGuardrailData (line 121) | class ToolInputGuardrailData: class ToolOutputGuardrailData (line 136) | class ToolOutputGuardrailData(ToolInputGuardrailData): class ToolInputGuardrail (line 152) | class ToolInputGuardrail(Generic[TContext_co]): method get_name (line 167) | def get_name(self) -> str: method run (line 170) | async def run(self, data: ToolInputGuardrailData) -> ToolGuardrailFunc... class ToolOutputGuardrail (line 181) | class ToolOutputGuardrail(Generic[TContext_co]): method get_name (line 196) | def get_name(self) -> str: method run (line 199) | async def run(self, data: ToolOutputGuardrailData) -> ToolGuardrailFun... function tool_input_guardrail (line 215) | def tool_input_guardrail(func: _ToolInputFuncSync): ... function tool_input_guardrail (line 219) | def tool_input_guardrail(func: _ToolInputFuncAsync): ... function tool_input_guardrail (line 223) | def tool_input_guardrail( function tool_input_guardrail (line 228) | def tool_input_guardrail( function tool_output_guardrail (line 251) | def tool_output_guardrail(func: _ToolOutputFuncSync): ... function tool_output_guardrail (line 255) | def tool_output_guardrail(func: _ToolOutputFuncAsync): ... function tool_output_guardrail (line 259) | def tool_output_guardrail( function tool_output_guardrail (line 264) | def tool_output_guardrail( FILE: src/agents/tracing/__init__.py function add_trace_processor (line 85) | def add_trace_processor(span_processor: TracingProcessor) -> None: function set_trace_processors (line 92) | def set_trace_processors(processors: list[TracingProcessor]) -> None: function set_tracing_disabled (line 99) | def set_tracing_disabled(disabled: bool) -> None: function set_tracing_export_api_key (line 106) | def set_tracing_export_api_key(api_key: str) -> None: FILE: src/agents/tracing/config.py class TracingConfig (line 6) | class TracingConfig(TypedDict, total=False): FILE: src/agents/tracing/context.py function _get_tracing_api_key (line 16) | def _get_tracing_api_key(tracing: TracingConfig | None) -> str | None: function _trace_state_matches_effective_settings (line 20) | def _trace_state_matches_effective_settings( function create_trace_for_run (line 47) | def create_trace_for_run( class TraceCtxManager (line 91) | class TraceCtxManager: method __init__ (line 94) | def __init__( method __enter__ (line 115) | def __enter__(self) -> TraceCtxManager: method __exit__ (line 131) | def __exit__(self, exc_type, exc_val, exc_tb): FILE: src/agents/tracing/create.py function trace (line 29) | def trace( function get_current_trace (line 77) | def get_current_trace() -> Trace | None: function get_current_span (line 82) | def get_current_span() -> Span[Any] | None: function agent_span (line 87) | def agent_span( function function_span (line 122) | def function_span( function generation_span (line 155) | def generation_span( function response_span (line 203) | def response_span( function handoff_span (line 229) | def handoff_span( function custom_span (line 260) | def custom_span( function guardrail_span (line 292) | def guardrail_span( function transcription_span (line 320) | def transcription_span( function speech_span (line 364) | def speech_span( function speech_group_span (line 407) | def speech_group_span( function mcp_tools_span (line 433) | def mcp_tools_span( FILE: src/agents/tracing/model_tracing.py function get_model_tracing_impl (line 6) | def get_model_tracing_impl( FILE: src/agents/tracing/processor_interface.py class TracingProcessor (line 9) | class TracingProcessor(abc.ABC): method on_trace_start (line 54) | def on_trace_start(self, trace: "Trace") -> None: method on_trace_end (line 68) | def on_trace_end(self, trace: "Trace") -> None: method on_span_start (line 82) | def on_span_start(self, span: "Span[Any]") -> None: method on_span_end (line 96) | def on_span_end(self, span: "Span[Any]") -> None: method shutdown (line 110) | def shutdown(self) -> None: method force_flush (line 121) | def force_flush(self) -> None: class TracingExporter (line 132) | class TracingExporter(abc.ABC): method export (line 136) | def export(self, items: list["Trace | Span[Any]"]) -> None: FILE: src/agents/tracing/processors.py class ConsoleSpanExporter (line 21) | class ConsoleSpanExporter(TracingExporter): method export (line 24) | def export(self, items: list[Trace | Span[Any]]) -> None: class BackendSpanExporter (line 32) | class BackendSpanExporter(TracingExporter): method __init__ (line 44) | def __init__( method set_api_key (line 78) | def set_api_key(self, api_key: str): method api_key (line 93) | def api_key(self): method organization (line 97) | def organization(self): method project (line 101) | def project(self): method export (line 104) | def export(self, items: list[Trace | Span[Any]]) -> None: method _should_sanitize_for_openai_tracing_api (line 183) | def _should_sanitize_for_openai_tracing_api(self) -> bool: method _sanitize_for_openai_tracing_api (line 186) | def _sanitize_for_openai_tracing_api(self, payload_item: dict[str, Any... method _value_json_size_bytes (line 241) | def _value_json_size_bytes(self, value: Any) -> int: method _truncate_string_for_json_limit (line 248) | def _truncate_string_for_json_limit(self, value: str, max_bytes: int) ... method _truncate_span_field_value (line 275) | def _truncate_span_field_value(self, value: Any) -> Any: method _truncate_json_value_for_limit (line 286) | def _truncate_json_value_for_limit(self, value: Any, max_bytes: int) -... method _truncate_mapping_for_json_limit (line 301) | def _truncate_mapping_for_json_limit( method _truncate_list_for_json_limit (line 325) | def _truncate_list_for_json_limit(self, value: list[Any], max_bytes: i... method _truncated_preview (line 348) | def _truncated_preview(self, value: Any) -> dict[str, Any]: method _sanitize_generation_usage_for_openai_tracing_api (line 364) | def _sanitize_generation_usage_for_openai_tracing_api( method _is_finite_json_number (line 401) | def _is_finite_json_number(self, value: Any) -> bool: method _sanitize_json_compatible_value (line 408) | def _sanitize_json_compatible_value(self, value: Any, seen_ids: set[in... method close (line 449) | def close(self): class BatchTraceProcessor (line 454) | class BatchTraceProcessor(TracingProcessor): method __init__ (line 461) | def __init__( method _ensure_thread_started (line 495) | def _ensure_thread_started(self) -> None: method on_trace_start (line 508) | def on_trace_start(self, trace: Trace) -> None: method on_trace_end (line 517) | def on_trace_end(self, trace: Trace) -> None: method on_span_start (line 521) | def on_span_start(self, span: Span[Any]) -> None: method on_span_end (line 525) | def on_span_end(self, span: Span[Any]) -> None: method shutdown (line 534) | def shutdown(self, timeout: float | None = None): method force_flush (line 547) | def force_flush(self): method _run (line 553) | def _run(self): method _export_batches (line 570) | def _export_batches(self, force: bool = False): function default_exporter (line 602) | def default_exporter() -> BackendSpanExporter: function default_processor (line 619) | def default_processor() -> BatchTraceProcessor: FILE: src/agents/tracing/provider.py function _safe_debug (line 19) | def _safe_debug(message: str) -> None: class SynchronousMultiTracingProcessor (line 44) | class SynchronousMultiTracingProcessor(TracingProcessor): method __init__ (line 49) | def __init__(self): method add_tracing_processor (line 54) | def add_tracing_processor(self, tracing_processor: TracingProcessor): method set_processors (line 61) | def set_processors(self, processors: list[TracingProcessor]): method on_trace_start (line 68) | def on_trace_start(self, trace: Trace) -> None: method on_trace_end (line 78) | def on_trace_end(self, trace: Trace) -> None: method on_span_start (line 88) | def on_span_start(self, span: Span[Any]) -> None: method on_span_end (line 98) | def on_span_end(self, span: Span[Any]) -> None: method shutdown (line 108) | def shutdown(self) -> None: method force_flush (line 119) | def force_flush(self): class TraceProvider (line 130) | class TraceProvider(ABC): method register_processor (line 134) | def register_processor(self, processor: TracingProcessor) -> None: method set_processors (line 138) | def set_processors(self, processors: list[TracingProcessor]) -> None: method get_current_trace (line 142) | def get_current_trace(self) -> Trace | None: method get_current_span (line 146) | def get_current_span(self) -> Span[Any] | None: method set_disabled (line 150) | def set_disabled(self, disabled: bool) -> None: method time_iso (line 154) | def time_iso(self) -> str: method gen_trace_id (line 158) | def gen_trace_id(self) -> str: method gen_span_id (line 162) | def gen_span_id(self) -> str: method gen_group_id (line 166) | def gen_group_id(self) -> str: method create_trace (line 170) | def create_trace( method create_span (line 182) | def create_span( method shutdown (line 192) | def shutdown(self) -> None: class DefaultTraceProvider (line 196) | class DefaultTraceProvider(TraceProvider): method __init__ (line 197) | def __init__(self) -> None: method register_processor (line 204) | def register_processor(self, processor: TracingProcessor): method set_processors (line 210) | def set_processors(self, processors: list[TracingProcessor]): method get_current_trace (line 216) | def get_current_trace(self) -> Trace | None: method get_current_span (line 222) | def get_current_span(self) -> Span[Any] | None: method set_disabled (line 228) | def set_disabled(self, disabled: bool) -> None: method _refresh_disabled_flag (line 235) | def _refresh_disabled_flag(self) -> None: method time_iso (line 254) | def time_iso(self) -> str: method gen_trace_id (line 258) | def gen_trace_id(self) -> str: method gen_span_id (line 262) | def gen_span_id(self) -> str: method gen_group_id (line 266) | def gen_group_id(self) -> str: method create_trace (line 270) | def create_trace( method create_span (line 300) | def create_span( method shutdown (line 368) | def shutdown(self) -> None: FILE: src/agents/tracing/scope.py class Scope (line 20) | class Scope: method get_current_span (line 26) | def get_current_span(cls) -> "Span[Any] | None": method set_current_span (line 30) | def set_current_span(cls, span: "Span[Any] | None") -> "contextvars.To... method reset_current_span (line 34) | def reset_current_span(cls, token: "contextvars.Token[Span[Any] | None... method get_current_trace (line 38) | def get_current_trace(cls) -> "Trace | None": method set_current_trace (line 42) | def set_current_trace(cls, trace: "Trace | None") -> "contextvars.Toke... method reset_current_trace (line 47) | def reset_current_trace(cls, token: "contextvars.Token[Trace | None]")... FILE: src/agents/tracing/setup.py function _shutdown_global_trace_provider (line 15) | def _shutdown_global_trace_provider() -> None: function set_trace_provider (line 21) | def set_trace_provider(provider: TraceProvider) -> None: function get_trace_provider (line 33) | def get_trace_provider() -> TraceProvider: FILE: src/agents/tracing/span_data.py class SpanData (line 11) | class SpanData(abc.ABC): method export (line 17) | def export(self) -> dict[str, Any]: method type (line 23) | def type(self) -> str: class AgentSpanData (line 28) | class AgentSpanData(SpanData): method __init__ (line 36) | def __init__( method type (line 49) | def type(self) -> str: method export (line 52) | def export(self) -> dict[str, Any]: class FunctionSpanData (line 62) | class FunctionSpanData(SpanData): method __init__ (line 70) | def __init__( method type (line 83) | def type(self) -> str: method export (line 86) | def export(self) -> dict[str, Any]: class GenerationSpanData (line 96) | class GenerationSpanData(SpanData): method __init__ (line 110) | def __init__( method type (line 125) | def type(self) -> str: method export (line 128) | def export(self) -> dict[str, Any]: class ResponseSpanData (line 139) | class ResponseSpanData(SpanData): method __init__ (line 147) | def __init__( method type (line 158) | def type(self) -> str: method export (line 161) | def export(self) -> dict[str, Any]: class HandoffSpanData (line 168) | class HandoffSpanData(SpanData): method __init__ (line 176) | def __init__(self, from_agent: str | None, to_agent: str | None): method type (line 181) | def type(self) -> str: method export (line 184) | def export(self) -> dict[str, Any]: class CustomSpanData (line 192) | class CustomSpanData(SpanData): method __init__ (line 200) | def __init__(self, name: str, data: dict[str, Any]): method type (line 205) | def type(self) -> str: method export (line 208) | def export(self) -> dict[str, Any]: class GuardrailSpanData (line 216) | class GuardrailSpanData(SpanData): method __init__ (line 224) | def __init__(self, name: str, triggered: bool = False): method type (line 229) | def type(self) -> str: method export (line 232) | def export(self) -> dict[str, Any]: class TranscriptionSpanData (line 240) | class TranscriptionSpanData(SpanData): method __init__ (line 253) | def __init__( method type (line 268) | def type(self) -> str: method export (line 271) | def export(self) -> dict[str, Any]: class SpeechSpanData (line 284) | class SpeechSpanData(SpanData): method __init__ (line 292) | def __init__( method type (line 309) | def type(self) -> str: method export (line 312) | def export(self) -> dict[str, Any]: class SpeechGroupSpanData (line 326) | class SpeechGroupSpanData(SpanData): method __init__ (line 333) | def __init__( method type (line 340) | def type(self) -> str: method export (line 343) | def export(self) -> dict[str, Any]: class MCPListToolsSpanData (line 350) | class MCPListToolsSpanData(SpanData): method __init__ (line 361) | def __init__(self, server: str | None = None, result: list[str] | None... method type (line 366) | def type(self) -> str: method export (line 369) | def export(self) -> dict[str, Any]: FILE: src/agents/tracing/spans.py class SpanError (line 18) | class SpanError(TypedDict): class Span (line 30) | class Span(abc.ABC, Generic[TSpanData]): method trace_id (line 71) | def trace_id(self) -> str: method span_id (line 81) | def span_id(self) -> str: method span_data (line 91) | def span_data(self) -> TSpanData: method start (line 100) | def start(self, mark_as_current: bool = False): method finish (line 110) | def finish(self, reset_current: bool = False) -> None: method __enter__ (line 120) | def __enter__(self) -> Span[TSpanData]: method __exit__ (line 124) | def __exit__(self, exc_type, exc_val, exc_tb): method parent_id (line 129) | def parent_id(self) -> str | None: method set_error (line 138) | def set_error(self, error: SpanError) -> None: method error (line 143) | def error(self) -> SpanError | None: method export (line 152) | def export(self) -> dict[str, Any] | None: method started_at (line 157) | def started_at(self) -> str | None: method ended_at (line 167) | def ended_at(self) -> str | None: method tracing_api_key (line 177) | def tracing_api_key(self) -> str | None: method trace_metadata (line 182) | def trace_metadata(self) -> dict[str, Any] | None: class NoOpSpan (line 187) | class NoOpSpan(Span[TSpanData]): method __init__ (line 198) | def __init__(self, span_data: TSpanData): method trace_id (line 203) | def trace_id(self) -> str: method span_id (line 207) | def span_id(self) -> str: method span_data (line 211) | def span_data(self) -> TSpanData: method parent_id (line 215) | def parent_id(self) -> str | None: method start (line 218) | def start(self, mark_as_current: bool = False): method finish (line 222) | def finish(self, reset_current: bool = False) -> None: method __enter__ (line 227) | def __enter__(self) -> Span[TSpanData]: method __exit__ (line 231) | def __exit__(self, exc_type, exc_val, exc_tb): method set_error (line 239) | def set_error(self, error: SpanError) -> None: method error (line 243) | def error(self) -> SpanError | None: method export (line 246) | def export(self) -> dict[str, Any] | None: method started_at (line 250) | def started_at(self) -> str | None: method ended_at (line 254) | def ended_at(self) -> str | None: method tracing_api_key (line 258) | def tracing_api_key(self) -> str | None: class SpanImpl (line 262) | class SpanImpl(Span[TSpanData]): method __init__ (line 277) | def __init__( method trace_id (line 300) | def trace_id(self) -> str: method span_id (line 304) | def span_id(self) -> str: method span_data (line 308) | def span_data(self) -> TSpanData: method parent_id (line 312) | def parent_id(self) -> str | None: method start (line 315) | def start(self, mark_as_current: bool = False): method finish (line 325) | def finish(self, reset_current: bool = False) -> None: method __enter__ (line 336) | def __enter__(self) -> Span[TSpanData]: method __exit__ (line 340) | def __exit__(self, exc_type, exc_val, exc_tb): method set_error (line 348) | def set_error(self, error: SpanError) -> None: method error (line 352) | def error(self) -> SpanError | None: method started_at (line 356) | def started_at(self) -> str | None: method ended_at (line 360) | def ended_at(self) -> str | None: method tracing_api_key (line 364) | def tracing_api_key(self) -> str | None: method trace_metadata (line 368) | def trace_metadata(self) -> dict[str, Any] | None: method export (line 371) | def export(self) -> dict[str, Any] | None: FILE: src/agents/tracing/traces.py class Trace (line 18) | class Trace(abc.ABC): method __enter__ (line 51) | def __enter__(self) -> Trace: method __exit__ (line 55) | def __exit__(self, exc_type, exc_val, exc_tb): method start (line 59) | def start(self, mark_as_current: bool = False): method finish (line 74) | def finish(self, reset_current: bool = False): method trace_id (line 90) | def trace_id(self) -> str: method name (line 105) | def name(self) -> str: method export (line 119) | def export(self) -> dict[str, Any] | None: method tracing_api_key (line 134) | def tracing_api_key(self) -> str | None: method to_json (line 138) | def to_json(self, *, include_tracing_api_key: bool = False) -> dict[st... function _hash_tracing_api_key (line 154) | def _hash_tracing_api_key(tracing_api_key: str | None) -> str | None: class TraceState (line 163) | class TraceState: method from_trace (line 176) | def from_trace(cls, trace: Trace | None) -> TraceState | None: method from_json (line 183) | def from_json(cls, payload: Mapping[str, Any] | None) -> TraceState | ... method to_json (line 212) | def to_json(self, *, include_tracing_api_key: bool = False) -> dict[st... function _mark_trace_id_started (line 252) | def _mark_trace_id_started(trace_id: str | None) -> None: function _trace_id_was_started (line 265) | def _trace_id_was_started(trace_id: str | None) -> bool: class ReattachedTrace (line 272) | class ReattachedTrace(Trace): method __init__ (line 285) | def __init__( method trace_id (line 303) | def trace_id(self) -> str: method name (line 307) | def name(self) -> str: method tracing_api_key (line 311) | def tracing_api_key(self) -> str | None: method start (line 314) | def start(self, mark_as_current: bool = False): method finish (line 324) | def finish(self, reset_current: bool = False): method __enter__ (line 332) | def __enter__(self) -> Trace: method __exit__ (line 341) | def __exit__(self, exc_type, exc_val, exc_tb): method export (line 344) | def export(self) -> dict[str, Any] | None: function reattach_trace (line 354) | def reattach_trace(trace_state: TraceState, *, tracing_api_key: str | No... class NoOpTrace (line 371) | class NoOpTrace(Trace): method __init__ (line 386) | def __init__(self): method __enter__ (line 390) | def __enter__(self) -> Trace: method __exit__ (line 401) | def __exit__(self, exc_type, exc_val, exc_tb): method start (line 404) | def start(self, mark_as_current: bool = False): method finish (line 408) | def finish(self, reset_current: bool = False): method trace_id (line 414) | def trace_id(self) -> str: method name (line 423) | def name(self) -> str: method export (line 431) | def export(self) -> dict[str, Any] | None: method tracing_api_key (line 440) | def tracing_api_key(self) -> str | None: class TraceImpl (line 447) | class TraceImpl(Trace): method __init__ (line 463) | def __init__( method trace_id (line 482) | def trace_id(self) -> str: method name (line 486) | def name(self) -> str: method tracing_api_key (line 490) | def tracing_api_key(self) -> str | None: method start (line 493) | def start(self, mark_as_current: bool = False): method finish (line 504) | def finish(self, reset_current: bool = False): method __enter__ (line 514) | def __enter__(self) -> Trace: method __exit__ (line 523) | def __exit__(self, exc_type, exc_val, exc_tb): method export (line 526) | def export(self) -> dict[str, Any] | None: FILE: src/agents/tracing/util.py function time_iso (line 4) | def time_iso() -> str: function gen_trace_id (line 9) | def gen_trace_id() -> str: function gen_span_id (line 14) | def gen_span_id() -> str: function gen_group_id (line 19) | def gen_group_id() -> str: FILE: src/agents/usage.py function deserialize_usage (line 13) | def deserialize_usage(usage_data: Mapping[str, Any]) -> Usage: class RequestUsage (line 61) | class RequestUsage: function _normalize_input_tokens_details (line 80) | def _normalize_input_tokens_details( function _normalize_output_tokens_details (line 91) | def _normalize_output_tokens_details( class Usage (line 103) | class Usage: method __post_init__ (line 138) | def __post_init__(self) -> None: method add (line 157) | def add(self, other: Usage) -> None: function _serialize_usage_details (line 216) | def _serialize_usage_details(details: Any, default: dict[str, int]) -> d... function serialize_usage (line 225) | def serialize_usage(usage: Usage) -> dict[str, Any]: function _coerce_token_details (line 256) | def _coerce_token_details(adapter: TypeAdapter[Any], raw_value: Any, def... FILE: src/agents/util/_approvals.py function evaluate_needs_approval_setting (line 13) | async def evaluate_needs_approval_setting( FILE: src/agents/util/_coro.py function noop_coroutine (line 1) | async def noop_coroutine() -> None: FILE: src/agents/util/_error_tracing.py function attach_error_to_span (line 7) | def attach_error_to_span(span: Span[Any], error: SpanError) -> None: function attach_error_to_current_span (line 11) | def attach_error_to_current_span(error: SpanError) -> None: FILE: src/agents/util/_json.py function validate_json (line 16) | def validate_json(json_str: str, type_adapter: TypeAdapter[T], partial: ... function _to_dump_compatible (line 35) | def _to_dump_compatible(obj: Any) -> Any: function _to_dump_compatible_internal (line 39) | def _to_dump_compatible_internal(obj: Any) -> Any: FILE: src/agents/util/_pretty_print.py function _indent (line 10) | def _indent(text: str, indent_level: int) -> str: function _final_output_str (line 15) | def _final_output_str(result: "RunResultBase") -> str: function pretty_print_result (line 26) | def pretty_print_result(result: "RunResult") -> str: function pretty_print_run_error_details (line 42) | def pretty_print_run_error_details(result: "RunErrorDetails") -> str: function pretty_print_run_result_streaming (line 53) | def pretty_print_run_result_streaming(result: "RunResultStreaming") -> str: FILE: src/agents/util/_transforms.py function transform_string_function_style (line 6) | def transform_string_function_style(name: str) -> str: FILE: src/agents/voice/events.py class VoiceStreamEventAudio (line 12) | class VoiceStreamEventAudio: class VoiceStreamEventLifecycle (line 23) | class VoiceStreamEventLifecycle: class VoiceStreamEventError (line 34) | class VoiceStreamEventError: FILE: src/agents/voice/exceptions.py class STTWebsocketConnectionError (line 4) | class STTWebsocketConnectionError(AgentsException): method __init__ (line 7) | def __init__(self, message: str): FILE: src/agents/voice/input.py function _buffer_to_audio_file (line 15) | def _buffer_to_audio_file( class AudioInput (line 41) | class AudioInput: method to_audio_file (line 58) | def to_audio_file(self) -> tuple[str, io.BytesIO, str]: method to_base64 (line 62) | def to_base64(self) -> str: class StreamedAudioInput (line 74) | class StreamedAudioInput: method __init__ (line 79) | def __init__(self): method add_audio (line 82) | async def add_audio(self, audio: npt.NDArray[np.int16 | np.float32] | ... FILE: src/agents/voice/model.py class TTSModelSettings (line 22) | class TTSModelSettings: class TTSModel (line 64) | class TTSModel(abc.ABC): method model_name (line 69) | def model_name(self) -> str: method run (line 74) | def run(self, text: str, settings: TTSModelSettings) -> AsyncIterator[... class StreamedTranscriptionSession (line 86) | class StreamedTranscriptionSession(abc.ABC): method transcribe_turns (line 90) | def transcribe_turns(self) -> AsyncIterator[str]: method close (line 98) | async def close(self) -> None: class STTModelSettings (line 104) | class STTModelSettings: class STTModel (line 120) | class STTModel(abc.ABC): method model_name (line 125) | def model_name(self) -> str: method transcribe (line 130) | async def transcribe( method create_session (line 151) | async def create_session( class VoiceModelProvider (line 173) | class VoiceModelProvider(abc.ABC): method get_stt_model (line 181) | def get_stt_model(self, model_name: str | None) -> STTModel: method get_tts_model (line 193) | def get_tts_model(self, model_name: str | None) -> TTSModel: FILE: src/agents/voice/models/openai_model_provider.py function shared_http_client (line 16) | def shared_http_client() -> httpx.AsyncClient: class OpenAIVoiceModelProvider (line 27) | class OpenAIVoiceModelProvider(VoiceModelProvider): method __init__ (line 30) | def __init__( method _get_client (line 65) | def _get_client(self) -> AsyncOpenAI: method get_stt_model (line 77) | def get_stt_model(self, model_name: str | None) -> STTModel: method get_tts_model (line 88) | def get_tts_model(self, model_name: str | None) -> TTSModel: FILE: src/agents/voice/models/openai_stt.py class ErrorSentinel (line 30) | class ErrorSentinel: class SessionCompleteSentinel (line 34) | class SessionCompleteSentinel: class WebsocketDoneSentinel (line 38) | class WebsocketDoneSentinel: function _audio_to_base64 (line 42) | def _audio_to_base64(audio_data: list[npt.NDArray[np.int16 | np.float32]... function _wait_for_event (line 52) | async def _wait_for_event( class OpenAISTTTranscriptionSession (line 71) | class OpenAISTTTranscriptionSession(StreamedTranscriptionSession): method __init__ (line 74) | def __init__( method _start_turn (line 108) | def _start_turn(self) -> None: method _end_turn (line 120) | def _end_turn(self, _transcript: str) -> None: method _event_listener (line 138) | async def _event_listener(self) -> None: method _configure_session (line 162) | async def _configure_session(self) -> None: method _setup_connection (line 182) | async def _setup_connection(self, ws: websockets.ClientConnection) -> ... method _handle_events (line 224) | async def _handle_events(self) -> None: method _stream_audio (line 253) | async def _stream_audio( method _process_websocket_connection (line 281) | async def _process_websocket_connection(self) -> None: method _check_errors (line 303) | def _check_errors(self) -> None: method _cleanup_tasks (line 324) | def _cleanup_tasks(self) -> None: method transcribe_turns (line 337) | async def transcribe_turns(self) -> AsyncIterator[str]: method close (line 366) | async def close(self) -> None: class OpenAISTTModel (line 373) | class OpenAISTTModel(STTModel): method __init__ (line 376) | def __init__( method model_name (line 391) | def model_name(self) -> str: method _non_null_or_not_given (line 394) | def _non_null_or_not_given(self, value: Any) -> Any: method transcribe (line 397) | async def transcribe( method create_session (line 439) | async def create_session( FILE: src/agents/voice/models/openai_tts.py class OpenAITTSModel (line 11) | class OpenAITTSModel(TTSModel): method __init__ (line 14) | def __init__( method model_name (line 29) | def model_name(self) -> str: method run (line 32) | async def run(self, text: str, settings: TTSModelSettings) -> AsyncIte... FILE: src/agents/voice/pipeline.py class VoicePipeline (line 15) | class VoicePipeline: method __init__ (line 22) | def __init__( method run (line 48) | async def run(self, audio_input: AudioInput | StreamedAudioInput) -> S... method _get_tts_model (line 67) | def _get_tts_model(self) -> TTSModel: method _get_stt_model (line 72) | def _get_stt_model(self) -> STTModel: method _process_audio_input (line 77) | async def _process_audio_input(self, audio_input: AudioInput) -> str: method _run_single_turn (line 86) | async def _run_single_turn(self, audio_input: AudioInput) -> StreamedA... method _run_multi_turn (line 113) | async def _run_multi_turn(self, audio_input: StreamedAudioInput) -> St... FILE: src/agents/voice/pipeline_config.py class VoicePipelineConfig (line 13) | class VoicePipelineConfig: FILE: src/agents/voice/result.py function _audio_to_base64 (line 24) | def _audio_to_base64(audio_data: list[bytes]) -> str: class StreamedAudioResult (line 29) | class StreamedAudioResult: method __init__ (line 32) | def __init__( method _start_turn (line 72) | async def _start_turn(self): method _set_task (line 83) | def _set_task(self, task: asyncio.Task[Any]): method _add_error (line 86) | async def _add_error(self, error: Exception): method _transform_audio_buffer (line 89) | def _transform_audio_buffer( method _stream_audio (line 106) | async def _stream_audio( method _add_text (line 195) | async def _add_text(self, text: str): method _turn_done (line 213) | async def _turn_done(self): method _finish_turn (line 228) | def _finish_turn(self): method _done (line 240) | async def _done(self): method _dispatch_audio (line 244) | async def _dispatch_audio(self): method _wait_for_completion (line 265) | async def _wait_for_completion(self): method _cleanup_tasks (line 271) | def _cleanup_tasks(self): method _check_errors (line 284) | def _check_errors(self): method stream (line 291) | async def stream(self) -> AsyncIterator[VoiceStreamEvent]: FILE: src/agents/voice/utils.py function get_sentence_based_splitter (line 5) | def get_sentence_based_splitter( FILE: src/agents/voice/workflow.py class VoiceWorkflowBase (line 13) | class VoiceWorkflowBase(abc.ABC): method run (line 26) | def run(self, transcription: str) -> AsyncIterator[str]: method on_start (line 35) | async def on_start(self) -> AsyncIterator[str]: class VoiceWorkflowHelper (line 44) | class VoiceWorkflowHelper: method stream_text_from (line 46) | async def stream_text_from(cls, result: RunResultStreaming) -> AsyncIt... class SingleAgentWorkflowCallbacks (line 56) | class SingleAgentWorkflowCallbacks: method on_run (line 57) | def on_run(self, workflow: SingleAgentVoiceWorkflow, transcription: st... class SingleAgentVoiceWorkflow (line 62) | class SingleAgentVoiceWorkflow(VoiceWorkflowBase): method __init__ (line 69) | def __init__(self, agent: Agent[Any], callbacks: SingleAgentWorkflowCa... method run (line 80) | async def run(self, transcription: str) -> AsyncIterator[str]: FILE: tests/conftest.py function setup_span_processor (line 17) | def setup_span_processor(): function ensure_openai_api_key (line 29) | def ensure_openai_api_key(): function clear_span_processor (line 38) | def clear_span_processor(): function clear_openai_settings (line 46) | def clear_openai_settings(): function clear_default_runner (line 54) | def clear_default_runner(): function disable_real_model_clients (line 59) | def disable_real_model_clients(monkeypatch, request): FILE: tests/extensions/experiemental/codex/test_codex_exec_thread.py class FakeStdin (line 34) | class FakeStdin: method __init__ (line 35) | def __init__(self) -> None: method write (line 39) | def write(self, data: bytes) -> None: method drain (line 42) | async def drain(self) -> None: method close (line 45) | def close(self) -> None: class FakeStdout (line 49) | class FakeStdout: method __init__ (line 50) | def __init__(self, lines: list[str]) -> None: method readline (line 53) | async def readline(self) -> bytes: class FakeStderr (line 59) | class FakeStderr: method __init__ (line 60) | def __init__(self, chunks: list[bytes]) -> None: method read (line 63) | async def read(self, _size: int) -> bytes: class FakeProcess (line 69) | class FakeProcess: method __init__ (line 70) | def __init__( method wait (line 87) | async def wait(self) -> None: method kill (line 91) | def kill(self) -> None: method terminate (line 94) | def terminate(self) -> None: class FakeExec (line 98) | class FakeExec: method __init__ (line 99) | def __init__(self, events: list[Any], delay: float = 0.0) -> None: method run (line 104) | async def run(self, args: Any): function test_output_schema_file_none_schema (line 113) | def test_output_schema_file_none_schema() -> None: function test_output_schema_file_rejects_non_object (line 119) | def test_output_schema_file_rejects_non_object() -> None: function test_output_schema_file_creates_and_cleans (line 124) | def test_output_schema_file_creates_and_cleans() -> None: function test_output_schema_file_cleanup_swallows_rmtree_errors (line 134) | def test_output_schema_file_cleanup_swallows_rmtree_errors( function test_output_schema_file_cleanup_on_write_error (line 153) | def test_output_schema_file_cleanup_on_write_error( function test_normalize_input_merges_text_and_images (line 175) | def test_normalize_input_merges_text_and_images() -> None: function test_normalize_env_stringifies_values (line 188) | def test_normalize_env_stringifies_values() -> None: function test_coerce_codex_options_rejects_unknown_fields (line 193) | def test_coerce_codex_options_rejects_unknown_fields() -> None: function test_coerce_thread_options_rejects_unknown_fields (line 198) | def test_coerce_thread_options_rejects_unknown_fields() -> None: function test_codex_start_and_resume_thread (line 203) | def test_codex_start_and_resume_thread() -> None: function test_codex_init_accepts_mapping_options (line 211) | def test_codex_init_accepts_mapping_options() -> None: function test_codex_init_accepts_kwargs (line 216) | def test_codex_init_accepts_kwargs() -> None: function test_codex_init_accepts_stream_limit_kwarg (line 222) | def test_codex_init_accepts_stream_limit_kwarg() -> None: function test_codex_init_rejects_options_and_kwargs (line 227) | def test_codex_init_rejects_options_and_kwargs() -> None: function test_codex_init_kw_matches_codex_options (line 234) | def test_codex_init_kw_matches_codex_options() -> None: function test_codex_exec_stream_limit_uses_env (line 245) | def test_codex_exec_stream_limit_uses_env(monkeypatch: pytest.MonkeyPatc... function test_codex_exec_stream_limit_explicit_overrides_env (line 251) | def test_codex_exec_stream_limit_explicit_overrides_env(monkeypatch: pyt... function test_codex_exec_stream_limit_rejects_invalid_env (line 260) | def test_codex_exec_stream_limit_rejects_invalid_env(monkeypatch: pytest... function test_codex_exec_stream_limit_rejects_out_of_range_value (line 266) | def test_codex_exec_stream_limit_rejects_out_of_range_value() -> None: function test_codex_exec_run_builds_command_args_and_env (line 275) | async def test_codex_exec_run_builds_command_args_and_env(monkeypatch: p... function test_codex_exec_run_handles_large_single_line_events (line 352) | async def test_codex_exec_run_handles_large_single_line_events( function test_codex_exec_run_web_search_enabled_flags (line 400) | async def test_codex_exec_run_web_search_enabled_flags( function test_codex_exec_run_raises_on_non_zero_exit (line 422) | async def test_codex_exec_run_raises_on_non_zero_exit( function test_codex_exec_run_raises_without_stdin (line 441) | async def test_codex_exec_run_raises_without_stdin(monkeypatch: pytest.M... function test_codex_exec_run_raises_without_stdout (line 459) | async def test_codex_exec_run_raises_without_stdout(monkeypatch: pytest.... function test_watch_signal_terminates_process (line 477) | async def test_watch_signal_terminates_process() -> None: function test_platform_target_triple_mapping (line 499) | def test_platform_target_triple_mapping( function test_platform_target_triple_unsupported (line 507) | def test_platform_target_triple_unsupported(monkeypatch: pytest.MonkeyPa... function test_find_codex_path_env_override (line 514) | def test_find_codex_path_env_override(monkeypatch: pytest.MonkeyPatch) -... function test_find_codex_path_uses_shutil_which (line 519) | def test_find_codex_path_uses_shutil_which(monkeypatch: pytest.MonkeyPat... function test_find_codex_path_fallback (line 525) | def test_find_codex_path_fallback(monkeypatch: pytest.MonkeyPatch) -> None: function test_thread_run_streamed_passes_options_and_updates_id (line 542) | async def test_thread_run_streamed_passes_options_and_updates_id( function test_thread_run_aggregates_items_and_usage (line 611) | async def test_thread_run_aggregates_items_and_usage() -> None: function test_thread_run_raises_on_failure (line 640) | async def test_thread_run_raises_on_failure() -> None: function test_thread_run_raises_on_stream_error (line 654) | async def test_thread_run_raises_on_stream_error() -> None: function test_thread_run_streamed_raises_on_parse_error (line 668) | async def test_thread_run_streamed_raises_on_parse_error( function test_thread_run_streamed_idle_timeout_sets_signal (line 691) | async def test_thread_run_streamed_idle_timeout_sets_signal( FILE: tests/extensions/experiemental/codex/test_codex_tool.py class CodexMockState (line 40) | class CodexMockState: method __init__ (line 41) | def __init__(self) -> None: class FakeThread (line 51) | class FakeThread: method __init__ (line 52) | def __init__(self, state: CodexMockState) -> None: method run_streamed (line 56) | async def run_streamed(self, _input: Any, turn_options: Any = None) ->... class FakeCodex (line 74) | class FakeCodex: method __init__ (line 75) | def __init__(self, state: CodexMockState, options: Any = None) -> None: method start_thread (line 79) | def start_thread(self, _options: Any = None) -> FakeThread: method resume_thread (line 83) | def resume_thread(self, _thread_id: str, _options: Any = None) -> Fake... function test_codex_tool_kw_matches_codex_tool_options (line 89) | def test_codex_tool_kw_matches_codex_tool_options() -> None: function test_codex_tool_streams_events_and_updates_usage (line 101) | async def test_codex_tool_streams_events_and_updates_usage() -> None: function test_codex_tool_keeps_command_output_when_completed_missing_output (line 249) | async def test_codex_tool_keeps_command_output_when_completed_missing_ou... function test_codex_tool_defaults_to_openai_api_key (line 313) | async def test_codex_tool_defaults_to_openai_api_key(monkeypatch: pytest... function test_codex_tool_accepts_codex_options_dict (line 352) | async def test_codex_tool_accepts_codex_options_dict(monkeypatch: pytest... function test_codex_tool_accepts_output_schema_descriptor (line 388) | async def test_codex_tool_accepts_output_schema_descriptor() -> None: function test_codex_tool_accepts_dict_options (line 435) | async def test_codex_tool_accepts_dict_options() -> None: function test_codex_tool_accepts_keyword_options (line 470) | async def test_codex_tool_accepts_keyword_options(monkeypatch: pytest.Mo... function test_codex_tool_truncates_span_values (line 506) | def test_codex_tool_truncates_span_values() -> None: function test_codex_tool_enforces_span_data_budget (line 518) | def test_codex_tool_enforces_span_data_budget() -> None: function test_codex_tool_keeps_output_preview_with_budget (line 533) | def test_codex_tool_keeps_output_preview_with_budget() -> None: function test_codex_tool_prioritizes_arguments_over_large_results (line 543) | def test_codex_tool_prioritizes_arguments_over_large_results() -> None: function test_codex_tool_passes_idle_timeout_seconds (line 553) | async def test_codex_tool_passes_idle_timeout_seconds() -> None: function test_codex_tool_persists_session (line 588) | async def test_codex_tool_persists_session() -> None: function test_codex_tool_accepts_thread_id_from_tool_input (line 624) | async def test_codex_tool_accepts_thread_id_from_tool_input() -> None: function test_codex_tool_uses_run_context_thread_id_and_persists_latest (line 660) | async def test_codex_tool_uses_run_context_thread_id_and_persists_latest... function test_codex_tool_persists_thread_started_id_when_thread_object_id_is_none (line 701) | async def test_codex_tool_persists_thread_started_id_when_thread_object_... function test_codex_tool_persists_thread_id_for_recoverable_turn_failure (line 746) | async def test_codex_tool_persists_thread_id_for_recoverable_turn_failur... function test_codex_tool_persists_thread_id_for_raised_turn_failure (line 783) | async def test_codex_tool_persists_thread_id_for_raised_turn_failure() -... function test_codex_tool_persists_thread_id_for_cancelled_turn (line 823) | async def test_codex_tool_persists_thread_id_for_cancelled_turn() -> None: function test_codex_tool_persists_thread_id_for_handled_parallel_cancellation (line 874) | async def test_codex_tool_persists_thread_id_for_handled_parallel_cancel... function test_codex_tool_falls_back_to_call_thread_id_when_thread_object_id_is_none (line 965) | async def test_codex_tool_falls_back_to_call_thread_id_when_thread_objec... function test_codex_tool_uses_run_context_thread_id_with_pydantic_context (line 1013) | async def test_codex_tool_uses_run_context_thread_id_with_pydantic_conte... function test_codex_tool_uses_pydantic_context_field_matching_thread_id_key (line 1057) | async def test_codex_tool_uses_pydantic_context_field_matching_thread_id... function test_codex_tool_default_run_context_key_follows_tool_name (line 1101) | async def test_codex_tool_default_run_context_key_follows_tool_name() ->... function test_codex_tool_rejects_custom_name_without_codex_prefix (line 1138) | def test_codex_tool_rejects_custom_name_without_codex_prefix() -> None: function test_codex_tool_allows_non_alnum_suffix_when_run_context_thread_id_disabled (line 1143) | def test_codex_tool_allows_non_alnum_suffix_when_run_context_thread_id_d... function test_codex_tool_rejects_lossy_default_run_context_thread_id_key_suffix (line 1148) | def test_codex_tool_rejects_lossy_default_run_context_thread_id_key_suff... function test_codex_tool_tool_input_thread_id_overrides_run_context_thread_id (line 1154) | async def test_codex_tool_tool_input_thread_id_overrides_run_context_thr... function test_codex_tool_run_context_mode_hides_thread_id_in_default_parameters (line 1193) | def test_codex_tool_run_context_mode_hides_thread_id_in_default_paramete... function test_codex_tool_duplicate_names_fail_fast (line 1199) | async def test_codex_tool_duplicate_names_fail_fast() -> None: function test_codex_tool_name_collision_with_other_tool_fails_fast (line 1213) | async def test_codex_tool_name_collision_with_other_tool_fails_fast() ->... function test_codex_tool_run_context_thread_id_requires_mutable_context (line 1231) | async def test_codex_tool_run_context_thread_id_requires_mutable_context... function test_codex_tool_run_context_thread_id_rejects_immutable_mapping_context (line 1268) | async def test_codex_tool_run_context_thread_id_rejects_immutable_mappin... function test_codex_tool_run_context_thread_id_rejects_frozen_pydantic_context (line 1305) | async def test_codex_tool_run_context_thread_id_rejects_frozen_pydantic_... function test_codex_tool_run_context_thread_id_rejects_frozen_dataclass_context (line 1346) | async def test_codex_tool_run_context_thread_id_rejects_frozen_dataclass... function test_codex_tool_run_context_thread_id_rejects_slots_object_without_thread_field (line 1387) | async def test_codex_tool_run_context_thread_id_rejects_slots_object_wit... function test_codex_tool_run_context_thread_id_rejects_non_writable_object_context (line 1430) | async def test_codex_tool_run_context_thread_id_rejects_non_writable_obj... function test_codex_tool_input_item_validation_errors (line 1475) | def test_codex_tool_input_item_validation_errors(payload: dict[str, Any]... function test_codex_tool_result_stringifies (line 1480) | def test_codex_tool_result_stringifies() -> None: function test_codex_tool_parse_input_rejects_invalid_json (line 1485) | def test_codex_tool_parse_input_rejects_invalid_json() -> None: function test_codex_tool_normalize_parameters_requires_inputs (line 1490) | def test_codex_tool_normalize_parameters_requires_inputs() -> None: function test_codex_tool_coerce_options_rejects_unknown_fields (line 1498) | def test_codex_tool_coerce_options_rejects_unknown_fields() -> None: function test_codex_tool_keyword_rejects_empty_run_context_key (line 1503) | def test_codex_tool_keyword_rejects_empty_run_context_key() -> None: function test_codex_tool_resolve_output_schema_validation_errors (line 1508) | def test_codex_tool_resolve_output_schema_validation_errors() -> None: function test_codex_tool_resolve_output_schema_descriptor (line 1526) | def test_codex_tool_resolve_output_schema_descriptor() -> None: function test_codex_tool_resolve_codex_options_reads_env_override (line 1558) | def test_codex_tool_resolve_codex_options_reads_env_override() -> None: function test_codex_tool_create_codex_resolver_caches_instance (line 1570) | async def test_codex_tool_create_codex_resolver_caches_instance() -> None: function test_codex_tool_resolve_thread_options_merges_values (line 1578) | def test_codex_tool_resolve_thread_options_merges_values() -> None: function test_codex_tool_resolve_thread_options_empty_is_none (line 1592) | def test_codex_tool_resolve_thread_options_empty_is_none() -> None: function test_codex_tool_build_turn_options_merges_output_schema (line 1596) | def test_codex_tool_build_turn_options_merges_output_schema() -> None: function test_codex_tool_persisted_thread_mismatch_raises (line 1610) | def test_codex_tool_persisted_thread_mismatch_raises() -> None: function test_codex_tool_default_response_text (line 1624) | def test_codex_tool_default_response_text() -> None: function test_codex_tool_input_item_accepts_local_image (line 1631) | def test_codex_tool_input_item_accepts_local_image() -> None: function test_codex_tool_normalize_parameters_handles_local_image (line 1637) | def test_codex_tool_normalize_parameters_handles_local_image() -> None: function test_codex_tool_input_thread_id_validation_errors (line 1652) | def test_codex_tool_input_thread_id_validation_errors() -> None: function test_codex_tool_build_codex_input_empty (line 1660) | def test_codex_tool_build_codex_input_empty() -> None: function test_codex_tool_truncate_span_string_limits (line 1664) | def test_codex_tool_truncate_span_string_limits() -> None: function test_codex_tool_truncate_span_value_handles_circular_reference (line 1670) | def test_codex_tool_truncate_span_value_handles_circular_reference() -> ... function test_codex_tool_enforce_span_data_budget_zero_max (line 1678) | def test_codex_tool_enforce_span_data_budget_zero_max() -> None: function test_codex_tool_enforce_span_data_budget_trims_values_when_budget_tight (line 1682) | def test_codex_tool_enforce_span_data_budget_trims_values_when_budget_ti... function test_codex_tool_enforce_span_data_budget_drops_until_base_fits (line 1693) | def test_codex_tool_enforce_span_data_budget_drops_until_base_fits() -> ... function test_codex_tool_handle_item_started_ignores_missing_id (line 1701) | def test_codex_tool_handle_item_started_ignores_missing_id() -> None: function test_codex_tool_handle_item_updated_ignores_missing_span (line 1707) | def test_codex_tool_handle_item_updated_ignores_missing_span() -> None: function test_codex_tool_on_invoke_tool_handles_failure_error_function_sync (line 1714) | async def test_codex_tool_on_invoke_tool_handles_failure_error_function_... function test_codex_tool_on_invoke_tool_handles_failure_error_function_async (line 1732) | async def test_codex_tool_on_invoke_tool_handles_failure_error_function_... function test_codex_tool_on_invoke_tool_raises_without_failure_handler (line 1750) | async def test_codex_tool_on_invoke_tool_raises_without_failure_handler(... function test_replaced_codex_tool_normal_failure_uses_replaced_policy (line 1765) | async def test_replaced_codex_tool_normal_failure_uses_replaced_policy()... function test_replaced_codex_tool_preserves_codex_collision_markers (line 1784) | async def test_replaced_codex_tool_preserves_codex_collision_markers() -... function test_codex_tool_consume_events_with_on_stream_error (line 1798) | async def test_codex_tool_consume_events_with_on_stream_error() -> None: function test_codex_tool_consume_events_default_response (line 1887) | async def test_codex_tool_consume_events_default_response() -> None: function test_codex_tool_consume_events_turn_failed (line 1921) | async def test_codex_tool_consume_events_turn_failed() -> None: function test_codex_tool_consume_events_error_event (line 1947) | async def test_codex_tool_consume_events_error_event() -> None: function test_codex_tool_create_codex_resolver_with_provided (line 1973) | async def test_codex_tool_create_codex_resolver_with_provided() -> None: function test_codex_tool_build_turn_options_overrides_schema (line 1981) | def test_codex_tool_build_turn_options_overrides_schema() -> None: function test_codex_tool_resolve_codex_options_reads_env (line 1991) | def test_codex_tool_resolve_codex_options_reads_env(monkeypatch: pytest.... function test_codex_tool_accepts_all_keyword_overrides (line 2000) | def test_codex_tool_accepts_all_keyword_overrides() -> None: function test_codex_tool_coerce_options_rejects_empty_run_context_key (line 2034) | def test_codex_tool_coerce_options_rejects_empty_run_context_key() -> None: FILE: tests/extensions/memory/test_advanced_sqlite_session.py function test_tool (line 23) | async def test_tool(query: str) -> str: function agent (line 29) | def agent() -> Agent: function usage_data (line 35) | def usage_data() -> Usage: function create_mock_run_result (line 47) | def create_mock_run_result( function test_advanced_session_basic_functionality (line 81) | async def test_advanced_session_basic_functionality(agent: Agent): function test_advanced_session_respects_custom_table_names (line 102) | async def test_advanced_session_respects_custom_table_names(): function test_message_structure_tracking (line 148) | async def test_message_structure_tracking(agent: Agent): function test_tool_usage_tracking (line 181) | async def test_tool_usage_tracking(agent: Agent): function test_tool_usage_tracking_preserves_namespaces_and_tool_search (line 208) | async def test_tool_usage_tracking_preserves_namespaces_and_tool_search(... function test_tool_usage_tracking_counts_tool_search_output_without_matching_call (line 274) | async def test_tool_usage_tracking_counts_tool_search_output_without_mat... function test_tool_usage_tracking_uses_bare_name_for_deferred_top_level_calls (line 318) | async def test_tool_usage_tracking_uses_bare_name_for_deferred_top_level... function test_tool_usage_tracking_collapses_reserved_same_name_namespace_shape (line 349) | async def test_tool_usage_tracking_collapses_reserved_same_name_namespac... function test_branching_functionality (line 376) | async def test_branching_functionality(agent: Agent): function test_get_conversation_turns (line 443) | async def test_get_conversation_turns(): function test_find_turns_by_content (line 480) | async def test_find_turns_by_content(): function test_create_branch_from_content (line 522) | async def test_create_branch_from_content(): function test_branch_specific_operations (line 564) | async def test_branch_specific_operations(): function test_branch_error_handling (line 624) | async def test_branch_error_handling(): function test_branch_deletion_with_force (line 656) | async def test_branch_deletion_with_force(): function test_get_items_with_parameters (line 695) | async def test_get_items_with_parameters(): function test_usage_tracking_storage (line 744) | async def test_usage_tracking_storage(agent: Agent, usage_data: Usage): function test_runner_integration_with_usage_tracking (line 803) | async def test_runner_integration_with_usage_tracking(agent: Agent): function test_sequence_ordering (line 851) | async def test_sequence_ordering(): function test_conversation_structure_with_multiple_turns (line 876) | async def test_conversation_structure_with_multiple_turns(): function test_empty_session_operations (line 927) | async def test_empty_session_operations(): function test_json_serialization_edge_cases (line 955) | async def test_json_serialization_edge_cases(usage_data: Usage): function test_session_isolation (line 996) | async def test_session_isolation(): function test_error_handling_in_usage_tracking (line 1027) | async def test_error_handling_in_usage_tracking(usage_data: Usage): function test_advanced_tool_name_extraction (line 1043) | async def test_advanced_tool_name_extraction(): function test_branch_usage_tracking (line 1094) | async def test_branch_usage_tracking(): function test_tool_name_extraction (line 1141) | async def test_tool_name_extraction(): function test_tool_execution_integration (line 1168) | async def test_tool_execution_integration(agent: Agent): function test_session_settings_default (line 1211) | async def test_session_settings_default(): function test_session_settings_constructor (line 1224) | async def test_session_settings_constructor(): function test_get_items_uses_session_settings_limit (line 1240) | async def test_get_items_uses_session_settings_limit(): function test_get_items_explicit_limit_overrides_session_settings (line 1267) | async def test_get_items_explicit_limit_overrides_session_settings(): function test_session_settings_resolve (line 1292) | async def test_session_settings_resolve(): function test_runner_with_session_settings_override (line 1309) | async def test_runner_with_session_settings_override(agent: Agent): FILE: tests/extensions/memory/test_async_sqlite_session.py function agent (line 25) | def agent() -> Agent: function _item_ids (line 30) | def _item_ids(items: Sequence[TResponseInputItem]) -> list[str]: function test_async_sqlite_session_basic_flow (line 38) | async def test_async_sqlite_session_basic_flow(): function test_async_sqlite_session_pop_item (line 59) | async def test_async_sqlite_session_pop_item(): function test_async_sqlite_session_get_items_limit (line 80) | async def test_async_sqlite_session_get_items_limit(): function test_async_sqlite_session_unicode_content (line 102) | async def test_async_sqlite_session_unicode_content(): function test_async_sqlite_session_runner_integration (line 117) | async def test_async_sqlite_session_runner_integration(agent: Agent): function test_async_sqlite_session_session_isolation (line 145) | async def test_async_sqlite_session_session_isolation(agent: Agent): function test_async_sqlite_session_add_empty_items_list (line 168) | async def test_async_sqlite_session_add_empty_items_list(): function test_async_sqlite_session_pop_from_empty_session (line 181) | async def test_async_sqlite_session_pop_from_empty_session(): function test_async_sqlite_session_get_items_with_limit_more_than_available (line 193) | async def test_async_sqlite_session_get_items_with_limit_more_than_avail... function test_async_sqlite_session_get_items_same_timestamp_consistent_order (line 213) | async def test_async_sqlite_session_get_items_same_timestamp_consistent_... function test_async_sqlite_session_pop_item_same_timestamp_returns_latest (line 270) | async def test_async_sqlite_session_pop_item_same_timestamp_returns_late... FILE: tests/extensions/memory/test_dapr_redis_integration.py function wait_for_dapr_health (line 58) | def wait_for_dapr_health(host: str, port: int, timeout: int = 60) -> bool: function docker_network (line 89) | def docker_network(): function redis_container (line 96) | def redis_container(docker_network): function dapr_container (line 113) | def dapr_container(redis_container, docker_network): function agent (line 193) | def agent() -> Agent: function test_dapr_redis_integration (line 198) | async def test_dapr_redis_integration(dapr_container, monkeypatch): function test_dapr_runner_integration (line 261) | async def test_dapr_runner_integration(agent: Agent, dapr_container, mon... function test_dapr_session_isolation (line 304) | async def test_dapr_session_isolation(dapr_container, monkeypatch): function test_dapr_ttl_functionality (line 350) | async def test_dapr_ttl_functionality(dapr_container, monkeypatch): function test_dapr_consistency_levels (line 389) | async def test_dapr_consistency_levels(dapr_container, monkeypatch): function test_dapr_unicode_and_special_chars (line 437) | async def test_dapr_unicode_and_special_chars(dapr_container, monkeypatch): function test_dapr_concurrent_writes_resolution (line 480) | async def test_dapr_concurrent_writes_resolution(dapr_container, monkeyp... FILE: tests/extensions/memory/test_dapr_session.py class FakeDaprClient (line 24) | class FakeDaprClient: method __init__ (line 27) | def __init__(self): method get_state (line 33) | async def get_state( method save_state (line 46) | async def save_state( method delete_state (line 79) | async def delete_state( method close (line 91) | async def close(self) -> None: function fake_dapr_client (line 97) | def fake_dapr_client() -> FakeDaprClient: class ConflictFakeDaprClient (line 102) | class ConflictFakeDaprClient(FakeDaprClient): method __init__ (line 105) | def __init__(self): method _simulate_concurrent_update (line 109) | def _simulate_concurrent_update(self, key: str) -> None: method save_state (line 127) | async def save_state( function conflict_dapr_client (line 161) | def conflict_dapr_client() -> ConflictFakeDaprClient: function agent (line 167) | def agent() -> Agent: function _create_test_session (line 172) | async def _create_test_session( function test_dapr_session_direct_ops (line 194) | async def test_dapr_session_direct_ops(fake_dapr_client: FakeDaprClient): function test_runner_integration (line 229) | async def test_runner_integration(agent: Agent, fake_dapr_client: FakeDa... function test_session_isolation (line 258) | async def test_session_isolation(fake_dapr_client: FakeDaprClient): function test_add_items_retries_on_concurrency (line 302) | async def test_add_items_retries_on_concurrency(conflict_dapr_client: Co... function test_pop_item_retries_on_concurrency (line 326) | async def test_pop_item_retries_on_concurrency(conflict_dapr_client: Con... function test_get_items_with_limit (line 349) | async def test_get_items_with_limit(fake_dapr_client: FakeDaprClient): function test_pop_from_empty_session (line 384) | async def test_pop_from_empty_session(fake_dapr_client: FakeDaprClient): function test_add_empty_items_list (line 399) | async def test_add_empty_items_list(fake_dapr_client: FakeDaprClient): function test_unicode_content (line 416) | async def test_unicode_content(fake_dapr_client: FakeDaprClient): function test_special_characters_and_json_safety (line 439) | async def test_special_characters_and_json_safety(fake_dapr_client: Fake... function test_data_integrity_with_problematic_strings (line 467) | async def test_data_integrity_with_problematic_strings(fake_dapr_client:... function test_concurrent_access (line 499) | async def test_concurrent_access(fake_dapr_client: FakeDaprClient): function test_dapr_connectivity (line 538) | async def test_dapr_connectivity(fake_dapr_client: FakeDaprClient): function test_ttl_functionality (line 553) | async def test_ttl_functionality(fake_dapr_client: FakeDaprClient): function test_consistency_levels (line 583) | async def test_consistency_levels(fake_dapr_client: FakeDaprClient): function test_external_client_not_closed (line 618) | async def test_external_client_not_closed(fake_dapr_client: FakeDaprClie... function test_internal_client_ownership (line 647) | async def test_internal_client_ownership(fake_dapr_client: FakeDaprClient): function test_corrupted_data_handling (line 672) | async def test_corrupted_data_handling(fake_dapr_client: FakeDaprClient): function test_ping_connection_failure (line 703) | async def test_ping_connection_failure(fake_dapr_client: FakeDaprClient): function test_close_method_coverage (line 729) | async def test_close_method_coverage(fake_dapr_client: FakeDaprClient): function test_messages_not_list_handling (line 761) | async def test_messages_not_list_handling(fake_dapr_client: FakeDaprClie... function test_already_deserialized_messages (line 776) | async def test_already_deserialized_messages(fake_dapr_client: FakeDaprC... function test_context_manager (line 797) | async def test_context_manager(fake_dapr_client: FakeDaprClient): function test_session_settings_default (line 840) | async def test_session_settings_default(fake_dapr_client: FakeDaprClient): function test_session_settings_constructor (line 854) | async def test_session_settings_constructor(fake_dapr_client: FakeDaprCl... function test_get_items_uses_session_settings_limit (line 872) | async def test_get_items_uses_session_settings_limit(fake_dapr_client: F... function test_get_items_explicit_limit_overrides_session_settings (line 903) | async def test_get_items_explicit_limit_overrides_session_settings( function test_session_settings_resolve (line 934) | async def test_session_settings_resolve(): function test_runner_with_session_settings_override (line 951) | async def test_runner_with_session_settings_override(fake_dapr_client: F... FILE: tests/extensions/memory/test_encrypt_session.py function agent (line 22) | def agent() -> Agent: function encryption_key (line 28) | def encryption_key() -> str: function set_fernet_time (line 34) | def set_fernet_time(monkeypatch): function underlying_session (line 47) | def underlying_session(): function test_encrypted_session_basic_functionality (line 54) | async def test_encrypted_session_basic_functionality( function test_encrypted_session_with_runner (line 84) | async def test_encrypted_session_with_runner( function test_encrypted_session_pop_item (line 114) | async def test_encrypted_session_pop_item(encryption_key: str, underlyin... function test_encrypted_session_clear (line 139) | async def test_encrypted_session_clear(encryption_key: str, underlying_s... function test_encrypted_session_ttl_expiration (line 156) | async def test_encrypted_session_ttl_expiration( function test_encrypted_session_pop_expired (line 185) | async def test_encrypted_session_pop_expired( function test_encrypted_session_pop_mixed_expired_valid (line 206) | async def test_encrypted_session_pop_mixed_expired_valid( function test_encrypted_session_raw_string_key (line 248) | async def test_encrypted_session_raw_string_key(underlying_session: SQLi... function test_encrypted_session_get_items_limit (line 264) | async def test_encrypted_session_get_items_limit( function test_encrypted_session_unicode_content (line 287) | async def test_encrypted_session_unicode_content( class CustomSession (line 312) | class CustomSession(SQLiteSession): method get_stats (line 315) | def get_stats(self) -> dict[str, int]: method custom_async_method (line 319) | async def custom_async_method(self) -> str: function test_encrypted_session_delegation (line 324) | async def test_encrypted_session_delegation(): function test_session_settings_delegated_to_underlying (line 356) | async def test_session_settings_delegated_to_underlying(encryption_key: ... function test_session_settings_get_items_uses_underlying_limit (line 377) | async def test_session_settings_get_items_uses_underlying_limit(encrypti... function test_session_settings_explicit_limit_overrides_settings (line 408) | async def test_session_settings_explicit_limit_overrides_settings(encryp... function test_session_settings_resolve (line 437) | async def test_session_settings_resolve(): function test_runner_with_session_settings_override (line 454) | async def test_runner_with_session_settings_override(encryption_key: str): FILE: tests/extensions/memory/test_redis_session.py function _safe_rpush (line 35) | async def _safe_rpush(client: Redis, key: str, value: str) -> None: function agent (line 43) | def agent() -> Agent: function _create_redis_session (line 48) | async def _create_redis_session( function _create_test_session (line 69) | async def _create_test_session(session_id: str | None = None) -> RedisSe... function test_redis_session_direct_ops (line 93) | async def test_redis_session_direct_ops(): function test_runner_integration (line 128) | async def test_runner_integration(agent: Agent): function test_session_isolation (line 157) | async def test_session_isolation(): function test_get_items_with_limit (line 193) | async def test_get_items_with_limit(): function test_pop_from_empty_session (line 228) | async def test_pop_from_empty_session(): function test_add_empty_items_list (line 239) | async def test_add_empty_items_list(): function test_unicode_content (line 256) | async def test_unicode_content(): function test_special_characters_and_json_safety (line 279) | async def test_special_characters_and_json_safety(): function test_data_integrity_with_problematic_strings (line 307) | async def test_data_integrity_with_problematic_strings(): function test_concurrent_access (line 341) | async def test_concurrent_access(): function test_redis_connectivity (line 380) | async def test_redis_connectivity(): function test_ttl_functionality (line 391) | async def test_ttl_functionality(): function test_from_url_constructor (line 419) | async def test_from_url_constructor(): function test_key_prefix_isolation (line 440) | async def test_key_prefix_isolation(): function test_external_client_not_closed (line 473) | async def test_external_client_not_closed(): function test_internal_client_ownership (line 517) | async def test_internal_client_ownership(): function test_decode_responses_client_compatibility (line 546) | async def test_decode_responses_client_compatibility(): function test_real_redis_decode_responses_compatibility (line 596) | async def test_real_redis_decode_responses_compatibility(): function test_get_next_id_method (line 645) | async def test_get_next_id_method(): function test_corrupted_data_handling (line 682) | async def test_corrupted_data_handling(): function test_ping_connection_failure (line 739) | async def test_ping_connection_failure(): function test_close_method_coverage (line 763) | async def test_close_method_coverage(): function test_session_settings_default (line 804) | async def test_session_settings_default(): function test_session_settings_constructor (line 818) | async def test_session_settings_constructor(): function test_session_settings_from_url (line 841) | async def test_session_settings_from_url(): function test_get_items_uses_session_settings_limit (line 861) | async def test_get_items_uses_session_settings_limit(): function test_get_items_explicit_limit_overrides_session_settings (line 897) | async def test_get_items_explicit_limit_overrides_session_settings(): function test_session_settings_resolve (line 931) | async def test_session_settings_resolve(): function test_runner_with_session_settings_override (line 948) | async def test_runner_with_session_settings_override(): FILE: tests/extensions/memory/test_sqlalchemy_session.py function _make_message_item (line 36) | def _make_message_item(item_id: str, text_value: str) -> TResponseInputI... function _make_reasoning_item (line 53) | def _make_reasoning_item(item_id: str, summary_text: str) -> TResponseIn... function _item_ids (line 63) | def _item_ids(items: Sequence[TResponseInputItem]) -> list[str]: function agent (line 72) | def agent() -> Agent: function test_sqlalchemy_session_direct_ops (line 77) | async def test_sqlalchemy_session_direct_ops(agent: Agent): function test_runner_integration (line 109) | async def test_runner_integration(agent: Agent): function test_session_isolation (line 135) | async def test_session_isolation(agent: Agent): function test_get_items_with_limit (line 159) | async def test_get_items_with_limit(agent: Agent): function test_pop_from_empty_session (line 187) | async def test_pop_from_empty_session(): function test_add_empty_items_list (line 194) | async def test_add_empty_items_list(): function test_add_items_concurrent_first_access_with_create_tables (line 208) | async def test_add_items_concurrent_first_access_with_create_tables(tmp_... function test_add_items_concurrent_first_write_after_tables_exist (line 238) | async def test_add_items_concurrent_first_write_after_tables_exist(tmp_p... function test_add_items_concurrent_first_access_across_sessions_with_shared_engine (line 275) | async def test_add_items_concurrent_first_access_across_sessions_with_sh... function test_add_items_concurrent_first_access_across_from_url_sessions (line 302) | async def test_add_items_concurrent_first_access_across_from_url_session... function test_add_items_concurrent_first_access_across_from_url_sessions_cross_loop (line 328) | async def test_add_items_concurrent_first_access_across_from_url_session... function test_add_items_concurrent_first_access_with_shared_session_cross_loop (line 376) | async def test_add_items_concurrent_first_access_with_shared_session_cro... function test_add_items_cancelled_waiter_does_not_strand_table_init_lock (line 428) | async def test_add_items_cancelled_waiter_does_not_strand_table_init_loc... function test_create_tables_false_does_not_allocate_shared_init_lock (line 465) | async def test_create_tables_false_does_not_allocate_shared_init_lock(tm... function test_get_items_same_timestamp_consistent_order (line 477) | async def test_get_items_same_timestamp_consistent_order(): function test_pop_item_same_timestamp_returns_latest (line 585) | async def test_pop_item_same_timestamp_returns_latest(): function test_get_items_orders_by_id_for_ties (line 614) | async def test_get_items_orders_by_id_for_ties(): function test_engine_property_from_url (line 668) | async def test_engine_property_from_url(): function test_engine_property_from_external_engine (line 684) | async def test_engine_property_from_external_engine(): function test_engine_property_is_read_only (line 704) | async def test_engine_property_is_read_only(): function test_session_settings_default (line 721) | async def test_session_settings_default(): function test_session_settings_from_url (line 732) | async def test_session_settings_from_url(): function test_get_items_uses_session_settings_limit (line 747) | async def test_get_items_uses_session_settings_limit(): function test_get_items_explicit_limit_overrides_session_settings (line 773) | async def test_get_items_explicit_limit_overrides_session_settings(): function test_session_settings_resolve (line 797) | async def test_session_settings_resolve(): function test_runner_with_session_settings_override (line 814) | async def test_runner_with_session_settings_override(agent: Agent): FILE: tests/extensions/test_tool_output_trimmer.py function _user (line 22) | def _user(text: str = "hello") -> dict[str, Any]: function _assistant (line 26) | def _assistant(text: str = "response") -> dict[str, Any]: function _func_call (line 30) | def _func_call(call_id: str, name: str, *, namespace: str | None = None)... function _func_output (line 37) | def _func_output(call_id: str, output: str) -> dict[str, Any]: function _make_data (line 41) | def _make_data(items: list[Any]) -> CallModelData[Any]: function _output (line 46) | def _output(result: ModelInputData, idx: int) -> Any: class TestDefaults (line 57) | class TestDefaults: method test_default_values (line 58) | def test_default_values(self) -> None: method test_trimmable_tools_coerced_to_frozenset (line 65) | def test_trimmable_tools_coerced_to_frozenset(self) -> None: method test_trimmable_tools_from_list (line 70) | def test_trimmable_tools_from_list(self) -> None: class TestValidation (line 82) | class TestValidation: method test_recent_turns_zero_raises (line 83) | def test_recent_turns_zero_raises(self) -> None: method test_recent_turns_negative_raises (line 87) | def test_recent_turns_negative_raises(self) -> None: method test_max_output_chars_zero_raises (line 91) | def test_max_output_chars_zero_raises(self) -> None: method test_preview_chars_negative_raises (line 95) | def test_preview_chars_negative_raises(self) -> None: method test_preview_chars_zero_allowed (line 99) | def test_preview_chars_zero_allowed(self) -> None: class TestRecentBoundary (line 109) | class TestRecentBoundary: method test_empty_items (line 110) | def test_empty_items(self) -> None: method test_single_user_message (line 114) | def test_single_user_message(self) -> None: method test_two_user_messages_boundary_at_first (line 118) | def test_two_user_messages_boundary_at_first(self) -> None: method test_three_user_messages (line 123) | def test_three_user_messages(self) -> None: method test_custom_recent_turns (line 135) | def test_custom_recent_turns(self) -> None: class TestTrimming (line 156) | class TestTrimming: method test_empty_input (line 157) | def test_empty_input(self) -> None: method test_no_trimming_when_all_recent (line 163) | def test_no_trimming_when_all_recent(self) -> None: method test_trims_large_old_output (line 176) | def test_trims_large_old_output(self) -> None: method test_preserves_small_old_output (line 197) | def test_preserves_small_old_output(self) -> None: method test_respects_trimmable_tools_allowlist (line 214) | def test_respects_trimmable_tools_allowlist(self) -> None: method test_respects_qualified_tool_names_allowlist (line 236) | def test_respects_qualified_tool_names_allowlist(self) -> None: method test_namespaced_tools_still_match_bare_allowlist_entries (line 254) | def test_namespaced_tools_still_match_bare_allowlist_entries(self) -> ... method test_synthetic_same_name_namespace_uses_bare_display_name (line 272) | def test_synthetic_same_name_namespace_uses_bare_display_name(self) ->... method test_trims_tool_search_output_tool_definitions (line 291) | def test_trims_tool_search_output_tool_definitions(self) -> None: method test_trims_legacy_tool_search_output_results (line 339) | def test_trims_legacy_tool_search_output_results(self) -> None: method test_trims_all_tools_when_allowlist_is_none (line 364) | def test_trims_all_tools_when_allowlist_is_none(self) -> None: method test_preserves_recent_large_output (line 381) | def test_preserves_recent_large_output(self) -> None: method test_does_not_mutate_original_items (line 398) | def test_does_not_mutate_original_items(self) -> None: method test_preserves_instructions (line 416) | def test_preserves_instructions(self) -> None: method test_multiple_old_outputs_trimmed (line 427) | def test_multiple_old_outputs_trimmed(self) -> None: method test_custom_preview_chars (line 450) | def test_custom_preview_chars(self) -> None: method test_preserves_user_and_assistant_messages (line 469) | def test_preserves_user_and_assistant_messages(self) -> None: class TestSlidingWindow (line 489) | class TestSlidingWindow: method test_turn3_trims_turn1 (line 492) | def test_turn3_trims_turn1(self) -> None: method test_turn4_trims_turns_1_and_2 (line 514) | def test_turn4_trims_turns_1_and_2(self) -> None: class TestEdgeCases (line 547) | class TestEdgeCases: method test_skips_trim_when_summary_would_exceed_original (line 548) | def test_skips_trim_when_summary_would_exceed_original(self) -> None: method test_unknown_tool_name_fallback (line 570) | def test_unknown_tool_name_fallback(self) -> None: method test_unresolved_tool_skipped_with_allowlist (line 590) | def test_unresolved_tool_skipped_with_allowlist(self) -> None: FILE: tests/fake_model.py class FakeModel (line 51) | class FakeModel(Model): method __init__ (line 52) | def __init__( method set_hardcoded_usage (line 67) | def set_hardcoded_usage(self, usage: Usage): method set_next_output (line 70) | def set_next_output(self, output: list[TResponseOutputItem] | Exception): method add_multiple_turn_outputs (line 73) | def add_multiple_turn_outputs(self, outputs: list[list[TResponseOutput... method get_next_output (line 76) | def get_next_output(self) -> list[TResponseOutputItem] | Exception: method get_response (line 81) | async def get_response( method stream_response (line 152) | async def stream_response( function get_response_obj (line 343) | def get_response_obj( FILE: tests/fastapi/streaming_app.py function stream (line 18) | async def stream(): class StreamHandler (line 24) | class StreamHandler: method __init__ (line 25) | def __init__(self, result: RunResultStreaming): method stream_events (line 28) | async def stream_events(self) -> AsyncIterator[str]: FILE: tests/fastapi/test_streaming_context.py function test_streaming_context (line 11) | async def test_streaming_context(): FILE: tests/mcp/helpers.py class DummyStream (line 28) | class DummyStream: method send (line 29) | async def send(self, msg): method receive (line 32) | async def receive(self): class DummyStreamsContextManager (line 36) | class DummyStreamsContextManager: method __aenter__ (line 37) | async def __aenter__(self): method __aexit__ (line 40) | async def __aexit__(self, exc_type, exc_val, exc_tb): class _TestFilterServer (line 44) | class _TestFilterServer(_MCPServerWithClientSession): method __init__ (line 47) | def __init__(self, tool_filter: ToolFilter, server_name: str): method create_streams (line 59) | def create_streams(self): method name (line 63) | def name(self) -> str: class FakeMCPServer (line 67) | class FakeMCPServer(MCPServer): method __init__ (line 68) | def __init__( method add_tool (line 91) | def add_tool(self, name: str, input_schema: dict[str, Any]): method connect (line 94) | async def connect(self): method cleanup (line 97) | async def cleanup(self): method list_tools (line 100) | async def list_tools(self, run_context=None, agent=None): method call_tool (line 111) | async def call_tool( method list_prompts (line 129) | async def list_prompts(self, run_context=None, agent=None) -> ListProm... method get_prompt (line 133) | async def get_prompt( method name (line 142) | def name(self) -> str: FILE: tests/mcp/test_caching.py function test_server_caching_works (line 17) | async def test_server_caching_works( FILE: tests/mcp/test_client_session_retries.py class DummySession (line 20) | class DummySession: method __init__ (line 21) | def __init__(self, fail_call_tool: int = 0, fail_list_tools: int = 0): method call_tool (line 27) | async def call_tool(self, tool_name, arguments, meta=None): method list_tools (line 33) | async def list_tools(self): class DummyServer (line 40) | class DummyServer(_MCPServerWithClientSession): method __init__ (line 41) | def __init__(self, session: DummySession, retries: int, *, serialize_r... method create_streams (line 51) | def create_streams(self): method name (line 55) | def name(self) -> str: function test_call_tool_retries_until_success (line 60) | async def test_call_tool_retries_until_success(): function test_list_tools_unlimited_retries (line 69) | async def test_list_tools_unlimited_retries(): function test_call_tool_validates_required_parameters_before_remote_call (line 79) | async def test_call_tool_validates_required_parameters_before_remote_cal... function test_call_tool_with_required_parameters_still_calls_remote_tool (line 100) | async def test_call_tool_with_required_parameters_still_calls_remote_too... function test_call_tool_skips_validation_when_tool_is_missing_from_cache (line 120) | async def test_call_tool_skips_validation_when_tool_is_missing_from_cach... function test_call_tool_skips_validation_when_required_list_is_absent (line 130) | async def test_call_tool_skips_validation_when_required_list_is_absent(): function test_call_tool_validates_required_parameters_when_arguments_is_none (line 140) | async def test_call_tool_validates_required_parameters_when_arguments_is... function test_call_tool_rejects_non_object_arguments_before_remote_call (line 152) | async def test_call_tool_rejects_non_object_arguments_before_remote_call(): class ConcurrentCancellationSession (line 163) | class ConcurrentCancellationSession: method __init__ (line 164) | def __init__(self): method call_tool (line 168) | async def call_tool(self, tool_name, arguments, meta=None): class CancelledToolSession (line 181) | class CancelledToolSession: method call_tool (line 182) | async def call_tool(self, tool_name, arguments, meta=None): class MixedExceptionGroupSession (line 186) | class MixedExceptionGroupSession: method call_tool (line 187) | async def call_tool(self, tool_name, arguments, meta=None): class SharedHttpStatusSession (line 199) | class SharedHttpStatusSession: method __init__ (line 200) | def __init__(self, status_code: int): method call_tool (line 203) | async def call_tool(self, tool_name, arguments, meta=None): class TimeoutSession (line 213) | class TimeoutSession: method __init__ (line 214) | def __init__(self, message: str = "timed out"): method call_tool (line 218) | async def call_tool(self, tool_name, arguments, meta=None): class ClosedResourceSession (line 223) | class ClosedResourceSession: method __init__ (line 224) | def __init__(self): method call_tool (line 227) | async def call_tool(self, tool_name, arguments, meta=None): class McpRequestTimeoutSession (line 232) | class McpRequestTimeoutSession: method __init__ (line 233) | def __init__(self, message: str = "timed out"): method call_tool (line 237) | async def call_tool(self, tool_name, arguments, meta=None): class IsolatedRetrySession (line 244) | class IsolatedRetrySession: method __init__ (line 245) | def __init__(self): method call_tool (line 248) | async def call_tool(self, tool_name, arguments, meta=None): class HangingSession (line 253) | class HangingSession: method call_tool (line 254) | async def call_tool(self, tool_name, arguments, meta=None): class DummyStreamableHttpServer (line 258) | class DummyStreamableHttpServer(MCPServerStreamableHttp): method __init__ (line 259) | def __init__(self, shared_session: object, isolated_session: object): method _isolated_client_session (line 269) | async def _isolated_client_session(self): method list_tools (line 272) | async def list_tools(self, run_context=None, agent=None): method list_prompts (line 275) | async def list_prompts(self): method get_prompt (line 278) | async def get_prompt(self, name, arguments=None): class IsolatedSessionEnterFailure (line 282) | class IsolatedSessionEnterFailure: method __init__ (line 283) | def __init__(self, server: "EnterFailingStreamableHttpServer", message... method __aenter__ (line 287) | async def __aenter__(self): method __aexit__ (line 291) | async def __aexit__(self, exc_type, exc, tb): class EnterFailingStreamableHttpServer (line 295) | class EnterFailingStreamableHttpServer(DummyStreamableHttpServer): method __init__ (line 296) | def __init__(self, shared_session: object, *, isolated_message: str): method _isolated_client_session (line 301) | def _isolated_client_session(self): function test_streamable_http_retries_cancelled_request_on_isolated_session (line 306) | async def test_streamable_http_retries_cancelled_request_on_isolated_ses... function test_streamable_http_retries_5xx_on_isolated_session (line 319) | async def test_streamable_http_retries_5xx_on_isolated_session(): function test_streamable_http_retries_closed_resource_on_isolated_session (line 331) | async def test_streamable_http_retries_closed_resource_on_isolated_sessi... function test_streamable_http_retries_mcp_408_on_isolated_session (line 343) | async def test_streamable_http_retries_mcp_408_on_isolated_session(): function test_streamable_http_does_not_retry_4xx_on_isolated_session (line 358) | async def test_streamable_http_does_not_retry_4xx_on_isolated_session(): function test_streamable_http_does_not_isolated_retry_without_retry_budget (line 369) | async def test_streamable_http_does_not_isolated_retry_without_retry_bud... function test_streamable_http_counts_isolated_retry_against_retry_budget (line 381) | async def test_streamable_http_counts_isolated_retry_against_retry_budge... function test_streamable_http_counts_isolated_session_setup_failure_against_retry_budget (line 395) | async def test_streamable_http_counts_isolated_session_setup_failure_aga... function test_streamable_http_does_not_retry_mixed_exception_groups (line 411) | async def test_streamable_http_does_not_retry_mixed_exception_groups(): function test_streamable_http_preserves_outer_cancellation (line 423) | async def test_streamable_http_preserves_outer_cancellation(): function test_streamable_http_preserves_outer_cancellation_during_isolated_retry (line 438) | async def test_streamable_http_preserves_outer_cancellation_during_isola... class ConcurrentPromptCancellationSession (line 450) | class ConcurrentPromptCancellationSession(ConcurrentCancellationSession): method list_tools (line 451) | async def list_tools(self): method list_prompts (line 454) | async def list_prompts(self): method get_prompt (line 460) | async def get_prompt(self, name, arguments=None): class OverlapTrackingSession (line 467) | class OverlapTrackingSession: method __init__ (line 468) | def __init__(self): method _enter_request (line 473) | async def _enter_request(self): method call_tool (line 482) | async def call_tool(self, tool_name, arguments, meta=None): method list_prompts (line 486) | async def list_prompts(self): method get_prompt (line 490) | async def get_prompt(self, name, arguments=None): class DummyPromptStreamableHttpServer (line 498) | class DummyPromptStreamableHttpServer(DummyStreamableHttpServer): method __init__ (line 499) | def __init__( method list_prompts (line 507) | async def list_prompts(self): method get_prompt (line 512) | async def get_prompt(self, name, arguments=None): function test_serialized_session_requests_prevent_sibling_cancellation (line 519) | async def test_serialized_session_requests_prevent_sibling_cancellation(): function test_serialized_prompt_requests_prevent_tool_cancellation (line 535) | async def test_serialized_prompt_requests_prevent_tool_cancellation(prom... function test_streamable_http_serializes_call_tool_with_prompt_requests (line 554) | async def test_streamable_http_serializes_call_tool_with_prompt_requests... FILE: tests/mcp/test_connect_disconnect.py function test_async_ctx_manager_works (line 15) | async def test_async_ctx_manager_works( function test_manual_connect_disconnect_works (line 45) | async def test_manual_connect_disconnect_works( FILE: tests/mcp/test_mcp_approval.py function test_mcp_require_approval_pauses_and_resumes (line 12) | async def test_mcp_require_approval_pauses_and_resumes(): function test_mcp_require_approval_tool_lists (line 40) | async def test_mcp_require_approval_tool_lists(): function test_mcp_require_approval_tool_mapping (line 68) | async def test_mcp_require_approval_tool_mapping(): function test_mcp_require_approval_mapping_allows_policy_keyword_tool_names (line 93) | async def test_mcp_require_approval_mapping_allows_policy_keyword_tool_n... FILE: tests/mcp/test_mcp_auth_params.py class TestMCPServerSseAuthAndFactory (line 13) | class TestMCPServerSseAuthAndFactory: method test_sse_default_no_auth_no_factory (line 17) | async def test_sse_default_no_auth_no_factory(self): method test_sse_with_auth (line 31) | async def test_sse_with_auth(self): method test_sse_with_httpx_client_factory (line 47) | async def test_sse_with_httpx_client_factory(self): method test_sse_with_auth_and_factory (line 75) | async def test_sse_with_auth_and_factory(self): class TestMCPServerStreamableHttpAuth (line 107) | class TestMCPServerStreamableHttpAuth: method test_streamable_http_default_no_auth (line 111) | async def test_streamable_http_default_no_auth(self): method test_streamable_http_with_auth (line 126) | async def test_streamable_http_with_auth(self): method test_streamable_http_with_auth_and_factory (line 145) | async def test_streamable_http_with_auth_and_factory(self): FILE: tests/mcp/test_mcp_server_manager.py class TaskBoundServer (line 11) | class TaskBoundServer(MCPServer): method __init__ (line 12) | def __init__(self) -> None: method name (line 18) | def name(self) -> str: method connect (line 21) | async def connect(self) -> None: method cleanup (line 24) | async def cleanup(self) -> None: method list_tools (line 31) | async def list_tools( method call_tool (line 36) | async def call_tool( method list_prompts (line 44) | async def list_prompts(self) -> ListPromptsResult: method get_prompt (line 47) | async def get_prompt( class FlakyServer (line 53) | class FlakyServer(MCPServer): method __init__ (line 54) | def __init__(self, failures: int) -> None: method name (line 60) | def name(self) -> str: method connect (line 63) | async def connect(self) -> None: method cleanup (line 69) | async def cleanup(self) -> None: method list_tools (line 72) | async def list_tools( method call_tool (line 77) | async def call_tool( method list_prompts (line 85) | async def list_prompts(self) -> ListPromptsResult: method get_prompt (line 88) | async def get_prompt( class CleanupAwareServer (line 94) | class CleanupAwareServer(MCPServer): method __init__ (line 95) | def __init__(self) -> None: method name (line 101) | def name(self) -> str: method connect (line 104) | async def connect(self) -> None: method cleanup (line 109) | async def cleanup(self) -> None: method list_tools (line 112) | async def list_tools( method call_tool (line 117) | async def call_tool( method list_prompts (line 125) | async def list_prompts(self) -> ListPromptsResult: method get_prompt (line 128) | async def get_prompt( class CancelledServer (line 134) | class CancelledServer(MCPServer): method name (line 136) | def name(self) -> str: method connect (line 139) | async def connect(self) -> None: method cleanup (line 142) | async def cleanup(self) -> None: method list_tools (line 145) | async def list_tools( method call_tool (line 150) | async def call_tool( method list_prompts (line 158) | async def list_prompts(self) -> ListPromptsResult: method get_prompt (line 161) | async def get_prompt( class FailingTaskBoundServer (line 167) | class FailingTaskBoundServer(TaskBoundServer): method name (line 169) | def name(self) -> str: method connect (line 172) | async def connect(self) -> None: class FatalError (line 177) | class FatalError(BaseException): class FatalTaskBoundServer (line 181) | class FatalTaskBoundServer(TaskBoundServer): method name (line 183) | def name(self) -> str: method connect (line 186) | async def connect(self) -> None: class CleanupFailingServer (line 191) | class CleanupFailingServer(TaskBoundServer): method name (line 193) | def name(self) -> str: method cleanup (line 196) | async def cleanup(self) -> None: function test_manager_keeps_connect_and_cleanup_in_same_task (line 202) | async def test_manager_keeps_connect_and_cleanup_in_same_task() -> None: function test_manager_connects_in_worker_tasks_when_parallel (line 212) | async def test_manager_connects_in_worker_tasks_when_parallel() -> None: function test_cross_task_cleanup_raises_without_manager (line 224) | async def test_cross_task_cleanup_raises_without_manager() -> None: function test_manager_reconnect_failed_only (line 235) | async def test_manager_reconnect_failed_only() -> None: function test_manager_reconnect_deduplicates_failures (line 248) | async def test_manager_reconnect_deduplicates_failures() -> None: function test_manager_connect_all_retries_all_servers (line 268) | async def test_manager_connect_all_retries_all_servers() -> None: function test_manager_connect_all_is_idempotent (line 286) | async def test_manager_connect_all_is_idempotent() -> None: function test_manager_reconnect_all_avoids_duplicate_connections (line 295) | async def test_manager_reconnect_all_avoids_duplicate_connections() -> N... function test_manager_strict_reconnect_refreshes_active_servers (line 304) | async def test_manager_strict_reconnect_refreshes_active_servers() -> None: function test_manager_strict_connect_preserves_existing_active_servers (line 320) | async def test_manager_strict_connect_preserves_existing_active_servers(... function test_manager_strict_connect_cleans_up_connected_servers (line 340) | async def test_manager_strict_connect_cleans_up_connected_servers() -> N... function test_manager_strict_connect_cleans_up_failed_server (line 353) | async def test_manager_strict_connect_cleans_up_failed_server() -> None: function test_manager_strict_connect_parallel_cleans_up_failed_server (line 364) | async def test_manager_strict_connect_parallel_cleans_up_failed_server()... function test_manager_strict_connect_parallel_cleans_up_workers (line 375) | async def test_manager_strict_connect_parallel_cleans_up_workers() -> None: function test_manager_parallel_cleanup_clears_worker_on_failure (line 391) | async def test_manager_parallel_cleanup_clears_worker_on_failure() -> None: function test_manager_parallel_cleanup_drops_worker_after_error (line 402) | async def test_manager_parallel_cleanup_drops_worker_after_error() -> None: function test_manager_parallel_suppresses_cancelled_error_in_strict_mode (line 425) | async def test_manager_parallel_suppresses_cancelled_error_in_strict_mod... function test_manager_parallel_propagates_cancelled_error_when_unsuppressed (line 437) | async def test_manager_parallel_propagates_cancelled_error_when_unsuppre... function test_manager_sequential_propagates_base_exception (line 448) | async def test_manager_sequential_propagates_base_exception() -> None: function test_manager_parallel_propagates_base_exception (line 460) | async def test_manager_parallel_propagates_base_exception() -> None: function test_manager_parallel_prefers_cancelled_error_when_unsuppressed (line 472) | async def test_manager_parallel_prefers_cancelled_error_when_unsuppresse... function test_manager_cleanup_runs_on_cancelled_error_during_connect (line 488) | async def test_manager_cleanup_runs_on_cancelled_error_during_connect() ... FILE: tests/mcp/test_mcp_tracing.py function test_mcp_tracing (line 13) | async def test_mcp_tracing(): FILE: tests/mcp/test_mcp_util.py class Foo (line 20) | class Foo(BaseModel): class Bar (line 25) | class Bar(BaseModel): function _convertible_schema (line 32) | def _convertible_schema() -> dict[str, Any]: function test_get_all_function_tools (line 39) | async def test_get_all_function_tools(): function test_invoke_mcp_tool (line 86) | async def test_invoke_mcp_tool(): function test_mcp_meta_resolver_merges_and_passes (line 99) | async def test_mcp_meta_resolver_merges_and_passes(): function test_mcp_meta_resolver_does_not_mutate_arguments (line 131) | async def test_mcp_meta_resolver_does_not_mutate_arguments(): function test_mcp_invoke_bad_json_errors (line 153) | async def test_mcp_invoke_bad_json_errors(caplog: pytest.LogCaptureFixtu... class CrashingFakeMCPServer (line 169) | class CrashingFakeMCPServer(FakeMCPServer): method call_tool (line 170) | async def call_tool( class CancelledFakeMCPServer (line 179) | class CancelledFakeMCPServer(FakeMCPServer): method call_tool (line 180) | async def call_tool( class SlowFakeMCPServer (line 189) | class SlowFakeMCPServer(FakeMCPServer): method call_tool (line 190) | async def call_tool( class CleanupOnCancelFakeMCPServer (line 200) | class CleanupOnCancelFakeMCPServer(FakeMCPServer): method __init__ (line 201) | def __init__(self, cleanup_finished: asyncio.Event): method call_tool (line 205) | async def call_tool( function test_mcp_invocation_crash_causes_error (line 220) | async def test_mcp_invocation_crash_causes_error(caplog: pytest.LogCaptu... function test_mcp_tool_inner_cancellation_becomes_tool_error (line 237) | async def test_mcp_tool_inner_cancellation_becomes_tool_error(): function test_mcp_tool_inner_cancellation_still_becomes_tool_error_with_prior_cancel_state (line 264) | async def test_mcp_tool_inner_cancellation_still_becomes_tool_error_with... function test_mcp_tool_outer_cancellation_still_propagates (line 283) | async def test_mcp_tool_outer_cancellation_still_propagates(): function test_mcp_tool_outer_cancellation_after_inner_completion_still_propagates (line 299) | async def test_mcp_tool_outer_cancellation_after_inner_completion_still_... function test_mcp_tool_outer_cancellation_after_inner_exception_still_propagates (line 321) | async def test_mcp_tool_outer_cancellation_after_inner_exception_still_p... function test_mcp_tool_outer_cancellation_after_inner_cancellation_still_propagates (line 346) | async def test_mcp_tool_outer_cancellation_after_inner_cancellation_stil... function test_mcp_tool_outer_cancellation_waits_for_inner_cleanup (line 371) | async def test_mcp_tool_outer_cancellation_waits_for_inner_cleanup(): function test_mcp_invocation_mcp_error_reraises (line 390) | async def test_mcp_invocation_mcp_error_reraises(caplog: pytest.LogCaptu... function test_mcp_tool_graceful_error_handling (line 444) | async def test_mcp_tool_graceful_error_handling(caplog: pytest.LogCaptur... function test_mcp_tool_timeout_handling (line 495) | async def test_mcp_tool_timeout_handling(): function test_mcp_tool_cancellation_returns_error_message (line 543) | async def test_mcp_tool_cancellation_returns_error_message(): function test_to_function_tool_legacy_call_without_agent_uses_server_policy (line 567) | async def test_to_function_tool_legacy_call_without_agent_uses_server_po... function test_to_function_tool_legacy_call_callable_policy_requires_approval (line 599) | async def test_to_function_tool_legacy_call_callable_policy_requires_app... function test_mcp_tool_failure_error_function_agent_default (line 624) | async def test_mcp_tool_failure_error_function_agent_default(): function test_mcp_tool_failure_error_function_server_override (line 655) | async def test_mcp_tool_failure_error_function_server_override(): function test_mcp_tool_failure_error_function_server_none_raises (line 689) | async def test_mcp_tool_failure_error_function_server_none_raises(): function test_replaced_mcp_tool_normal_failure_uses_replaced_policy (line 717) | async def test_replaced_mcp_tool_normal_failure_uses_replaced_policy(): function test_agent_convert_schemas_true (line 749) | async def test_agent_convert_schemas_true(): function test_agent_convert_schemas_false (line 813) | async def test_agent_convert_schemas_false(): function test_mcp_fastmcp_behavior_verification (line 853) | async def test_mcp_fastmcp_behavior_verification(): function test_agent_convert_schemas_unset (line 913) | async def test_agent_convert_schemas_unset(): function test_util_adds_properties (line 951) | async def test_util_adds_properties(): class StructuredContentTestServer (line 977) | class StructuredContentTestServer(FakeMCPServer): method __init__ (line 980) | def __init__(self, use_structured_content: bool = False, **kwargs): method set_test_result (line 986) | def set_test_result(self, content: list[Any], structured_content: dict... method call_tool (line 991) | async def call_tool( function test_structured_content_handling (line 1071) | async def test_structured_content_handling( function test_structured_content_priority_over_text (line 1097) | async def test_structured_content_priority_over_text(): function test_structured_content_fallback_behavior (line 1127) | async def test_structured_content_fallback_behavior(): function test_backwards_compatibility_unchanged (line 1153) | async def test_backwards_compatibility_unchanged(): function test_empty_structured_content_fallback (line 1181) | async def test_empty_structured_content_fallback(): function test_complex_structured_content (line 1208) | async def test_complex_structured_content(): function test_multiple_content_items_with_structured (line 1242) | async def test_multiple_content_items_with_structured(): function test_multiple_content_items_without_structured (line 1278) | async def test_multiple_content_items_without_structured(): function test_to_function_tool_preserves_mcp_title_metadata (line 1302) | def test_to_function_tool_preserves_mcp_title_metadata(): function test_to_function_tool_description_falls_back_to_mcp_title (line 1317) | def test_to_function_tool_description_falls_back_to_mcp_title(): FILE: tests/mcp/test_message_handler.py class _StubClientSession (line 32) | class _StubClientSession: method __init__ (line 35) | def __init__( method __aenter__ (line 46) | async def __aenter__(self): method __aexit__ (line 49) | async def __aexit__(self, exc_type, exc, tb): method initialize (line 52) | async def initialize(self) -> InitializeResult: class _MessageHandlerTestServer (line 62) | class _MessageHandlerTestServer(_MCPServerWithClientSession): method __init__ (line 63) | def __init__(self, handler: MessageHandlerFnT | None): method create_streams (line 70) | def create_streams(self): method name (line 85) | def name(self) -> str: function test_client_session_receives_message_handler (line 90) | async def test_client_session_receives_message_handler(monkeypatch): function test_message_handler_propagates_to_server_base (line 124) | def test_message_handler_propagates_to_server_base(server_cls, params): FILE: tests/mcp/test_prompt_server.py class FakeMCPPromptServer (line 12) | class FakeMCPPromptServer(MCPServer): method __init__ (line 15) | def __init__( method add_prompt (line 25) | def add_prompt(self, name: str, description: str, arguments: dict[str,... method set_prompt_result (line 32) | def set_prompt_result(self, name: str, result: str): method connect (line 36) | async def connect(self): method cleanup (line 39) | async def cleanup(self): method list_prompts (line 42) | async def list_prompts(self, run_context=None, agent=None): method get_prompt (line 48) | async def get_prompt(self, name: str, arguments: dict[str, Any] | None... method list_tools (line 68) | async def list_tools(self, run_context=None, agent=None): method call_tool (line 71) | async def call_tool( method name (line 80) | def name(self) -> str: function test_list_prompts (line 85) | async def test_list_prompts(): function test_get_prompt_without_arguments (line 101) | async def test_get_prompt_without_arguments(): function test_get_prompt_with_arguments (line 114) | async def test_get_prompt_with_arguments(): function test_get_prompt_not_found (line 138) | async def test_get_prompt_not_found(): function test_agent_with_prompt_instructions (line 147) | async def test_agent_with_prompt_instructions(): function test_agent_with_prompt_instructions_streaming (line 183) | async def test_agent_with_prompt_instructions_streaming(streaming: bool): function test_multiple_prompts (line 222) | async def test_multiple_prompts(): function test_prompt_with_complex_arguments (line 254) | async def test_prompt_with_complex_arguments(): function test_prompt_with_missing_arguments (line 283) | async def test_prompt_with_missing_arguments(): function test_prompt_server_cleanup (line 297) | async def test_prompt_server_cleanup(): FILE: tests/mcp/test_runner_calls_mcp.py function test_runner_calls_mcp_tool (line 23) | async def test_runner_calls_mcp_tool(streaming: bool): function test_runner_asserts_when_mcp_tool_not_found (line 57) | async def test_runner_asserts_when_mcp_tool_not_found(streaming: bool): function test_runner_works_with_multiple_mcp_servers (line 90) | async def test_runner_works_with_multiple_mcp_servers(streaming: bool): function test_runner_errors_when_mcp_tools_clash (line 128) | async def test_runner_errors_when_mcp_tools_clash(streaming: bool): class Foo (line 163) | class Foo(BaseModel): function test_runner_calls_mcp_tool_with_args (line 170) | async def test_runner_calls_mcp_tool_with_args(streaming: bool): class CrashingFakeMCPServer (line 208) | class CrashingFakeMCPServer(FakeMCPServer): method call_tool (line 209) | async def call_tool( function test_runner_emits_mcp_error_tool_call_output_item (line 220) | async def test_runner_emits_mcp_error_tool_call_output_item(streaming: b... FILE: tests/mcp/test_server_errors.py class CrashingClientSessionServer (line 9) | class CrashingClientSessionServer(_MCPServerWithClientSession): method __init__ (line 10) | def __init__(self): method create_streams (line 14) | def create_streams(self): method cleanup (line 17) | async def cleanup(self): method name (line 22) | def name(self) -> str: function test_server_errors_cause_error_and_cleanup_called (line 27) | async def test_server_errors_cause_error_and_cleanup_called(): function test_not_calling_connect_causes_error (line 37) | async def test_not_calling_connect_causes_error(): FILE: tests/mcp/test_streamable_http_client_factory.py class TestMCPServerStreamableHttpClientFactory (line 13) | class TestMCPServerStreamableHttpClientFactory: method test_default_httpx_client_factory (line 17) | async def test_default_httpx_client_factory(self): method test_custom_httpx_client_factory (line 45) | async def test_custom_httpx_client_factory(self): method test_custom_httpx_client_factory_with_ssl_cert (line 87) | async def test_custom_httpx_client_factory_with_ssl_cert(self): method test_custom_httpx_client_factory_with_proxy (line 123) | async def test_custom_httpx_client_factory_with_proxy(self): method test_custom_httpx_client_factory_with_retry_logic (line 158) | async def test_custom_httpx_client_factory_with_retry_logic(self): method test_httpx_client_factory_type_annotation (line 194) | def test_httpx_client_factory_type_annotation(self): method test_all_parameters_with_custom_factory (line 212) | async def test_all_parameters_with_custom_factory(self): FILE: tests/mcp/test_streamable_http_session_id.py class TestStreamableHttpSessionId (line 12) | class TestStreamableHttpSessionId: method test_session_id_is_none_before_connect (line 15) | def test_session_id_is_none_before_connect(self): method test_session_id_returns_none_when_callback_is_none (line 20) | def test_session_id_returns_none_when_callback_is_none(self): method test_session_id_returns_callback_value (line 26) | def test_session_id_returns_callback_value(self): method test_session_id_returns_none_when_callback_returns_none (line 34) | def test_session_id_returns_none_when_callback_returns_none(self): method test_session_id_reflects_updated_callback_value (line 41) | def test_session_id_reflects_updated_callback_value(self): method test_connect_captures_get_session_id_callback (line 56) | async def test_connect_captures_get_session_id_callback(self): function test_session_id_is_none_after_cleanup (line 97) | async def test_session_id_is_none_after_cleanup(): FILE: tests/mcp/test_tool_filtering.py function create_test_agent (line 19) | def create_test_agent(name: str = "test_agent") -> Agent: function create_test_context (line 24) | def create_test_context() -> RunContextWrapper: function test_static_tool_filtering (line 33) | async def test_static_tool_filtering(): function test_dynamic_filter_sync_and_async (line 84) | async def test_dynamic_filter_sync_and_async(): function test_dynamic_filter_context_handling (line 116) | async def test_dynamic_filter_context_handling(): function test_dynamic_filter_error_handling (line 162) | async def test_dynamic_filter_error_handling(): function test_agent_dynamic_filtering_integration (line 188) | async def test_agent_dynamic_filtering_integration(): FILE: tests/memory/test_openai_responses_compaction_session.py class TestIsOpenAIModelName (line 28) | class TestIsOpenAIModelName: method test_gpt_models (line 29) | def test_gpt_models(self) -> None: method test_o_models (line 39) | def test_o_models(self) -> None: method test_fine_tuned_models (line 44) | def test_fine_tuned_models(self) -> None: method test_invalid_models (line 48) | def test_invalid_models(self) -> None: class TestSelectCompactionCandidateItems (line 53) | class TestSelectCompactionCandidateItems: method test_excludes_user_messages (line 54) | def test_excludes_user_messages(self) -> None: method test_excludes_compaction_items (line 63) | def test_excludes_compaction_items(self) -> None: method test_excludes_easy_user_messages_without_type (line 72) | def test_excludes_easy_user_messages_without_type(self) -> None: class TestOpenAIResponsesCompactionSession (line 82) | class TestOpenAIResponsesCompactionSession: method create_mock_session (line 83) | def create_mock_session(self) -> MagicMock: method test_init_validates_model (line 92) | def test_init_validates_model(self) -> None: method test_init_accepts_valid_model (line 102) | def test_init_accepts_valid_model(self) -> None: method test_add_items_delegates (line 112) | async def test_add_items_delegates(self) -> None: method test_get_items_delegates (line 127) | async def test_get_items_delegates(self) -> None: method test_run_compaction_requires_response_id (line 141) | async def test_run_compaction_requires_response_id(self) -> None: method test_run_compaction_input_mode_without_response_id (line 153) | async def test_run_compaction_input_mode_without_response_id(self) -> ... method test_run_compaction_auto_without_response_id_uses_input (line 192) | async def test_run_compaction_auto_without_response_id_uses_input(self... method test_run_compaction_auto_uses_input_when_store_false (line 219) | async def test_run_compaction_auto_uses_input_when_store_false(self) -... method test_run_compaction_auto_uses_default_store_when_unset (line 252) | async def test_run_compaction_auto_uses_default_store_when_unset(self)... method test_run_compaction_auto_uses_input_when_last_response_unstored (line 287) | async def test_run_compaction_auto_uses_input_when_last_response_unsto... method test_run_compaction_skips_when_below_threshold (line 330) | async def test_run_compaction_skips_when_below_threshold(self) -> None: method test_run_compaction_executes_when_threshold_met (line 351) | async def test_run_compaction_executes_when_threshold_met(self) -> None: method test_run_compaction_force_bypasses_threshold (line 382) | async def test_run_compaction_force_bypasses_threshold(self) -> None: method test_run_compaction_suppresses_model_dump_warnings (line 403) | async def test_run_compaction_suppresses_model_dump_warnings(self) -> ... method test_compaction_runs_during_runner_flow (line 446) | async def test_compaction_runs_during_runner_flow(self) -> None: method test_compaction_skips_when_tool_outputs_present (line 472) | async def test_compaction_skips_when_tool_outputs_present(self) -> None: method test_deferred_compaction_includes_compaction_mode_in_context (line 498) | async def test_deferred_compaction_includes_compaction_mode_in_context... method test_compaction_runs_after_deferred_tool_outputs_when_due (line 531) | async def test_compaction_runs_after_deferred_tool_outputs_when_due(se... method test_deferred_compaction_persists_across_tool_turns (line 573) | async def test_deferred_compaction_persists_across_tool_turns(self) ->... class TestStripOrphanedAssistantIds (line 617) | class TestStripOrphanedAssistantIds: method test_noop_when_empty (line 618) | def test_noop_when_empty(self) -> None: method test_strips_id_from_assistant_when_no_reasoning (line 621) | def test_strips_id_from_assistant_when_no_reasoning(self) -> None: method test_preserves_id_when_reasoning_present (line 637) | def test_preserves_id_when_reasoning_present(self) -> None: method test_preserves_assistant_without_id (line 648) | def test_preserves_assistant_without_id(self) -> None: method test_strips_multiple_assistant_ids (line 658) | def test_strips_multiple_assistant_ids(self) -> None: class TestCompactionStripsOrphanedIds (line 678) | class TestCompactionStripsOrphanedIds: method create_mock_session (line 682) | def create_mock_session(self) -> MagicMock: method test_run_compaction_strips_orphaned_assistant_ids (line 692) | async def test_run_compaction_strips_orphaned_assistant_ids(self) -> N... method test_run_compaction_keeps_ids_when_reasoning_present (line 726) | async def test_run_compaction_keeps_ids_when_reasoning_present(self) -... class TestTypeGuard (line 756) | class TestTypeGuard: method test_is_compaction_aware_session_true (line 757) | def test_is_compaction_aware_session_true(self) -> None: method test_is_compaction_aware_session_false (line 771) | def test_is_compaction_aware_session_false(self) -> None: method test_is_compaction_aware_session_none (line 775) | def test_is_compaction_aware_session_none(self) -> None: FILE: tests/model_settings/test_serialization.py function verify_serialization (line 12) | def verify_serialization(model_settings: ModelSettings) -> None: function test_basic_serialization (line 19) | def test_basic_serialization() -> None: function test_mcp_tool_choice_serialization (line 33) | def test_mcp_tool_choice_serialization() -> None: function test_all_fields_serialization (line 44) | def test_all_fields_serialization() -> None: function test_extra_args_serialization (line 90) | def test_extra_args_serialization() -> None: function test_extra_args_resolve (line 108) | def test_extra_args_resolve() -> None: function test_extra_args_resolve_with_none (line 133) | def test_extra_args_resolve_with_none() -> None: function test_extra_args_resolve_both_none (line 152) | def test_extra_args_resolve_both_none() -> None: function test_pydantic_serialization (line 163) | def test_pydantic_serialization() -> None: function test_retry_policy_is_excluded_from_json_dict (line 193) | def test_retry_policy_is_excluded_from_json_dict() -> None: function test_retry_resolve_deep_merges_backoff (line 218) | def test_retry_resolve_deep_merges_backoff() -> None: function test_retry_policy_is_omitted_from_pydantic_round_trip (line 247) | def test_retry_policy_is_omitted_from_pydantic_round_trip() -> None: function test_retry_backoff_validate_python_accepts_nested_dict_input (line 267) | def test_retry_backoff_validate_python_accepts_nested_dict_input() -> None: function test_retry_backoff_validate_python_preserves_falsey_values (line 294) | def test_retry_backoff_validate_python_preserves_falsey_values() -> None: FILE: tests/models/test_deepseek_reasoning_content.py function test_deepseek_reasoning_content_preserved_in_tool_calls (line 22) | async def test_deepseek_reasoning_content_preserved_in_tool_calls(monkey... function test_deepseek_reasoning_content_in_multi_turn_conversation (line 111) | async def test_deepseek_reasoning_content_in_multi_turn_conversation(mon... function test_deepseek_reasoning_content_with_openai_chatcompletions_path (line 204) | def test_deepseek_reasoning_content_with_openai_chatcompletions_path(): function test_reasoning_content_from_other_provider_not_attached_to_deepseek (line 256) | def test_reasoning_content_from_other_provider_not_attached_to_deepseek(): function test_reasoning_content_without_provider_data_attached_for_backward_compat (line 311) | def test_reasoning_content_without_provider_data_attached_for_backward_c... FILE: tests/models/test_default_models.py function test_default_model_is_gpt_4_1 (line 14) | def test_default_model_is_gpt_4_1(): function test_default_model_env_gpt_5 (line 22) | def test_default_model_env_gpt_5(): function test_default_model_env_gpt_5_1 (line 30) | def test_default_model_env_gpt_5_1(): function test_default_model_env_gpt_5_2 (line 38) | def test_default_model_env_gpt_5_2(): function test_default_model_env_gpt_5_2_codex (line 46) | def test_default_model_env_gpt_5_2_codex(): function test_default_model_env_gpt_5_mini (line 54) | def test_default_model_env_gpt_5_mini(): function test_default_model_env_gpt_5_nano (line 62) | def test_default_model_env_gpt_5_nano(): function test_default_model_env_gpt_5_chat_latest (line 70) | def test_default_model_env_gpt_5_chat_latest(): function test_default_model_env_gpt_4o (line 78) | def test_default_model_env_gpt_4o(): function test_agent_uses_gpt_5_default_model_settings (line 86) | def test_agent_uses_gpt_5_default_model_settings(): function test_agent_resets_model_settings_for_non_gpt_5_models (line 95) | def test_agent_resets_model_settings_for_non_gpt_5_models(): FILE: tests/models/test_kwargs_functionality.py function test_litellm_kwargs_forwarded (line 22) | async def test_litellm_kwargs_forwarded(monkeypatch): function test_openai_chatcompletions_kwargs_forwarded (line 71) | async def test_openai_chatcompletions_kwargs_forwarded(monkeypatch): function test_empty_kwargs_handling (line 136) | async def test_empty_kwargs_handling(monkeypatch): function test_reasoning_effort_falls_back_to_extra_args (line 189) | async def test_reasoning_effort_falls_back_to_extra_args(monkeypatch): function test_litellm_retry_settings_do_not_leak_and_disable_provider_retries_on_runner_retry (line 227) | async def test_litellm_retry_settings_do_not_leak_and_disable_provider_r... function test_litellm_get_retry_advice_uses_response_headers (line 272) | def test_litellm_get_retry_advice_uses_response_headers() -> None: function test_litellm_get_retry_advice_keeps_stateful_transport_failures_ambiguous (line 299) | def test_litellm_get_retry_advice_keeps_stateful_transport_failures_ambi... FILE: tests/models/test_litellm_chatcompletions_stream.py function test_stream_response_yields_events_for_text_content (line 32) | async def test_stream_response_yields_events_for_text_content(monkeypatc... function test_stream_response_yields_events_for_refusal_content (line 133) | async def test_stream_response_yields_events_for_refusal_content(monkeyp... function test_stream_response_yields_events_for_tool_call (line 213) | async def test_stream_response_yields_events_for_tool_call(monkeypatch) ... function test_stream_response_yields_real_time_function_call_arguments (line 308) | async def test_stream_response_yields_real_time_function_call_arguments(... FILE: tests/models/test_litellm_extra_body.py function test_extra_body_is_forwarded (line 12) | async def test_extra_body_is_forwarded(monkeypatch): function test_extra_body_reasoning_effort_is_promoted (line 49) | async def test_extra_body_reasoning_effort_is_promoted(monkeypatch): function test_reasoning_effort_prefers_model_settings (line 86) | async def test_reasoning_effort_prefers_model_settings(monkeypatch): function test_extra_body_reasoning_effort_overrides_extra_args (line 125) | async def test_extra_body_reasoning_effort_overrides_extra_args(monkeypa... function test_reasoning_summary_is_preserved (line 163) | async def test_reasoning_summary_is_preserved(monkeypatch): FILE: tests/models/test_litellm_logging_patch.py function test_litellm_logging_patch_env_var_controls_application (line 10) | def test_litellm_logging_patch_env_var_controls_application(monkeypatch): FILE: tests/models/test_litellm_user_agent.py function test_user_agent_header_litellm (line 14) | async def test_user_agent_header_litellm(override_ua: str | None, monkey... FILE: tests/models/test_map.py function test_no_prefix_is_openai (line 18) | def test_no_prefix_is_openai(): function test_openai_prefix_is_openai (line 24) | def test_openai_prefix_is_openai(): function test_litellm_prefix_is_litellm (line 30) | def test_litellm_prefix_is_litellm(): function test_no_prefix_can_use_openai_responses_websocket (line 36) | def test_no_prefix_can_use_openai_responses_websocket(): function test_openai_prefix_can_use_openai_responses_websocket (line 45) | def test_openai_prefix_can_use_openai_responses_websocket(): function test_multi_provider_passes_websocket_base_url_to_openai_provider (line 54) | def test_multi_provider_passes_websocket_base_url_to_openai_provider(mon... function test_openai_prefix_defaults_to_alias_mode (line 70) | def test_openai_prefix_defaults_to_alias_mode(monkeypatch): function test_openai_prefix_can_be_preserved_as_literal_model_id (line 88) | def test_openai_prefix_can_be_preserved_as_literal_model_id(monkeypatch): function test_unknown_prefix_defaults_to_error (line 106) | def test_unknown_prefix_defaults_to_error(): function test_unknown_prefix_can_be_preserved_for_openai_compatible_model_ids (line 113) | def test_unknown_prefix_can_be_preserved_for_openai_compatible_model_ids... function test_provider_map_entries_override_openai_prefix_mode (line 135) | def test_provider_map_entries_override_openai_prefix_mode(monkeypatch): function test_multi_provider_rejects_invalid_prefix_modes (line 163) | def test_multi_provider_rejects_invalid_prefix_modes(): FILE: tests/models/test_reasoning_content_replay_hook.py function _second_turn_input_items (line 28) | def _second_turn_input_items(model_name: str) -> list[TResponseInputItem]: function _second_turn_input_items_with_message (line 62) | def _second_turn_input_items_with_message(model_name: str) -> list[TResp... function _second_turn_input_items_with_file_search (line 111) | def _second_turn_input_items_with_file_search(model_name: str) -> list[T... function _second_turn_input_items_with_message_then_reasoning (line 137) | def _second_turn_input_items_with_message_then_reasoning( function _second_turn_input_items_with_thinking_blocks (line 188) | def _second_turn_input_items_with_thinking_blocks(model_name: str) -> li... function _assistant_with_tool_calls (line 227) | def _assistant_with_tool_calls(messages: list[Any]) -> dict[str, Any]: function test_converter_keeps_default_reasoning_replay_behavior_for_non_default_model (line 234) | def test_converter_keeps_default_reasoning_replay_behavior_for_non_defau... function test_converter_preserves_reasoning_content_across_output_message_with_hook (line 244) | def test_converter_preserves_reasoning_content_across_output_message_wit... function test_converter_replays_reasoning_content_when_reasoning_follows_message_with_hook (line 259) | def test_converter_replays_reasoning_content_when_reasoning_follows_mess... function test_converter_replays_reasoning_content_for_file_search_call_with_hook (line 274) | def test_converter_replays_reasoning_content_for_file_search_call_with_h... function test_converter_replays_reasoning_content_with_thinking_blocks_and_hook (line 289) | def test_converter_replays_reasoning_content_with_thinking_blocks_and_ho... function test_openai_chatcompletions_hook_can_enable_reasoning_content_replay (line 308) | async def test_openai_chatcompletions_hook_can_enable_reasoning_content_... function test_litellm_hook_can_enable_reasoning_content_replay (line 366) | async def test_litellm_hook_can_enable_reasoning_content_replay(monkeypa... FILE: tests/realtime/test_agent.py function test_can_initialize_realtime_agent (line 9) | def test_can_initialize_realtime_agent(): function test_dynamic_instructions (line 16) | async def test_dynamic_instructions(): FILE: tests/realtime/test_audio_formats_unit.py function test_to_realtime_audio_format_from_strings (line 6) | def test_to_realtime_audio_format_from_strings(): function test_to_realtime_audio_format_passthrough_and_unknown_logs (line 18) | def test_to_realtime_audio_format_passthrough_and_unknown_logs(): function test_to_realtime_audio_format_none (line 27) | def test_to_realtime_audio_format_none(): function test_to_realtime_audio_format_from_mapping (line 31) | def test_to_realtime_audio_format_from_mapping(): FILE: tests/realtime/test_conversion_helpers.py class TestConversionHelperTryConvertRawMessage (line 26) | class TestConversionHelperTryConvertRawMessage: method test_try_convert_raw_message_valid_session_update (line 29) | def test_try_convert_raw_message_valid_session_update(self): method test_try_convert_raw_message_valid_response_create (line 50) | def test_try_convert_raw_message_valid_response_create(self): method test_try_convert_raw_message_invalid_type (line 64) | def test_try_convert_raw_message_invalid_type(self): method test_try_convert_raw_message_malformed_data (line 77) | def test_try_convert_raw_message_malformed_data(self): method test_try_convert_raw_message_missing_type (line 92) | def test_try_convert_raw_message_missing_type(self): class TestConversionHelperTracingConfig (line 106) | class TestConversionHelperTracingConfig: method test_convert_tracing_config_none (line 109) | def test_convert_tracing_config_none(self): method test_convert_tracing_config_auto (line 114) | def test_convert_tracing_config_auto(self): method test_convert_tracing_config_dict_full (line 119) | def test_convert_tracing_config_dict_full(self): method test_convert_tracing_config_dict_partial (line 135) | def test_convert_tracing_config_dict_partial(self): method test_convert_tracing_config_empty_dict (line 149) | def test_convert_tracing_config_empty_dict(self): class TestConversionHelperUserInput (line 162) | class TestConversionHelperUserInput: method test_convert_user_input_to_conversation_item_string (line 165) | def test_convert_user_input_to_conversation_item_string(self): method test_convert_user_input_to_conversation_item_dict (line 178) | def test_convert_user_input_to_conversation_item_dict(self): method test_convert_user_input_to_conversation_item_dict_empty_content (line 201) | def test_convert_user_input_to_conversation_item_dict_empty_content(se... method test_convert_user_input_to_item_create (line 217) | def test_convert_user_input_to_item_create(self): class TestConversionHelperAudio (line 229) | class TestConversionHelperAudio: method test_convert_audio_to_input_audio_buffer_append (line 232) | def test_convert_audio_to_input_audio_buffer_append(self): method test_convert_audio_to_input_audio_buffer_append_empty (line 246) | def test_convert_audio_to_input_audio_buffer_append_empty(self): method test_convert_audio_to_input_audio_buffer_append_large_data (line 257) | def test_convert_audio_to_input_audio_buffer_append_large_data(self): class TestConversionHelperToolOutput (line 272) | class TestConversionHelperToolOutput: method test_convert_tool_output (line 275) | def test_convert_tool_output(self): method test_convert_tool_output_no_call_id (line 296) | def test_convert_tool_output_no_call_id(self): method test_convert_tool_output_empty_output (line 313) | def test_convert_tool_output_empty_output(self): class TestConversionHelperInterrupt (line 333) | class TestConversionHelperInterrupt: method test_convert_interrupt (line 336) | def test_convert_interrupt(self): method test_convert_interrupt_zero_time (line 352) | def test_convert_interrupt_zero_time(self): method test_convert_interrupt_large_values (line 362) | def test_convert_interrupt_large_values(self): method test_convert_interrupt_empty_item_id (line 372) | def test_convert_interrupt_empty_item_id(self): FILE: tests/realtime/test_ga_session_update_normalization.py class _DummyWS (line 11) | class _DummyWS: method __init__ (line 12) | def __init__(self) -> None: method send (line 15) | async def send(self, data: str) -> None: function test_no_auto_interrupt_on_vad_speech_started (line 20) | async def test_no_auto_interrupt_on_vad_speech_started(monkeypatch: Any)... FILE: tests/realtime/test_item_parsing.py function test_user_message_conversion (line 23) | def test_user_message_conversion() -> None: function test_assistant_message_conversion (line 53) | def test_assistant_message_conversion() -> None: function test_system_message_conversion (line 68) | def test_system_message_conversion() -> None: FILE: tests/realtime/test_model_events.py function test_all_events_have_type (line 6) | def test_all_events_have_type() -> None: FILE: tests/realtime/test_openai_realtime.py class TestOpenAIRealtimeWebSocketModel (line 30) | class TestOpenAIRealtimeWebSocketModel: method model (line 34) | def model(self): method mock_websocket (line 39) | def mock_websocket(self): class TestConnectionLifecycle (line 47) | class TestConnectionLifecycle(TestOpenAIRealtimeWebSocketModel): method test_connect_missing_api_key_raises_error (line 51) | async def test_connect_missing_api_key_raises_error(self, model): method test_connect_with_call_id_and_model_raises_error (line 60) | async def test_connect_with_call_id_and_model_raises_error(self, model): method test_connect_with_string_api_key (line 72) | async def test_connect_with_string_api_key(self, model, mock_websocket): method test_connect_defaults_to_gpt_realtime_1_5 (line 117) | async def test_connect_defaults_to_gpt_realtime_1_5(self, model, mock_... method test_session_update_includes_noise_reduction (line 147) | async def test_session_update_includes_noise_reduction(self, model, mo... method test_session_update_omits_noise_reduction_when_not_provided (line 188) | async def test_session_update_omits_noise_reduction_when_not_provided( method test_connect_with_custom_headers_overrides_defaults (line 229) | async def test_connect_with_custom_headers_overrides_defaults(self, mo... method test_connect_with_callable_api_key (line 266) | async def test_connect_with_callable_api_key(self, model, mock_websock... method test_connect_with_async_callable_api_key (line 294) | async def test_connect_with_async_callable_api_key(self, model, mock_w... method test_connect_websocket_failure_propagates (line 321) | async def test_connect_websocket_failure_propagates(self, model): method test_connect_with_empty_transport_config (line 336) | async def test_connect_with_empty_transport_config(self, mock_websocket): method test_connect_already_connected_assertion (line 365) | async def test_connect_already_connected_assertion(self, model, mock_w... method test_session_update_disable_turn_detection (line 375) | async def test_session_update_disable_turn_detection(self, model, mock... class TestEventHandlingRobustness (line 415) | class TestEventHandlingRobustness(TestOpenAIRealtimeWebSocketModel): method test_handle_malformed_json_logs_error_continues (line 419) | async def test_handle_malformed_json_logs_error_continues(self, model): method test_handle_invalid_event_schema_logs_error (line 433) | async def test_handle_invalid_event_schema_logs_error(self, model): method test_handle_unknown_event_type_ignored (line 448) | async def test_handle_unknown_event_type_ignored(self, model): method test_handle_audio_delta_event_success (line 467) | async def test_handle_audio_delta_event_success(self, model): method test_backward_compat_output_item_added_and_done (line 504) | async def test_backward_compat_output_item_added_and_done(self, model): method test_text_mode_output_item_content (line 539) | async def test_text_mode_output_item_content(self, model): method test_transcription_related_and_timeouts_and_speech_started (line 575) | async def test_transcription_related_and_timeouts_and_speech_started(s... method test_speech_started_skips_truncate_when_audio_complete (line 644) | async def test_speech_started_skips_truncate_when_audio_complete(self,... method test_speech_started_truncates_when_response_ongoing (line 675) | async def test_speech_started_truncates_when_response_ongoing(self, mo... class TestSendEventAndConfig (line 708) | class TestSendEventAndConfig(TestOpenAIRealtimeWebSocketModel): method test_send_event_dispatch (line 710) | async def test_send_event_dispatch(self, model, monkeypatch): method test_interrupt_force_cancel_overrides_auto_cancellation (line 735) | async def test_interrupt_force_cancel_overrides_auto_cancellation(self... method test_interrupt_respects_auto_cancellation_when_not_forced (line 760) | async def test_interrupt_respects_auto_cancellation_when_not_forced(se... method test_add_remove_listener_and_tools_conversion (line 783) | def test_add_remove_listener_and_tools_conversion(self, model): method test_get_and_update_session_config (line 804) | def test_get_and_update_session_config(self, model): method test_session_config_defaults_audio_formats_when_not_call (line 818) | def test_session_config_defaults_audio_formats_when_not_call(self, mod... method test_session_config_allows_tool_search_as_named_function_tool_choice (line 830) | def test_session_config_allows_tool_search_as_named_function_tool_choi... method test_session_config_preserves_sip_audio_formats (line 839) | def test_session_config_preserves_sip_audio_formats(self, model): method test_session_config_respects_audio_block_and_output_modalities (line 851) | def test_session_config_respects_audio_block_and_output_modalities(sel... method test_handle_error_event_success (line 897) | async def test_handle_error_event_success(self, model): method test_handle_tool_call_event_success (line 920) | async def test_handle_tool_call_event_success(self, model): method test_audio_timing_calculation_accuracy (line 955) | async def test_audio_timing_calculation_accuracy(self, model): method test_calculate_audio_length_ms_pure_function (line 996) | def test_calculate_audio_length_ms_pure_function(self, model): method test_handle_audio_delta_state_management (line 1015) | async def test_handle_audio_delta_state_management(self, model): class TestTransportIntegration (line 1043) | class TestTransportIntegration: method test_connect_to_local_server (line 1047) | async def test_connect_to_local_server(self): method test_ping_timeout_success_when_server_responds_quickly (line 1130) | async def test_ping_timeout_success_when_server_responds_quickly(self): method test_ping_timeout_config_is_applied (line 1169) | async def test_ping_timeout_config_is_applied(self): method test_ping_timeout_disabled_vs_enabled (line 1247) | async def test_ping_timeout_disabled_vs_enabled(self): method test_handshake_timeout_success_when_server_responds_quickly (line 1319) | async def test_handshake_timeout_success_when_server_responds_quickly(... method test_handshake_timeout_with_delayed_server (line 1354) | async def test_handshake_timeout_with_delayed_server(self): method test_ping_interval_comparison_fast_vs_slow (line 1474) | async def test_ping_interval_comparison_fast_vs_slow(self): FILE: tests/realtime/test_openai_realtime_conversions.py function test_get_api_key_from_env (line 29) | async def test_get_api_key_from_env(monkeypatch): function test_get_api_key_from_callable_async (line 35) | async def test_get_api_key_from_callable_async(): function test_try_convert_raw_message_invalid_returns_none (line 42) | def test_try_convert_raw_message_invalid_returns_none(): function test_convert_user_input_to_conversation_item_dict_and_str (line 47) | def test_convert_user_input_to_conversation_item_dict_and_str(): function test_convert_tracing_config_variants (line 72) | def test_convert_tracing_config_variants(): function test_tools_to_session_tools_raises_on_non_function_tool (line 88) | def test_tools_to_session_tools_raises_on_non_function_tool(): function test_tools_to_session_tools_includes_handoffs (line 98) | def test_tools_to_session_tools_includes_handoffs(): function test_tools_to_session_tools_rejects_namespaced_function_tools (line 106) | def test_tools_to_session_tools_rejects_namespaced_function_tools(): function test_tools_to_session_tools_rejects_deferred_function_tools (line 118) | def test_tools_to_session_tools_rejects_deferred_function_tools(): FILE: tests/realtime/test_openai_realtime_sip_model.py class _DummyWebSocket (line 11) | class _DummyWebSocket: method __init__ (line 12) | def __init__(self) -> None: method __aiter__ (line 16) | def __aiter__(self): method __anext__ (line 19) | async def __anext__(self): # pragma: no cover - simple termination method send (line 22) | async def send(self, data: str) -> None: method close (line 25) | async def close(self) -> None: function test_sip_model_uses_call_id_in_url (line 30) | async def test_sip_model_uses_call_id_in_url(monkeypatch: pytest.MonkeyP... function test_sip_model_requires_call_id (line 52) | async def test_sip_model_requires_call_id() -> None: FILE: tests/realtime/test_playback_tracker.py class TestPlaybackTracker (line 11) | class TestPlaybackTracker: method model (line 15) | def model(self): method test_interrupt_timing_with_custom_playback_tracker (line 20) | async def test_interrupt_timing_with_custom_playback_tracker(self, mod... method test_interrupt_skipped_when_no_audio_playing (line 48) | async def test_interrupt_skipped_when_no_audio_playing(self, model): method test_interrupt_skips_when_elapsed_exceeds_audio_length (line 60) | async def test_interrupt_skips_when_elapsed_exceeds_audio_length(self,... method test_interrupt_sends_truncate_when_ongoing_response (line 80) | async def test_interrupt_sends_truncate_when_ongoing_response(self, mo... method test_audio_state_accumulation_across_deltas (line 101) | def test_audio_state_accumulation_across_deltas(self): method test_state_cleanup_on_interruption (line 117) | def test_state_cleanup_on_interruption(self): method test_audio_length_calculation_with_different_formats (line 142) | def test_audio_length_calculation_with_different_formats(self): FILE: tests/realtime/test_playback_tracker_manual_unit.py function test_playback_tracker_on_play_bytes_and_state (line 4) | def test_playback_tracker_on_play_bytes_and_state(): FILE: tests/realtime/test_realtime_handoffs.py function test_realtime_handoff_creation (line 17) | def test_realtime_handoff_creation(): function test_realtime_handoff_with_custom_params (line 28) | def test_realtime_handoff_with_custom_params(): function test_realtime_handoff_execution (line 49) | async def test_realtime_handoff_execution(): function test_realtime_handoff_with_on_handoff_callback (line 64) | def test_realtime_handoff_with_on_handoff_callback(): function test_regular_agent_handoff_still_works (line 87) | def test_regular_agent_handoff_still_works(): function test_type_annotations_work (line 100) | def test_type_annotations_work(): function test_realtime_handoff_invalid_param_counts_raise (line 112) | def test_realtime_handoff_invalid_param_counts_raise(): function test_realtime_handoff_missing_input_json_raises_model_error (line 133) | async def test_realtime_handoff_missing_input_json_raises_model_error(): function test_realtime_handoff_is_enabled_async (line 148) | async def test_realtime_handoff_is_enabled_async(monkeypatch): function test_realtime_handoff_rejects_none_input (line 162) | async def test_realtime_handoff_rejects_none_input() -> None: function test_realtime_handoff_sync_is_enabled_callable (line 177) | async def test_realtime_handoff_sync_is_enabled_callable() -> None: function test_realtime_handoff_sync_on_handoff_executes (line 196) | def test_realtime_handoff_sync_on_handoff_executes() -> None: function test_realtime_handoff_on_handoff_without_input_runs (line 215) | def test_realtime_handoff_on_handoff_without_input_runs() -> None: FILE: tests/realtime/test_realtime_model_settings.py function test_collect_enabled_handoffs_filters_disabled (line 27) | async def test_collect_enabled_handoffs_filters_disabled() -> None: function test_build_model_settings_from_agent_merges_agent_fields (line 43) | async def test_build_model_settings_from_agent_merges_agent_fields(monke... function test_sip_model_build_initial_session_payload (line 77) | async def test_sip_model_build_initial_session_payload(monkeypatch: pyte... function test_call_id_session_update_omits_null_audio_formats (line 136) | def test_call_id_session_update_omits_null_audio_formats() -> None: function test_call_id_session_update_includes_explicit_audio_formats (line 150) | def test_call_id_session_update_includes_explicit_audio_formats() -> None: FILE: tests/realtime/test_runner.py class MockRealtimeModel (line 13) | class MockRealtimeModel(RealtimeModel): method __init__ (line 14) | def __init__(self): method connect (line 17) | async def connect(self, options=None): method add_listener (line 20) | def add_listener(self, listener): method remove_listener (line 23) | def remove_listener(self, listener): method send_event (line 26) | async def send_event(self, event): method send_message (line 29) | async def send_message(self, message, other_event_data=None): method send_audio (line 32) | async def send_audio(self, audio, commit=False): method send_tool_output (line 35) | async def send_tool_output(self, tool_call, output, start_response=True): method interrupt (line 38) | async def interrupt(self): method close (line 41) | async def close(self): function mock_agent (line 46) | def mock_agent(): function mock_model (line 54) | def mock_model(): function test_run_creates_session_with_no_settings (line 59) | async def test_run_creates_session_with_no_settings( function test_run_creates_session_with_settings_only_in_init (line 87) | async def test_run_creates_session_with_settings_only_in_init( function test_run_creates_session_with_settings_in_both_init_and_run_overrides (line 111) | async def test_run_creates_session_with_settings_in_both_init_and_run_ov... function test_run_creates_session_with_settings_only_in_run (line 141) | async def test_run_creates_session_with_settings_only_in_run( function test_run_with_context_parameter (line 168) | async def test_run_with_context_parameter(mock_agent: Mock, mock_model: ... function test_run_with_none_values_from_agent_does_not_crash (line 184) | async def test_run_with_none_values_from_agent_does_not_crash(mock_model... function test_tool_and_handoffs_are_correct (line 206) | async def test_tool_and_handoffs_are_correct(mock_model: MockRealtimeMod... FILE: tests/realtime/test_session.py class _DummyModel (line 67) | class _DummyModel(RealtimeModel): method __init__ (line 68) | def __init__(self) -> None: method connect (line 73) | async def connect(self, options=None): # pragma: no cover - not used ... method close (line 76) | async def close(self): # pragma: no cover - not used here method send_event (line 79) | async def send_event(self, event): method add_listener (line 82) | def add_listener(self, listener): method remove_listener (line 85) | def remove_listener(self, listener): function test_property_and_send_helpers_and_enter_alias (line 91) | async def test_property_and_send_helpers_and_enter_alias(): function test_aiter_cancel_breaks_loop_gracefully (line 113) | async def test_aiter_cancel_breaks_loop_gracefully(): function test_transcription_completed_adds_new_user_item (line 130) | async def test_transcription_completed_adds_new_user_item(): class _FakeAudio (line 144) | class _FakeAudio: function test_item_updated_merge_exception_path_logs_error (line 151) | async def test_item_updated_merge_exception_path_logs_error(monkeypatch): function test_handle_tool_call_handoff_invalid_result_raises (line 175) | async def test_handle_tool_call_handoff_invalid_result_raises(): function test_on_guardrail_task_done_emits_error_event (line 199) | async def test_on_guardrail_task_done_emits_error_event(): function test_get_handoffs_async_is_enabled (line 225) | async def test_get_handoffs_async_is_enabled(monkeypatch): class MockRealtimeModel (line 252) | class MockRealtimeModel(RealtimeModel): method __init__ (line 253) | def __init__(self): method connect (line 265) | async def connect(self, options=None): method add_listener (line 268) | def add_listener(self, listener): method remove_listener (line 271) | def remove_listener(self, listener): method send_event (line 275) | async def send_event(self, event): method close (line 295) | async def close(self): function mock_agent (line 300) | def mock_agent(): function mock_model (line 310) | def mock_model(): function _set_default_timeout_fields (line 314) | def _set_default_timeout_fields(tool: Mock) -> Mock: function mock_function_tool (line 322) | def mock_function_tool(): function mock_handoff (line 331) | def mock_handoff(): class TestEventHandling (line 337) | class TestEventHandling: method test_error_event_transformation (line 341) | async def test_error_event_transformation(self, mock_model, mock_agent): method test_audio_events_transformation (line 365) | async def test_audio_events_transformation(self, mock_model, mock_agent): method test_turn_events_transformation (line 405) | async def test_turn_events_transformation(self, mock_model, mock_agent): method test_transcription_completed_event_updates_history (line 435) | async def test_transcription_completed_event_updates_history(self, moc... method test_item_updated_event_adds_new_item (line 469) | async def test_item_updated_event_adds_new_item(self, mock_model, mock... method test_item_updated_event_updates_existing_item (line 499) | async def test_item_updated_event_updates_existing_item(self, mock_mod... method test_item_deleted_event_removes_item (line 536) | async def test_item_deleted_event_removes_item(self, mock_model, mock_... method test_ignored_events_only_generate_raw_events (line 567) | async def test_ignored_events_only_generate_raw_events(self, mock_mode... method test_function_call_event_triggers_tool_handling (line 594) | async def test_function_call_event_triggers_tool_handling(self, mock_m... method test_function_call_event_runs_async_by_default (line 628) | async def test_function_call_event_runs_async_by_default(self, mock_mo... class TestHistoryManagement (line 658) | class TestHistoryManagement: method test_merge_transcript_into_existing_audio_message (line 662) | def test_merge_transcript_into_existing_audio_message(self): method test_merge_transcript_preserves_other_items (line 700) | def test_merge_transcript_preserves_other_items(self): method test_merge_transcript_only_affects_matching_audio_content (line 736) | def test_merge_transcript_only_affects_matching_audio_content(self): method test_update_existing_item_by_id (line 771) | def test_update_existing_item_by_id(self): method test_update_existing_item_preserves_order (line 796) | def test_update_existing_item_preserves_order(self): method test_insert_new_item_after_previous_item (line 835) | def test_insert_new_item_after_previous_item(self): method test_insert_new_item_after_nonexistent_previous_item (line 870) | def test_insert_new_item_after_nonexistent_previous_item(self): method test_add_new_item_to_end_when_no_previous_item_id (line 895) | def test_add_new_item_to_end_when_no_previous_item_id(self): method test_add_first_item_to_empty_history (line 917) | def test_add_first_item_to_empty_history(self): method test_complex_insertion_scenario (line 930) | def test_complex_insertion_scenario(self): class TestToolCallExecution (line 975) | class TestToolCallExecution: method test_function_tool_execution_success (line 979) | async def test_function_tool_execution_success( method test_function_tool_timeout_returns_result_message (line 1032) | async def test_function_tool_timeout_returns_result_message(self, mock... method test_function_tool_with_multiple_tools_available (line 1062) | async def test_function_tool_with_multiple_tools_available(self, mock_... method test_handoff_tool_handling (line 1099) | async def test_handoff_tool_handling(self, mock_model): method test_unknown_tool_handling (line 1133) | async def test_unknown_tool_handling(self, mock_model, mock_agent, moc... method test_function_tool_needs_approval_emits_event (line 1159) | async def test_function_tool_needs_approval_emits_event( method test_approve_pending_tool_call_runs_tool (line 1183) | async def test_approve_pending_tool_call_runs_tool( method test_reject_pending_tool_call_sends_rejection_output (line 1216) | async def test_reject_pending_tool_call_sends_rejection_output( method test_reject_pending_tool_call_uses_run_level_formatter (line 1248) | async def test_reject_pending_tool_call_uses_run_level_formatter( method test_reject_pending_tool_call_prefers_explicit_message (line 1288) | async def test_reject_pending_tool_call_prefers_explicit_message( method test_function_tool_exception_handling (line 1330) | async def test_function_tool_exception_handling( method test_tool_call_with_complex_arguments (line 1358) | async def test_tool_call_with_complex_arguments( method test_tool_call_with_custom_call_id (line 1390) | async def test_tool_call_with_custom_call_id(self, mock_model, mock_ag... method test_tool_result_conversion_to_string (line 1412) | async def test_tool_result_conversion_to_string(self, mock_model, mock... method test_tool_result_conversion_serializes_pydantic_models (line 1436) | async def test_tool_result_conversion_serializes_pydantic_models(self,... method test_serialize_tool_output_ignores_non_pydantic_model_dump_objects (line 1461) | def test_serialize_tool_output_ignores_non_pydantic_model_dump_objects... method test_serialize_tool_output_falls_back_when_pydantic_json_dump_fails (line 1471) | def test_serialize_tool_output_falls_back_when_pydantic_json_dump_fail... method test_serialize_tool_output_returns_string_when_pydantic_dump_fails (line 1486) | def test_serialize_tool_output_returns_string_when_pydantic_dump_fails... method test_serialize_tool_output_returns_string_when_dataclass_asdict_fails (line 1498) | def test_serialize_tool_output_returns_string_when_dataclass_asdict_fa... method test_mixed_tool_types_filtering (line 1509) | async def test_mixed_tool_types_filtering(self, mock_model, mock_agent): class TestGuardrailFunctionality (line 1553) | class TestGuardrailFunctionality: method _wait_for_guardrail_tasks (line 1556) | async def _wait_for_guardrail_tasks(self, session): method triggered_guardrail (line 1564) | def triggered_guardrail(self): method safe_guardrail (line 1575) | def safe_guardrail(self): method test_transcript_delta_triggers_guardrail_at_threshold (line 1586) | async def test_transcript_delta_triggers_guardrail_at_threshold( method test_agent_and_run_config_guardrails_not_run_twice (line 1622) | async def test_agent_and_run_config_guardrails_not_run_twice(self, moc... method test_transcript_delta_multiple_thresholds_same_item (line 1653) | async def test_transcript_delta_multiple_thresholds_same_item( method test_transcript_delta_different_items_tracked_separately (line 1682) | async def test_transcript_delta_different_items_tracked_separately( method test_turn_ended_clears_guardrail_state (line 1723) | async def test_turn_ended_clears_guardrail_state( method test_multiple_guardrails_all_triggered (line 1754) | async def test_multiple_guardrails_all_triggered(self, mock_model, moc... method test_agent_output_guardrails_triggered (line 1798) | async def test_agent_output_guardrails_triggered(self, mock_model, tri... method test_concurrent_guardrail_tasks_interrupt_once_per_response (line 1827) | async def test_concurrent_guardrail_tasks_interrupt_once_per_response(... class TestModelSettingsIntegration (line 1884) | class TestModelSettingsIntegration: method test_session_gets_model_settings_from_agent_during_connection (line 1888) | async def test_session_gets_model_settings_from_agent_during_connectio... method test_model_config_overrides_model_settings_not_agent (line 1918) | async def test_model_config_overrides_model_settings_not_agent(self): method test_handoffs_are_included_in_model_settings (line 1956) | async def test_handoffs_are_included_in_model_settings(self): class TestModelSettingsPrecedence (line 1999) | class TestModelSettingsPrecedence: method test_model_settings_precedence_order (line 2003) | async def test_model_settings_precedence_order(self): method test_model_settings_with_run_config_only (line 2073) | async def test_model_settings_with_run_config_only(self): method test_model_settings_with_model_config_only (line 2119) | async def test_model_settings_with_model_config_only(self): method test_model_settings_preserve_initial_settings_on_updates (line 2164) | async def test_model_settings_preserve_initial_settings_on_updates(self): class TestUpdateAgentFunctionality (line 2205) | class TestUpdateAgentFunctionality: method test_update_agent_creates_handoff_and_session_update_event (line 2209) | async def test_update_agent_creates_handoff_and_session_update_event(s... class TestTranscriptPreservation (line 2226) | class TestTranscriptPreservation: method test_assistant_transcript_preserved_on_item_update (line 2230) | async def test_assistant_transcript_preserved_on_item_update(self, moc... method test_assistant_transcript_can_fallback_to_deltas (line 2257) | async def test_assistant_transcript_can_fallback_to_deltas(self, mock_... FILE: tests/realtime/test_session_payload_and_formats.py class _DummyModel (line 23) | class _DummyModel(pydantic.BaseModel): function _session_with_output (line 27) | def _session_with_output(fmt: Any | None) -> RealtimeSessionCreateRequest: function test_normalize_session_payload_variants (line 38) | def test_normalize_session_payload_variants() -> None: function test_extract_audio_format_from_session_objects (line 62) | def test_extract_audio_format_from_session_objects() -> None: function test_normalize_audio_format_fallbacks (line 78) | def test_normalize_audio_format_fallbacks() -> None: FILE: tests/realtime/test_tracing.py class TestRealtimeTracingIntegration (line 16) | class TestRealtimeTracingIntegration: method model (line 20) | def model(self): method mock_websocket (line 25) | def mock_websocket(self): method test_tracing_config_storage_and_defaults (line 33) | async def test_tracing_config_storage_and_defaults(self, model, mock_w... method test_send_tracing_config_on_session_created (line 80) | async def test_send_tracing_config_on_session_created(self, model, moc... method test_send_tracing_config_auto_mode (line 128) | async def test_send_tracing_config_auto_mode(self, model, mock_websock... method test_tracing_config_none_skips_session_update (line 169) | async def test_tracing_config_none_skips_session_update(self, model, m... method test_tracing_config_with_metadata_serialization (line 187) | async def test_tracing_config_with_metadata_serialization(self, model,... method test_tracing_disabled_prevents_tracing (line 241) | async def test_tracing_disabled_prevents_tracing(self, mock_websocket): FILE: tests/realtime/test_twilio_sip_server.py function twilio_server (line 16) | def twilio_server(monkeypatch: pytest.MonkeyPatch) -> ModuleType: function test_track_call_task_ignores_duplicate_webhooks (line 26) | async def test_track_call_task_ignores_duplicate_webhooks( function test_track_call_task_restarts_after_completion (line 52) | async def test_track_call_task_restarts_after_completion( FILE: tests/test_agent_as_tool.py class BoolCtx (line 53) | class BoolCtx(BaseModel): function test_agent_as_tool_is_enabled_bool (line 58) | async def test_agent_as_tool_is_enabled_bool(): function test_agent_as_tool_is_enabled_callable (line 106) | async def test_agent_as_tool_is_enabled_callable(): function test_agent_as_tool_is_enabled_mixed (line 154) | async def test_agent_as_tool_is_enabled_mixed(): function test_agent_as_tool_is_enabled_preserves_other_params (line 217) | async def test_agent_as_tool_is_enabled_preserves_other_params(): function test_agent_as_tool_returns_final_output (line 257) | async def test_agent_as_tool_returns_final_output(monkeypatch: pytest.Mo... function test_agent_as_tool_custom_output_extractor (line 306) | async def test_agent_as_tool_custom_output_extractor(monkeypatch: pytest... function test_agent_as_tool_extractor_can_access_agent_tool_invocation (line 411) | async def test_agent_as_tool_extractor_can_access_agent_tool_invocation( function test_agent_as_tool_inherits_parent_run_config_when_not_set (line 482) | async def test_agent_as_tool_inherits_parent_run_config_when_not_set( function test_agent_as_tool_explicit_run_config_overrides_parent_context (line 532) | async def test_agent_as_tool_explicit_run_config_overrides_parent_context( function test_agent_as_tool_inherits_trace_include_sensitive_data_setting (line 584) | async def test_agent_as_tool_inherits_trace_include_sensitive_data_setting( function test_agent_as_tool_structured_input_sets_tool_input (line 634) | async def test_agent_as_tool_structured_input_sets_tool_input( function test_agent_as_tool_clears_stale_tool_input_for_plain_tools (line 701) | async def test_agent_as_tool_clears_stale_tool_input_for_plain_tools( function test_agent_as_tool_includes_schema_summary_with_descriptions (line 753) | async def test_agent_as_tool_includes_schema_summary_with_descriptions( function test_agent_as_tool_supports_custom_input_builder (line 815) | async def test_agent_as_tool_supports_custom_input_builder( function test_agent_as_tool_rejects_invalid_builder_output (line 877) | async def test_agent_as_tool_rejects_invalid_builder_output() -> None: function test_agent_as_tool_includes_json_schema_when_requested (line 903) | async def test_agent_as_tool_includes_json_schema_when_requested( function test_agent_as_tool_ignores_input_schema_without_parameters (line 963) | async def test_agent_as_tool_ignores_input_schema_without_parameters( function test_agent_as_tool_rejected_nested_approval_resumes_run (line 1013) | async def test_agent_as_tool_rejected_nested_approval_resumes_run( function test_agent_as_tool_namespaced_nested_always_approve_stays_permanent (line 1094) | async def test_agent_as_tool_namespaced_nested_always_approve_stays_perm... function test_agent_as_tool_deferred_same_name_legacy_nested_always_approve_stays_permanent (line 1180) | async def test_agent_as_tool_deferred_same_name_legacy_nested_always_app... function test_agent_as_tool_preserves_scope_for_nested_tool_context (line 1300) | async def test_agent_as_tool_preserves_scope_for_nested_tool_context( function test_agent_as_tool_preserves_namespace_for_nested_tool_context (line 1336) | async def test_agent_as_tool_preserves_namespace_for_nested_tool_context( function test_agent_as_tool_preserves_scope_for_nested_run_context_wrapper (line 1383) | async def test_agent_as_tool_preserves_scope_for_nested_run_context_wrap... function test_agent_as_tool_streams_events_with_on_stream (line 1421) | async def test_agent_as_tool_streams_events_with_on_stream( function test_agent_as_tool_streaming_updates_agent_on_handoff (line 1513) | async def test_agent_as_tool_streaming_updates_agent_on_handoff( function test_agent_as_tool_streaming_works_with_custom_extractor (line 1591) | async def test_agent_as_tool_streaming_works_with_custom_extractor( function test_agent_as_tool_streaming_settles_multi_segment_text_output (line 1683) | async def test_agent_as_tool_streaming_settles_multi_segment_text_output... function test_agent_as_tool_streaming_settles_multi_segment_structured_output (line 1743) | async def test_agent_as_tool_streaming_settles_multi_segment_structured_... function test_agent_as_tool_streaming_settles_final_text_after_nested_mcp_failure (line 1822) | async def test_agent_as_tool_streaming_settles_final_text_after_nested_m... function test_agent_as_tool_streaming_reraises_parent_cancellation_without_waiting_for_handler (line 1920) | async def test_agent_as_tool_streaming_reraises_parent_cancellation_with... function test_agent_as_tool_streaming_extractor_can_access_agent_tool_invocation (line 2015) | async def test_agent_as_tool_streaming_extractor_can_access_agent_tool_i... function test_agent_as_tool_streaming_accepts_sync_handler (line 2094) | async def test_agent_as_tool_streaming_accepts_sync_handler( function test_agent_as_tool_streaming_dispatches_without_blocking (line 2149) | async def test_agent_as_tool_streaming_dispatches_without_blocking( function test_agent_as_tool_streaming_handler_exception_does_not_fail_call (line 2229) | async def test_agent_as_tool_streaming_handler_exception_does_not_fail_c... function test_agent_as_tool_without_stream_uses_run (line 2281) | async def test_agent_as_tool_without_stream_uses_run( function test_agent_as_tool_streaming_sets_tool_call_from_context (line 2334) | async def test_agent_as_tool_streaming_sets_tool_call_from_context( function test_agent_as_tool_failure_error_function_none_reraises (line 2389) | async def test_agent_as_tool_failure_error_function_none_reraises( function test_agent_as_tool_failure_error_function_custom_handler (line 2435) | async def test_agent_as_tool_failure_error_function_custom_handler( function test_replaced_agent_as_tool_normal_failure_uses_replaced_policy (line 2484) | async def test_replaced_agent_as_tool_normal_failure_uses_replaced_policy( function test_replaced_agent_as_tool_invalid_input_uses_replaced_name (line 2530) | async def test_replaced_agent_as_tool_invalid_input_uses_replaced_name()... function test_replaced_agent_as_tool_preserves_agent_markers_for_build_agent_map (line 2557) | def test_replaced_agent_as_tool_preserves_agent_markers_for_build_agent_... FILE: tests/test_agent_clone_shallow_copy.py function greet (line 5) | def greet(name: str) -> str: function test_agent_clone_shallow_copy (line 9) | def test_agent_clone_shallow_copy(): FILE: tests/test_agent_config.py function test_system_instructions (line 11) | async def test_system_instructions(): function test_handoff_with_agents (line 34) | async def test_handoff_with_agents(): function test_handoff_with_handoff_obj (line 62) | async def test_handoff_with_handoff_obj(): function test_handoff_with_handoff_obj_and_agent (line 103) | async def test_handoff_with_handoff_obj_and_agent(): function test_agent_cloning (line 137) | async def test_agent_cloning(): class Foo (line 154) | class Foo(BaseModel): function test_agent_final_output (line 159) | async def test_agent_final_output(): class TestAgentValidation (line 174) | class TestAgentValidation: method test_name_validation_critical_cases (line 177) | def test_name_validation_critical_cases(self): method test_tool_use_behavior_dict_validation (line 186) | def test_tool_use_behavior_dict_validation(self): method test_hooks_validation_type_compatibility (line 195) | def test_hooks_validation_type_compatibility(self): method test_list_field_validation (line 208) | def test_list_field_validation(self): method test_model_settings_validation (line 217) | def test_model_settings_validation(self): FILE: tests/test_agent_hooks.py class AgentHooksForTests (line 26) | class AgentHooksForTests(AgentHooks): method __init__ (line 27) | def __init__(self): method reset (line 30) | def reset(self): method on_start (line 33) | async def on_start(self, context: AgentHookContext[TContext], agent: A... method on_end (line 36) | async def on_end( method on_handoff (line 44) | async def on_handoff( method on_tool_start (line 52) | async def on_tool_start( method on_tool_end (line 60) | async def on_tool_end( function test_non_streamed_agent_hooks (line 71) | async def test_non_streamed_agent_hooks(): function test_streamed_agent_hooks (line 147) | async def test_streamed_agent_hooks(): class Foo (line 222) | class Foo(TypedDict): function test_structured_output_non_streamed_agent_hooks (line 227) | async def test_structured_output_non_streamed_agent_hooks(): function test_structured_output_streamed_agent_hooks (line 298) | async def test_structured_output_streamed_agent_hooks(): class EmptyAgentHooks (line 371) | class EmptyAgentHooks(AgentHooks): function test_base_agent_hooks_dont_crash (line 376) | async def test_base_agent_hooks_dont_crash(): class AgentHooksWithTurnInput (line 429) | class AgentHooksWithTurnInput(AgentHooks): method __init__ (line 432) | def __init__(self): method on_start (line 435) | async def on_start(self, context: AgentHookContext[TContext], agent: A... function test_agent_hooks_receives_turn_input_string (line 440) | async def test_agent_hooks_receives_turn_input_string(): function test_agent_hooks_receives_turn_input_list (line 457) | async def test_agent_hooks_receives_turn_input_list(): function test_agent_hooks_receives_turn_input_streamed (line 479) | async def test_agent_hooks_receives_turn_input_streamed(): FILE: tests/test_agent_instructions_signature.py class TestInstructionsSignatureValidation (line 8) | class TestInstructionsSignatureValidation: method mock_run_context (line 12) | def mock_run_context(self): method test_valid_async_signature_passes (line 17) | async def test_valid_async_signature_passes(self, mock_run_context): method test_valid_sync_signature_passes (line 28) | async def test_valid_sync_signature_passes(self, mock_run_context): method test_one_parameter_raises_error (line 39) | async def test_one_parameter_raises_error(self, mock_run_context): method test_three_parameters_raises_error (line 54) | async def test_three_parameters_raises_error(self, mock_run_context): method test_zero_parameters_raises_error (line 69) | async def test_zero_parameters_raises_error(self, mock_run_context): method test_function_with_args_kwargs_fails (line 84) | async def test_function_with_args_kwargs_fails(self, mock_run_context): method test_string_instructions_still_work (line 99) | async def test_string_instructions_still_work(self, mock_run_context): method test_none_instructions_return_none (line 106) | async def test_none_instructions_return_none(self, mock_run_context): method test_non_callable_instructions_raises_error (line 113) | async def test_non_callable_instructions_raises_error(self, mock_run_c... FILE: tests/test_agent_llm_hooks.py class AgentHooksForTests (line 20) | class AgentHooksForTests(AgentHooks): method __init__ (line 21) | def __init__(self): method reset (line 24) | def reset(self): method on_start (line 27) | async def on_start(self, context: AgentHookContext[TContext], agent: A... method on_end (line 30) | async def on_end( method on_handoff (line 35) | async def on_handoff( method on_tool_start (line 40) | async def on_tool_start( method on_tool_end (line 45) | async def on_tool_end( method on_llm_start (line 55) | async def on_llm_start( method on_llm_end (line 64) | async def on_llm_end( function test_async_agent_hooks_with_llm (line 75) | async def test_async_agent_hooks_with_llm(): function test_sync_agent_hook_with_llm (line 89) | def test_sync_agent_hook_with_llm(): function test_streamed_agent_hooks_with_llm (line 104) | async def test_streamed_agent_hooks_with_llm(): FILE: tests/test_agent_memory_leak.py function _make_message (line 13) | def _make_message(text: str) -> ResponseOutputMessage: function test_agent_is_released_after_run (line 24) | async def test_agent_is_released_after_run() -> None: FILE: tests/test_agent_prompt.py class PromptCaptureFakeModel (line 14) | class PromptCaptureFakeModel(FakeModel): method __init__ (line 17) | def __init__(self): method get_response (line 21) | async def get_response( function test_static_prompt_is_resolved_correctly (line 52) | async def test_static_prompt_is_resolved_correctly(): function test_dynamic_prompt_is_resolved_correctly (line 72) | async def test_dynamic_prompt_is_resolved_correctly(): function test_prompt_is_passed_to_model (line 87) | async def test_prompt_is_passed_to_model(): class _SingleModelProvider (line 107) | class _SingleModelProvider(ModelProvider): method __init__ (line 108) | def __init__(self, model: Model): method get_model (line 111) | def get_model(self, model_name: str | None) -> Model: function test_agent_prompt_with_default_model_omits_model_and_tools_parameters (line 117) | async def test_agent_prompt_with_default_model_omits_model_and_tools_par... FILE: tests/test_agent_runner.py class _DummyRunItem (line 95) | class _DummyRunItem: method __init__ (line 96) | def __init__(self, payload: dict[str, Any], item_type: str = "tool_cal... method to_input_item (line 100) | def to_input_item(self) -> dict[str, Any]: function run_execute_approved_tools (line 104) | async def run_execute_approved_tools( function test_set_default_agent_runner_roundtrip (line 145) | def test_set_default_agent_runner_roundtrip(): function test_run_streamed_preserves_legacy_positional_previous_response_id (line 155) | def test_run_streamed_preserves_legacy_positional_previous_response_id(): function test_default_trace_include_sensitive_data_env (line 182) | def test_default_trace_include_sensitive_data_env(monkeypatch: pytest.Mo... function test_run_config_defaults_nested_handoff_history_opt_in (line 190) | def test_run_config_defaults_nested_handoff_history_opt_in(): function testdrop_orphan_function_calls_removes_orphans (line 194) | def testdrop_orphan_function_calls_removes_orphans(): function test_normalize_resumed_input_drops_orphan_function_calls (line 276) | def test_normalize_resumed_input_drops_orphan_function_calls(): function test_normalize_resumed_input_drops_orphan_tool_search_calls (line 313) | def test_normalize_resumed_input_drops_orphan_tool_search_calls(): function test_normalize_resumed_input_preserves_hosted_tool_search_pair_without_call_ids (line 358) | def test_normalize_resumed_input_preserves_hosted_tool_search_pair_witho... function test_normalize_resumed_input_matches_latest_anonymous_tool_search_call (line 390) | def test_normalize_resumed_input_matches_latest_anonymous_tool_search_ca... function testnormalize_input_items_for_api_preserves_provider_data (line 433) | def testnormalize_input_items_for_api_preserves_provider_data(): function test_fingerprint_input_item_returns_none_when_model_dump_fails (line 467) | def test_fingerprint_input_item_returns_none_when_model_dump_fails(): function test_server_conversation_tracker_tracks_previous_response_id (line 475) | def test_server_conversation_tracker_tracks_previous_response_id(): function _as_message (line 488) | def _as_message(item: Any) -> dict[str, Any]: function _find_reasoning_input_item (line 496) | def _find_reasoning_input_item( function test_simple_first_run (line 508) | async def test_simple_first_run(): function test_subsequent_runs (line 538) | async def test_subsequent_runs(): function test_tool_call_runs (line 564) | async def test_tool_call_runs(): function test_parallel_tool_call_with_cancelled_sibling_reaches_final_output (line 596) | async def test_parallel_tool_call_with_cancelled_sibling_reaches_final_o... function test_reasoning_item_id_policy_omits_follow_up_reasoning_ids (line 645) | async def test_reasoning_item_id_policy_omits_follow_up_reasoning_ids() ... function test_call_model_input_filter_can_reintroduce_reasoning_ids (line 684) | async def test_call_model_input_filter_can_reintroduce_reasoning_ids() -... function test_resumed_run_uses_serialized_reasoning_item_id_policy (line 736) | async def test_resumed_run_uses_serialized_reasoning_item_id_policy() ->... function test_tool_call_context_includes_current_agent (line 787) | async def test_tool_call_context_includes_current_agent() -> None: function test_handoffs (line 817) | async def test_handoffs(): function test_nested_handoff_filters_model_input_but_preserves_session_items (line 857) | async def test_nested_handoff_filters_model_input_but_preserves_session_... function test_nested_handoff_filters_reasoning_items_from_model_input (line 922) | async def test_nested_handoff_filters_reasoning_items_from_model_input(): function test_resume_preserves_filtered_model_input_after_handoff (line 976) | async def test_resume_preserves_filtered_model_input_after_handoff(): function test_resumed_state_updates_agent_after_handoff (line 1052) | async def test_resumed_state_updates_agent_after_handoff() -> None: class Foo (line 1097) | class Foo(TypedDict): function test_structured_output (line 1102) | async def test_structured_output(): function remove_new_items (line 1158) | def remove_new_items(handoff_input_data: HandoffInputData) -> HandoffInp... function test_handoff_filters (line 1168) | async def test_handoff_filters(): function test_opt_in_handoff_history_nested_and_filters_respected (line 1202) | async def test_opt_in_handoff_history_nested_and_filters_respected(): function test_opt_in_handoff_history_accumulates_across_multiple_handoffs (line 1267) | async def test_opt_in_handoff_history_accumulates_across_multiple_handof... function test_async_input_filter_supported (line 1305) | async def test_async_input_filter_supported(): function test_invalid_input_filter_fails (line 1347) | async def test_invalid_input_filter_fails(): function test_non_callable_input_filter_causes_error (line 1388) | async def test_non_callable_input_filter_causes_error(): function test_handoff_on_input (line 1426) | async def test_handoff_on_input(): function test_async_handoff_on_input (line 1470) | async def test_async_handoff_on_input(): function test_wrong_params_on_input_causes_error (line 1514) | async def test_wrong_params_on_input_causes_error(): function test_invalid_handoff_input_json_causes_error (line 1543) | async def test_invalid_handoff_input_json_causes_error(): function test_input_guardrail_tripwire_triggered_causes_exception (line 1559) | async def test_input_guardrail_tripwire_triggered_causes_exception(): function test_input_guardrail_tripwire_does_not_save_assistant_message_to_session (line 1579) | async def test_input_guardrail_tripwire_does_not_save_assistant_message_... function test_prepare_input_with_session_keeps_function_call_outputs (line 1613) | async def test_prepare_input_with_session_keeps_function_call_outputs(): function test_prepare_input_with_session_prefers_latest_function_call_output (line 1637) | async def test_prepare_input_with_session_prefers_latest_function_call_o... function test_prepare_input_with_session_drops_orphan_function_calls (line 1673) | async def test_prepare_input_with_session_drops_orphan_function_calls(): function test_prepare_input_with_session_preserves_pending_new_shell_calls (line 1702) | async def test_prepare_input_with_session_preserves_pending_new_shell_ca... function test_ensure_api_input_item_handles_model_dump_objects (line 1740) | def test_ensure_api_input_item_handles_model_dump_objects(): function test_ensure_api_input_item_avoids_pydantic_serialization_warnings (line 1755) | def test_ensure_api_input_item_avoids_pydantic_serialization_warnings(): function test_ensure_api_input_item_preserves_object_output (line 1778) | def test_ensure_api_input_item_preserves_object_output(): function test_prepare_input_with_session_uses_sync_callback (line 1795) | async def test_prepare_input_with_session_uses_sync_callback(): function test_prepare_input_with_session_awaits_async_callback (line 1817) | async def test_prepare_input_with_session_awaits_async_callback(): function test_prepare_input_with_session_callback_drops_new_items (line 1837) | async def test_prepare_input_with_session_callback_drops_new_items(): function test_prepare_input_with_session_callback_reorders_new_items (line 1853) | async def test_prepare_input_with_session_callback_reorders_new_items(): function test_prepare_input_with_session_callback_accepts_extra_items (line 1875) | async def test_prepare_input_with_session_callback_accepts_extra_items(): function test_prepare_input_with_session_ignores_callback_without_history (line 1899) | async def test_prepare_input_with_session_ignores_callback_without_histo... function test_prepare_input_with_session_rejects_non_callable_callback (line 1923) | async def test_prepare_input_with_session_rejects_non_callable_callback(): function test_prepare_input_with_session_rejects_non_list_callback_result (line 1931) | async def test_prepare_input_with_session_rejects_non_list_callback_resu... function test_prepare_input_with_session_matches_copied_items_by_content (line 1944) | async def test_prepare_input_with_session_matches_copied_items_by_conten... function test_persist_session_items_for_guardrail_trip_uses_original_input_when_missing (line 1966) | async def test_persist_session_items_for_guardrail_trip_uses_original_in... function test_wait_for_session_cleanup_retries_after_get_items_error (line 1989) | async def test_wait_for_session_cleanup_retries_after_get_items_error( function test_wait_for_session_cleanup_logs_when_targets_linger (line 2022) | async def test_wait_for_session_cleanup_logs_when_targets_linger( function test_conversation_lock_rewind_skips_when_no_snapshot (line 2045) | async def test_conversation_lock_rewind_skips_when_no_snapshot() -> None: function test_get_new_response_uses_agent_retry_settings (line 2089) | async def test_get_new_response_uses_agent_retry_settings() -> None: function test_save_result_to_session_preserves_function_outputs (line 2134) | async def test_save_result_to_session_preserves_function_outputs(): function test_save_result_to_session_prefers_latest_duplicate_function_outputs (line 2166) | async def test_save_result_to_session_prefers_latest_duplicate_function_... function test_rewind_handles_id_stripped_sessions (line 2202) | async def test_rewind_handles_id_stripped_sessions() -> None: function test_save_result_to_session_does_not_increment_counter_when_nothing_saved (line 2214) | async def test_save_result_to_session_does_not_increment_counter_when_no... function test_save_result_to_session_returns_count_and_updates_state (line 2241) | async def test_save_result_to_session_returns_count_and_updates_state() ... function test_save_result_to_session_counts_sanitized_openai_items (line 2274) | async def test_save_result_to_session_counts_sanitized_openai_items() ->... function test_save_result_to_session_omits_reasoning_ids_when_policy_is_omit (line 2328) | async def test_save_result_to_session_omits_reasoning_ids_when_policy_is... function test_session_persists_only_new_step_items (line 2359) | async def test_session_persists_only_new_step_items(monkeypatch: pytest.... function test_output_guardrail_tripwire_triggered_causes_exception (line 2442) | async def test_output_guardrail_tripwire_triggered_causes_exception(): function test_input_guardrail_no_tripwire_continues_execution (line 2464) | async def test_input_guardrail_no_tripwire_continues_execution(): function test_output_guardrail_no_tripwire_continues_execution (line 2490) | async def test_output_guardrail_no_tripwire_continues_execution(): function test_tool_one (line 2516) | def test_tool_one(): function test_tool_two (line 2521) | def test_tool_two(): function test_tool_use_behavior_first_output (line 2526) | async def test_tool_use_behavior_first_output(): function custom_tool_use_behavior (line 2554) | def custom_tool_use_behavior( function test_tool_use_behavior_custom_function (line 2564) | async def test_tool_use_behavior_custom_function(): function test_model_settings_override (line 2596) | async def test_model_settings_override(): function test_previous_response_id_passed_between_runs (line 2622) | async def test_previous_response_id_passed_between_runs(): function test_run_rejects_session_with_server_managed_conversation (line 2642) | async def test_run_rejects_session_with_server_managed_conversation(run_... function test_run_rejects_session_with_resumed_conversation_state (line 2653) | async def test_run_rejects_session_with_resumed_conversation_state(): function test_run_streamed_rejects_session_with_server_managed_conversation (line 2678) | async def test_run_streamed_rejects_session_with_server_managed_conversa... function test_run_streamed_rejects_session_with_resumed_conversation_state (line 2691) | async def test_run_streamed_rejects_session_with_resumed_conversation_st... function test_multi_turn_previous_response_id_passed_between_runs (line 2708) | async def test_multi_turn_previous_response_id_passed_between_runs(): function test_previous_response_id_passed_between_runs_streamed (line 2733) | async def test_previous_response_id_passed_between_runs_streamed(): function test_previous_response_id_passed_between_runs_streamed_multi_turn (line 2751) | async def test_previous_response_id_passed_between_runs_streamed_multi_t... function test_conversation_id_only_sends_new_items_multi_turn (line 2779) | async def test_conversation_id_only_sends_new_items_multi_turn(): function test_conversation_id_only_sends_new_items_multi_turn_streamed (line 2829) | async def test_conversation_id_only_sends_new_items_multi_turn_streamed(): function test_previous_response_id_only_sends_new_items_multi_turn (line 2882) | async def test_previous_response_id_only_sends_new_items_multi_turn(): function test_previous_response_id_retry_does_not_resend_initial_input_multi_turn (line 2936) | async def test_previous_response_id_retry_does_not_resend_initial_input_... function test_previous_response_id_only_sends_new_items_multi_turn_streamed (line 2979) | async def test_previous_response_id_only_sends_new_items_multi_turn_stre... function test_previous_response_id_retry_does_not_resend_initial_input_multi_turn_streamed (line 3036) | async def test_previous_response_id_retry_does_not_resend_initial_input_... function test_default_send_all_items (line 3082) | async def test_default_send_all_items(): function test_default_send_all_items_streamed (line 3141) | async def test_default_send_all_items_streamed(): function test_default_multi_turn_drops_orphan_hosted_shell_calls (line 3204) | async def test_default_multi_turn_drops_orphan_hosted_shell_calls() -> N... function test_manual_pending_shell_call_input_is_preserved_non_streamed (line 3233) | async def test_manual_pending_shell_call_input_is_preserved_non_streamed... function test_manual_pending_shell_call_input_is_preserved_non_streamed_with_session (line 3273) | async def test_manual_pending_shell_call_input_is_preserved_non_streamed... function test_default_multi_turn_streamed_drops_orphan_hosted_shell_calls (line 3314) | async def test_default_multi_turn_streamed_drops_orphan_hosted_shell_cal... function test_manual_pending_shell_call_input_is_preserved_streamed (line 3345) | async def test_manual_pending_shell_call_input_is_preserved_streamed() -... function test_manual_pending_shell_call_input_is_preserved_streamed_with_session (line 3370) | async def test_manual_pending_shell_call_input_is_preserved_streamed_wit... function test_auto_previous_response_id_multi_turn (line 3396) | async def test_auto_previous_response_id_multi_turn(): function test_auto_previous_response_id_multi_turn_streamed (line 3452) | async def test_auto_previous_response_id_multi_turn_streamed(): function test_without_previous_response_id_and_auto_previous_response_id_no_chaining (line 3511) | async def test_without_previous_response_id_and_auto_previous_response_i... function test_dynamic_tool_addition_run (line 3564) | async def test_dynamic_tool_addition_run() -> None: function test_session_add_items_called_multiple_times_for_multi_turn_completion (line 3599) | async def test_session_add_items_called_multiple_times_for_multi_turn_co... function test_execute_approved_tools_with_non_function_tool (line 3693) | async def test_execute_approved_tools_with_non_function_tool(): function test_execute_approved_tools_with_rejected_tool (line 3759) | async def test_execute_approved_tools_with_rejected_tool(): function test_execute_approved_tools_with_rejected_tool_uses_run_level_formatter (line 3789) | async def test_execute_approved_tools_with_rejected_tool_uses_run_level_... function test_execute_approved_tools_with_rejected_tool_prefers_explicit_message (line 3816) | async def test_execute_approved_tools_with_rejected_tool_prefers_explici... function test_execute_approved_tools_with_rejected_deferred_tool_uses_display_name (line 3846) | async def test_execute_approved_tools_with_rejected_deferred_tool_uses_d... function test_execute_approved_tools_with_rejected_tool_formatter_none_uses_default (line 3878) | async def test_execute_approved_tools_with_rejected_tool_formatter_none_... function test_execute_approved_tools_with_unclear_status (line 3903) | async def test_execute_approved_tools_with_unclear_status(): function test_execute_approved_tools_with_missing_tool (line 3933) | async def test_execute_approved_tools_with_missing_tool(): function test_execute_approved_tools_does_not_resolve_explicit_namespaced_tool_by_bare_name (line 3956) | async def test_execute_approved_tools_does_not_resolve_explicit_namespac... function test_execute_approved_tools_does_not_fallback_from_namespaced_approval_to_bare_tool (line 3998) | async def test_execute_approved_tools_does_not_fallback_from_namespaced_... function test_execute_approved_tools_prefers_visible_top_level_function_over_deferred_same_name_tool (line 4031) | async def test_execute_approved_tools_prefers_visible_top_level_function... function test_execute_approved_tools_uses_internal_lookup_key_for_deferred_top_level_calls (line 4070) | async def test_execute_approved_tools_uses_internal_lookup_key_for_defer... function test_deferred_collision_rejection_prefers_explicit_message (line 4118) | async def test_deferred_collision_rejection_prefers_explicit_message() -... function test_execute_approved_tools_uses_last_duplicate_top_level_function (line 4169) | async def test_execute_approved_tools_uses_last_duplicate_top_level_func... function test_execute_approved_tools_with_missing_call_id (line 4203) | async def test_execute_approved_tools_with_missing_call_id(): function test_execute_approved_tools_with_invalid_raw_item_type (line 4221) | async def test_execute_approved_tools_with_invalid_raw_item_type(): function test_execute_approved_tools_instance_method (line 4244) | async def test_execute_approved_tools_instance_method(): function test_execute_approved_tools_timeout_returns_error_as_result (line 4275) | async def test_execute_approved_tools_timeout_returns_error_as_result() ... function test_execute_approved_tools_timeout_can_raise_exception (line 4299) | async def test_execute_approved_tools_timeout_can_raise_exception() -> N... FILE: tests/test_agent_runner_streamed.py function _conversation_locked_error (line 65) | def _conversation_locked_error() -> BadRequestError: function _find_reasoning_input_item (line 81) | def _find_reasoning_input_item( function _ws_terminal_response_frame (line 92) | def _ws_terminal_response_frame(event_type: str, response_id: str, seque... function test_simple_first_run (line 104) | async def test_simple_first_run(): function test_streamed_run_accepts_terminal_response_payload_events (line 147) | async def test_streamed_run_accepts_terminal_response_payload_events( function test_streamed_run_exposes_request_id_on_raw_responses (line 199) | async def test_streamed_run_exposes_request_id_on_raw_responses() -> None: function test_streamed_run_preserves_request_usage_entries_after_retry (line 237) | async def test_streamed_run_preserves_request_usage_entries_after_retry(... function test_streamed_run_preserves_request_usage_entries_after_conversation_locked_retry (line 281) | async def test_streamed_run_preserves_request_usage_entries_after_conver... function test_streamed_run_accepts_terminal_response_payload_events_from_ws_model (line 326) | async def test_streamed_run_accepts_terminal_response_payload_events_fro... function test_subsequent_runs (line 384) | async def test_subsequent_runs(): function test_tool_call_runs (line 416) | async def test_tool_call_runs(): function test_streamed_parallel_tool_call_with_cancelled_sibling_reaches_final_output (line 450) | async def test_streamed_parallel_tool_call_with_cancelled_sibling_reache... function test_streamed_reasoning_item_id_policy_omits_follow_up_reasoning_ids (line 500) | async def test_streamed_reasoning_item_id_policy_omits_follow_up_reasoni... function test_streamed_run_again_persists_tool_items_to_session (line 541) | async def test_streamed_run_again_persists_tool_items_to_session(): function test_handoffs (line 577) | async def test_handoffs(): class Foo (line 618) | class Foo(TypedDict): function test_structured_output (line 623) | async def test_structured_output(): function remove_new_items (line 681) | def remove_new_items(handoff_input_data: HandoffInputData) -> HandoffInp... function test_handoff_filters (line 691) | async def test_handoff_filters(): function test_streamed_nested_handoff_filters_reasoning_items_from_model_input (line 727) | async def test_streamed_nested_handoff_filters_reasoning_items_from_mode... function test_async_input_filter_supported (line 782) | async def test_async_input_filter_supported(): function test_invalid_input_filter_fails (line 825) | async def test_invalid_input_filter_fails(): function test_non_callable_input_filter_causes_error (line 868) | async def test_non_callable_input_filter_causes_error(): function test_handoff_on_input (line 908) | async def test_handoff_on_input(): function test_async_handoff_on_input (line 954) | async def test_async_handoff_on_input(): function test_input_guardrail_tripwire_triggered_causes_exception_streamed (line 1000) | async def test_input_guardrail_tripwire_triggered_causes_exception_strea... function test_input_guardrail_streamed_does_not_save_assistant_message_to_session (line 1022) | async def test_input_guardrail_streamed_does_not_save_assistant_message_... function test_input_guardrail_streamed_persists_user_input_for_sequential_guardrail (line 1054) | async def test_input_guardrail_streamed_persists_user_input_for_sequenti... function test_input_guardrail_streamed_persists_user_input_for_async_sequential_guardrail (line 1087) | async def test_input_guardrail_streamed_persists_user_input_for_async_se... function test_stream_input_persistence_strips_ids_for_openai_conversation_session (line 1121) | async def test_stream_input_persistence_strips_ids_for_openai_conversati... function test_stream_input_persistence_saves_only_new_turn_input (line 1184) | async def test_stream_input_persistence_saves_only_new_turn_input(monkey... function test_slow_input_guardrail_still_raises_exception_streamed (line 1241) | async def test_slow_input_guardrail_still_raises_exception_streamed(): function test_output_guardrail_tripwire_triggered_causes_exception_streamed (line 1270) | async def test_output_guardrail_tripwire_triggered_causes_exception_stre... function test_run_input_guardrail_tripwire_triggered_causes_exception_streamed (line 1294) | async def test_run_input_guardrail_tripwire_triggered_causes_exception_s... function test_run_output_guardrail_tripwire_triggered_causes_exception_streamed (line 1321) | async def test_run_output_guardrail_tripwire_triggered_causes_exception_... function test_streaming_events (line 1350) | async def test_streaming_events(): function test_dynamic_tool_addition_run_streamed (line 1444) | async def test_dynamic_tool_addition_run_streamed() -> None: function test_stream_step_items_to_queue_handles_tool_approval_item (line 1480) | async def test_stream_step_items_to_queue_handles_tool_approval_item(): function test_streaming_hitl_resume_with_approved_tools (line 1497) | async def test_streaming_hitl_resume_with_approved_tools(): function test_streaming_resume_with_session_does_not_duplicate_items (line 1529) | async def test_streaming_resume_with_session_does_not_duplicate_items(): function test_streaming_resume_preserves_filtered_model_input_after_handoff (line 1577) | async def test_streaming_resume_preserves_filtered_model_input_after_han... function test_streaming_resume_persists_tool_outputs_on_run_again (line 1655) | async def test_streaming_resume_persists_tool_outputs_on_run_again(): function test_streaming_resume_carries_persisted_count (line 1691) | async def test_streaming_resume_carries_persisted_count(monkeypatch: pyt... function test_streaming_hitl_resume_enforces_max_turns (line 1751) | async def test_streaming_hitl_resume_enforces_max_turns(): function test_streaming_max_turns_emits_pending_tool_output_events (line 1780) | async def test_streaming_max_turns_emits_pending_tool_output_events() ->... function test_streaming_non_max_turns_exception_does_not_emit_queued_events (line 1806) | async def test_streaming_non_max_turns_exception_does_not_emit_queued_ev... function test_streaming_hitl_server_conversation_tracker_priming (line 1830) | async def test_streaming_hitl_server_conversation_tracker_priming(): FILE: tests/test_agent_runner_sync.py function fresh_event_loop_policy (line 12) | def fresh_event_loop_policy() -> Generator[asyncio.AbstractEventLoopPoli... function test_run_sync_reuses_existing_default_loop (line 22) | def test_run_sync_reuses_existing_default_loop(monkeypatch, fresh_event_... function test_run_sync_creates_default_loop_when_missing (line 43) | def test_run_sync_creates_default_loop_when_missing(monkeypatch, fresh_e... function test_run_sync_errors_when_loop_already_running (line 63) | def test_run_sync_errors_when_loop_already_running(monkeypatch, fresh_ev... function test_run_sync_cancels_task_when_interrupted (line 78) | def test_run_sync_cancels_task_when_interrupted(monkeypatch, fresh_event... function test_run_sync_finalizes_async_generators (line 123) | def test_run_sync_finalizes_async_generators(monkeypatch, fresh_event_lo... FILE: tests/test_agent_tool_input.py function test_agent_as_tool_input_schema_accepts_string (line 22) | async def test_agent_as_tool_input_schema_accepts_string() -> None: function test_resolve_agent_tool_input_returns_string_input (line 29) | async def test_resolve_agent_tool_input_returns_string_input() -> None: function test_resolve_agent_tool_input_falls_back_to_json (line 35) | async def test_resolve_agent_tool_input_falls_back_to_json() -> None: function test_resolve_agent_tool_input_preserves_input_with_extra_fields (line 41) | async def test_resolve_agent_tool_input_preserves_input_with_extra_field... function test_resolve_agent_tool_input_uses_default_builder_when_schema_info_exists (line 47) | async def test_resolve_agent_tool_input_uses_default_builder_when_schema... function test_resolve_agent_tool_input_returns_builder_items (line 58) | async def test_resolve_agent_tool_input_returns_builder_items() -> None: function test_build_structured_input_schema_info_handles_empty_schema (line 68) | def test_build_structured_input_schema_info_handles_empty_schema() -> None: function test_build_structured_input_schema_info_generates_summary_for_simple_fields (line 74) | def test_build_structured_input_schema_info_generates_summary_for_simple... function test_schema_summary_returns_none_for_unsupported_shapes (line 98) | def test_schema_summary_returns_none_for_unsupported_shapes() -> None: function test_private_schema_helper_edge_cases (line 117) | def test_private_schema_helper_edge_cases() -> None: FILE: tests/test_agent_tool_state.py function reset_tool_state_globals (line 17) | def reset_tool_state_globals(monkeypatch: pytest.MonkeyPatch) -> None: function test_drop_agent_tool_run_result_handles_cleared_globals (line 24) | def test_drop_agent_tool_run_result_handles_cleared_globals( function test_agent_tool_state_scope_helpers_tolerate_missing_or_readonly_contexts (line 35) | def test_agent_tool_state_scope_helpers_tolerate_missing_or_readonly_con... function _function_tool_call (line 50) | def _function_tool_call(name: str, arguments: str, *, call_id: str) -> R... function test_agent_tool_run_result_supports_signature_fallback_across_instances (line 56) | def test_agent_tool_run_result_supports_signature_fallback_across_instan... function test_agent_tool_run_result_returns_none_for_ambiguous_signature_matches (line 69) | def test_agent_tool_run_result_returns_none_for_ambiguous_signature_matc... function test_agent_tool_run_result_is_dropped_when_tool_call_is_collected (line 89) | def test_agent_tool_run_result_is_dropped_when_tool_call_is_collected() ... FILE: tests/test_agent_tracing.py function _make_approval_agent (line 22) | def _make_approval_agent(model: FakeModel) -> Agent[None]: function test_single_run_is_single_trace (line 31) | async def test_single_run_is_single_trace(): function test_multiple_runs_are_multiple_traces (line 62) | async def test_multiple_runs_are_multiple_traces(): function test_resumed_run_reuses_original_trace_without_duplicate_trace_start (line 113) | async def test_resumed_run_reuses_original_trace_without_duplicate_trace... function test_resumed_run_from_serialized_state_reuses_original_trace (line 140) | async def test_resumed_run_from_serialized_state_reuses_original_trace(): function test_resumed_run_from_serialized_state_preserves_explicit_trace_key (line 169) | async def test_resumed_run_from_serialized_state_preserves_explicit_trac... function test_resumed_run_with_workflow_override_starts_new_trace (line 208) | async def test_resumed_run_with_workflow_override_starts_new_trace() -> ... function test_wrapped_trace_is_single_trace (line 249) | async def test_wrapped_trace_is_single_trace(): function test_parent_disabled_trace_disabled_agent_trace (line 307) | async def test_parent_disabled_trace_disabled_agent_trace(): function test_manual_disabling_works (line 322) | async def test_manual_disabling_works(): function test_trace_config_works (line 336) | async def test_trace_config_works(): function test_not_starting_streaming_creates_trace (line 373) | async def test_not_starting_streaming_creates_trace(): function test_streaming_single_run_is_single_trace (line 414) | async def test_streaming_single_run_is_single_trace(): function test_multiple_streamed_runs_are_multiple_traces (line 447) | async def test_multiple_streamed_runs_are_multiple_traces(): function test_resumed_streaming_run_reuses_original_trace_without_duplicate_trace_start (line 503) | async def test_resumed_streaming_run_reuses_original_trace_without_dupli... function test_wrapped_streaming_trace_is_single_trace (line 534) | async def test_wrapped_streaming_trace_is_single_trace(): function test_wrapped_mixed_trace_is_single_trace (line 600) | async def test_wrapped_mixed_trace_is_single_trace(): function test_parent_disabled_trace_disables_streaming_agent_trace (line 664) | async def test_parent_disabled_trace_disables_streaming_agent_trace(): function test_manual_streaming_disabling_works (line 686) | async def test_manual_streaming_disabling_works(): FILE: tests/test_agents_logging.py function test_enable_verbose_stdout_logging_attaches_handler (line 8) | def test_enable_verbose_stdout_logging_attaches_handler() -> None: FILE: tests/test_anthropic_thinking_blocks.py function create_mock_anthropic_response_with_thinking (line 22) | def create_mock_anthropic_response_with_thinking() -> InternalChatComple... function test_converter_skips_reasoning_items (line 39) | def test_converter_skips_reasoning_items(): function test_reasoning_items_preserved_in_message_conversion (line 76) | def test_reasoning_items_preserved_in_message_conversion(): function test_anthropic_thinking_blocks_with_tool_calls (line 107) | def test_anthropic_thinking_blocks_with_tool_calls(): function test_items_to_messages_preserves_positional_bool_arguments (line 251) | def test_items_to_messages_preserves_positional_bool_arguments(): function test_anthropic_thinking_blocks_without_tool_calls (line 308) | def test_anthropic_thinking_blocks_without_tool_calls(): FILE: tests/test_apply_diff.py function test_apply_diff_with_floating_hunk_adds_lines (line 10) | def test_apply_diff_with_floating_hunk_adds_lines() -> None: function test_apply_diff_with_empty_input_and_crlf_diff_preserves_crlf (line 15) | def test_apply_diff_with_empty_input_and_crlf_diff_preserves_crlf() -> N... function test_apply_diff_create_mode_requires_plus_prefix (line 20) | def test_apply_diff_create_mode_requires_plus_prefix() -> None: function test_apply_diff_create_mode_preserves_trailing_newline (line 26) | def test_apply_diff_create_mode_preserves_trailing_newline() -> None: function test_apply_diff_applies_contextual_replacement (line 31) | def test_apply_diff_applies_contextual_replacement() -> None: function test_apply_diff_raises_on_context_mismatch (line 37) | def test_apply_diff_raises_on_context_mismatch() -> None: function test_apply_diff_with_crlf_input_and_lf_diff_preserves_crlf (line 44) | def test_apply_diff_with_crlf_input_and_lf_diff_preserves_crlf() -> None: function test_apply_diff_with_lf_input_and_crlf_diff_preserves_lf (line 50) | def test_apply_diff_with_lf_input_and_crlf_diff_preserves_lf() -> None: function test_apply_diff_with_crlf_input_and_crlf_diff_preserves_crlf (line 56) | def test_apply_diff_with_crlf_input_and_crlf_diff_preserves_crlf() -> None: function test_apply_diff_create_mode_preserves_crlf_newlines (line 62) | def test_apply_diff_create_mode_preserves_crlf_newlines() -> None: FILE: tests/test_apply_diff_helpers.py function test_normalize_diff_lines_drops_trailing_blank (line 20) | def test_normalize_diff_lines_drops_trailing_blank() -> None: function test_is_done_true_when_index_out_of_range (line 24) | def test_is_done_true_when_index_out_of_range() -> None: function test_read_str_returns_empty_when_missing_prefix (line 29) | def test_read_str_returns_empty_when_missing_prefix() -> None: function test_read_section_returns_eof_flag (line 35) | def test_read_section_returns_eof_flag() -> None: function test_read_section_raises_on_invalid_marker (line 40) | def test_read_section_raises_on_invalid_marker() -> None: function test_read_section_raises_when_empty_segment (line 45) | def test_read_section_raises_when_empty_segment() -> None: function test_find_context_eof_fallbacks (line 50) | def test_find_context_eof_fallbacks() -> None: function test_find_context_core_stripped_matches (line 56) | def test_find_context_core_stripped_matches() -> None: function test_apply_chunks_rejects_bad_chunks (line 62) | def test_apply_chunks_rejects_bad_chunks() -> None: FILE: tests/test_apply_patch_tool.py function _get_function_span (line 32) | def _get_function_span(tool_name: str) -> dict[str, Any]: function _call (line 45) | def _call(call_id: str, operation: dict[str, Any]) -> DummyApplyPatchCall: function build_apply_patch_call (line 49) | def build_apply_patch_call( class DummyApplyPatchCall (line 63) | class DummyApplyPatchCall: class RecordingEditor (line 69) | class RecordingEditor: method __init__ (line 70) | def __init__(self) -> None: method create_file (line 73) | def create_file(self, operation: ApplyPatchOperation) -> ApplyPatchRes... method update_file (line 77) | def update_file(self, operation: ApplyPatchOperation) -> ApplyPatchRes... method delete_file (line 81) | def delete_file(self, operation: ApplyPatchOperation) -> ApplyPatchRes... function test_apply_patch_tool_success (line 87) | async def test_apply_patch_tool_success() -> None: function test_apply_patch_tool_failure (line 120) | async def test_apply_patch_tool_failure() -> None: function test_apply_patch_tool_emits_function_span (line 151) | async def test_apply_patch_tool_emits_function_span() -> None: function test_apply_patch_tool_redacts_span_error_when_sensitive_data_disabled (line 176) | async def test_apply_patch_tool_redacts_span_error_when_sensitive_data_d... function test_apply_patch_tool_accepts_mapping_call (line 216) | async def test_apply_patch_tool_accepts_mapping_call() -> None: function test_apply_patch_tool_needs_approval_returns_approval_item (line 251) | async def test_apply_patch_tool_needs_approval_returns_approval_item() -... function test_apply_patch_tool_needs_approval_rejected_returns_rejection (line 274) | async def test_apply_patch_tool_needs_approval_rejected_returns_rejectio... function test_apply_patch_rejection_uses_run_level_formatter (line 304) | async def test_apply_patch_rejection_uses_run_level_formatter() -> None: function test_apply_patch_tool_on_approval_callback_auto_approves (line 336) | async def test_apply_patch_tool_on_approval_callback_auto_approves() -> ... function test_apply_patch_tool_on_approval_callback_auto_rejects (line 364) | async def test_apply_patch_tool_on_approval_callback_auto_rejects() -> N... FILE: tests/test_asyncio_progress.py function test_function_tool_task_progress_deadline_detects_timer_backed_sleep (line 12) | async def test_function_tool_task_progress_deadline_detects_timer_backed... function test_function_tool_task_progress_deadline_returns_none_for_external_wait (line 37) | async def test_function_tool_task_progress_deadline_returns_none_for_ext... function test_function_tool_task_progress_deadline_can_follow_tracked_invoke_task (line 61) | async def test_function_tool_task_progress_deadline_can_follow_tracked_i... function test_function_tool_task_progress_deadline_can_follow_awaited_child_task (line 95) | async def test_function_tool_task_progress_deadline_can_follow_awaited_c... function test_function_tool_task_progress_deadline_can_follow_shielded_child_task (line 121) | async def test_function_tool_task_progress_deadline_can_follow_shielded_... function test_function_tool_task_progress_deadline_can_follow_gathered_child_tasks (line 147) | async def test_function_tool_task_progress_deadline_can_follow_gathered_... function test_function_tool_task_progress_deadline_can_follow_timer_backed_future (line 172) | async def test_function_tool_task_progress_deadline_can_follow_timer_bac... FILE: tests/test_call_model_input_filter.py function test_call_model_input_filter_sync_non_streamed (line 15) | async def test_call_model_input_filter_sync_non_streamed() -> None: function test_call_model_input_filter_async_streamed (line 40) | async def test_call_model_input_filter_async_streamed() -> None: function test_call_model_input_filter_invalid_return_type_raises (line 67) | async def test_call_model_input_filter_invalid_return_type_raises() -> N... function test_call_model_input_filter_prefers_latest_duplicate_outputs_non_streamed (line 83) | async def test_call_model_input_filter_prefers_latest_duplicate_outputs_... function test_call_model_input_filter_prefers_latest_duplicate_outputs_streamed (line 127) | async def test_call_model_input_filter_prefers_latest_duplicate_outputs_... FILE: tests/test_call_model_input_filter_unit.py function test_call_model_input_filter_sync_non_streamed_unit (line 21) | async def test_call_model_input_filter_sync_non_streamed_unit() -> None: function test_call_model_input_filter_async_streamed_unit (line 59) | async def test_call_model_input_filter_async_streamed_unit() -> None: function test_call_model_input_filter_invalid_return_type_raises_unit (line 99) | async def test_call_model_input_filter_invalid_return_type_raises_unit()... FILE: tests/test_cancel_streaming.py class SlowCompleteFakeModel (line 15) | class SlowCompleteFakeModel(FakeModel): method __init__ (line 18) | def __init__(self, delay_seconds: float): method stream_response (line 22) | async def stream_response(self, *args, **kwargs): function test_simple_streaming_with_cancel (line 30) | async def test_simple_streaming_with_cancel(): function test_multiple_events_streaming_with_cancel (line 47) | async def test_multiple_events_streaming_with_cancel(): function test_cancel_prevents_further_events (line 80) | async def test_cancel_prevents_further_events(): function test_cancel_is_idempotent (line 96) | async def test_cancel_is_idempotent(): function test_cancel_before_streaming (line 111) | async def test_cancel_before_streaming(): function test_cancel_cleans_up_resources (line 121) | async def test_cancel_cleans_up_resources(): function test_cancel_immediate_mode_explicit (line 138) | async def test_cancel_immediate_mode_explicit(): function test_stream_events_respects_asyncio_timeout_cancellation (line 155) | async def test_stream_events_respects_asyncio_timeout_cancellation(): function test_cancel_immediate_unblocks_waiting_stream_consumer (line 182) | async def test_cancel_immediate_unblocks_waiting_stream_consumer(): FILE: tests/test_computer_action.py function _get_function_span (line 54) | def _get_function_span(tool_name: str) -> dict[str, Any]: function _get_agent_span (line 67) | def _get_agent_span(agent_name: str) -> dict[str, Any]: class LoggingComputer (line 80) | class LoggingComputer(Computer): method __init__ (line 83) | def __init__(self, screenshot_return: str = "screenshot"): method environment (line 88) | def environment(self): method dimensions (line 92) | def dimensions(self) -> tuple[int, int]: method screenshot (line 95) | def screenshot(self) -> str: method click (line 99) | def click(self, x: int, y: int, button: str) -> None: method double_click (line 102) | def double_click(self, x: int, y: int) -> None: method scroll (line 105) | def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: method type (line 108) | def type(self, text: str) -> None: method wait (line 111) | def wait(self) -> None: method move (line 114) | def move(self, x: int, y: int) -> None: method keypress (line 117) | def keypress(self, keys: list[str]) -> None: method drag (line 120) | def drag(self, path: list[tuple[int, int]]) -> None: class LoggingAsyncComputer (line 124) | class LoggingAsyncComputer(AsyncComputer): method __init__ (line 127) | def __init__(self, screenshot_return: str = "async_screenshot"): method environment (line 132) | def environment(self): method dimensions (line 136) | def dimensions(self) -> tuple[int, int]: method screenshot (line 139) | async def screenshot(self) -> str: method click (line 143) | async def click(self, x: int, y: int, button: str) -> None: method double_click (line 146) | async def double_click(self, x: int, y: int) -> None: method scroll (line 149) | async def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -... method type (line 152) | async def type(self, text: str) -> None: method wait (line 155) | async def wait(self) -> None: method move (line 158) | async def move(self, x: int, y: int) -> None: method keypress (line 161) | async def keypress(self, keys: list[str]) -> None: method drag (line 164) | async def drag(self, path: list[tuple[int, int]]) -> None: function test_get_screenshot_sync_executes_action_and_takes_screenshot (line 189) | async def test_get_screenshot_sync_executes_action_and_takes_screenshot( function test_get_screenshot_async_executes_action_and_takes_screenshot (line 232) | async def test_get_screenshot_async_executes_action_and_takes_screenshot( function test_get_screenshot_executes_batched_actions_in_order (line 257) | async def test_get_screenshot_executes_batched_actions_in_order() -> None: function test_get_screenshot_reuses_terminal_batched_screenshot (line 282) | async def test_get_screenshot_reuses_terminal_batched_screenshot() -> None: class LoggingRunHooks (line 299) | class LoggingRunHooks(RunHooks[Any]): method __init__ (line 302) | def __init__(self) -> None: method on_tool_start (line 307) | async def on_tool_start( method on_tool_end (line 312) | async def on_tool_end( class LoggingAgentHooks (line 318) | class LoggingAgentHooks(AgentHooks[Any]): method __init__ (line 321) | def __init__(self) -> None: method on_tool_start (line 326) | async def on_tool_start( method on_tool_end (line 331) | async def on_tool_end( function test_execute_invokes_hooks_and_returns_tool_call_output (line 338) | async def test_execute_invokes_hooks_and_returns_tool_call_output() -> N... function test_execute_emits_function_span (line 397) | async def test_execute_emits_function_span() -> None: function test_runner_trace_lists_ga_computer_tool_name (line 430) | async def test_runner_trace_lists_ga_computer_tool_name() -> None: function test_execute_emits_batched_actions_in_function_span (line 466) | async def test_execute_emits_batched_actions_in_function_span() -> None: function test_execute_redacts_span_error_when_sensitive_data_disabled (line 503) | async def test_execute_redacts_span_error_when_sensitive_data_disabled()... function test_pending_safety_check_acknowledged (line 549) | async def test_pending_safety_check_acknowledged() -> None: FILE: tests/test_computer_tool_lifecycle.py class FakeComputer (line 22) | class FakeComputer(Computer): method __init__ (line 23) | def __init__(self, label: str = "computer") -> None: method environment (line 27) | def environment(self) -> Environment: method dimensions (line 31) | def dimensions(self) -> tuple[int, int]: method screenshot (line 34) | def screenshot(self) -> str: method click (line 37) | def click(self, x: int, y: int, button: Button) -> None: method double_click (line 40) | def double_click(self, x: int, y: int) -> None: method scroll (line 43) | def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: method type (line 46) | def type(self, text: str) -> None: method wait (line 49) | def wait(self) -> None: method move (line 52) | def move(self, x: int, y: int) -> None: method keypress (line 55) | def keypress(self, keys: list[str]) -> None: method drag (line 58) | def drag(self, path: list[tuple[int, int]]) -> None: function _make_message (line 62) | def _make_message(text: str) -> ResponseOutputMessage: function test_fake_computer_implements_interface (line 72) | def test_fake_computer_implements_interface() -> None: function test_resolve_computer_per_run_context (line 87) | async def test_resolve_computer_per_run_context() -> None: function test_runner_disposes_computer_after_run (line 118) | async def test_runner_disposes_computer_after_run() -> None: function test_streamed_run_disposes_computer_after_completion (line 136) | async def test_streamed_run_disposes_computer_after_completion() -> None: FILE: tests/test_config.py function test_cc_no_default_key_errors (line 21) | def test_cc_no_default_key_errors(monkeypatch): function test_cc_set_default_openai_key (line 27) | def test_cc_set_default_openai_key(): function test_cc_set_default_openai_client (line 33) | def test_cc_set_default_openai_client(): function test_resp_no_default_key_errors (line 40) | def test_resp_no_default_key_errors(monkeypatch): function test_resp_set_default_openai_key (line 47) | def test_resp_set_default_openai_key(): function test_resp_set_default_openai_client (line 53) | def test_resp_set_default_openai_client(): function test_set_default_openai_api (line 60) | def test_set_default_openai_api(): function test_set_default_openai_responses_transport (line 76) | def test_set_default_openai_responses_transport(): function test_set_default_openai_responses_transport_rejects_invalid_value (line 94) | def test_set_default_openai_responses_transport_rejects_invalid_value(): function test_openai_provider_transport_override_beats_default (line 99) | def test_openai_provider_transport_override_beats_default(): function test_legacy_websocket_default_flag_syncs_transport_getter (line 113) | def test_legacy_websocket_default_flag_syncs_transport_getter(): function test_openai_provider_uses_base_urls_from_env (line 121) | def test_openai_provider_uses_base_urls_from_env(monkeypatch): function test_openai_provider_websocket_base_url_arg_overrides_env (line 141) | def test_openai_provider_websocket_base_url_arg_overrides_env(monkeypatch): function test_openai_provider_reuses_websocket_model_instance_for_same_model_name (line 163) | async def test_openai_provider_reuses_websocket_model_instance_for_same_... function test_openai_provider_does_not_reuse_non_websocket_model_instances (line 173) | def test_openai_provider_does_not_reuse_non_websocket_model_instances(): function test_openai_provider_does_not_reuse_websocket_model_without_running_loop (line 184) | def test_openai_provider_does_not_reuse_websocket_model_without_running_... function test_openai_provider_scopes_websocket_model_cache_to_running_loop (line 202) | def test_openai_provider_scopes_websocket_model_cache_to_running_loop(): function test_openai_provider_websocket_loop_cache_does_not_keep_closed_loop_alive (line 231) | def test_openai_provider_websocket_loop_cache_does_not_keep_closed_loop_... function test_openai_provider_prunes_closed_loop_cache_with_live_ws_connection (line 280) | def test_openai_provider_prunes_closed_loop_cache_with_live_ws_connectio... function test_openai_provider_aclose_closes_websocket_models_from_other_loops (line 354) | def test_openai_provider_aclose_closes_websocket_models_from_other_loops... function test_openai_provider_aclose_closes_websocket_models_when_original_loop_is_closed (line 400) | def test_openai_provider_aclose_closes_websocket_models_when_original_lo... function test_openai_provider_aclose_closes_cached_models (line 433) | async def test_openai_provider_aclose_closes_cached_models(monkeypatch): FILE: tests/test_debug.py function test_dont_log_model_data (line 8) | def test_dont_log_model_data(): function test_dont_log_model_data_0 (line 13) | def test_dont_log_model_data_0(): function test_dont_log_model_data_1 (line 18) | def test_dont_log_model_data_1(): function test_dont_log_model_data_true (line 23) | def test_dont_log_model_data_true(): function test_dont_log_model_data_false (line 28) | def test_dont_log_model_data_false(): function test_dont_log_tool_data (line 33) | def test_dont_log_tool_data(): function test_dont_log_tool_data_0 (line 38) | def test_dont_log_tool_data_0(): function test_dont_log_tool_data_1 (line 43) | def test_dont_log_tool_data_1(): function test_dont_log_tool_data_true (line 48) | def test_dont_log_tool_data_true(): function test_dont_log_tool_data_false (line 53) | def test_dont_log_tool_data_false(): FILE: tests/test_doc_parsing.py function func_foo_google (line 4) | def func_foo_google(a: int, b: float) -> str: function func_foo_numpy (line 19) | def func_foo_numpy(a: int, b: float) -> str: function func_foo_sphinx (line 38) | def func_foo_sphinx(a: int, b: float) -> str: class Bar (line 49) | class Bar: method func_bar (line 50) | def func_bar(self, a: int, b: float) -> str: method func_baz (line 64) | def func_baz(cls, a: int, b: float) -> str: function test_functions_are_ok (line 78) | def test_functions_are_ok(): function test_auto_detection (line 86) | def test_auto_detection() -> None: function test_instance_method (line 103) | def test_instance_method() -> None: function test_classmethod (line 111) | def test_classmethod() -> None: FILE: tests/test_example_workflows.py class EvaluationFeedback (line 43) | class EvaluationFeedback: class OutlineCheckerOutput (line 49) | class OutlineCheckerOutput: function test_llm_as_judge_loop_handles_dataclass_feedback (line 55) | async def test_llm_as_judge_loop_handles_dataclass_feedback() -> None: function test_parallel_translation_flow_reuses_runner_outputs (line 120) | async def test_parallel_translation_flow_reuses_runner_outputs() -> None: function test_deterministic_story_flow_stops_when_checker_blocks (line 155) | async def test_deterministic_story_flow_stops_when_checker_blocks() -> N... function test_deterministic_story_flow_runs_story_on_pass (line 194) | async def test_deterministic_story_flow_runs_story_on_pass() -> None: function test_routing_stream_emits_text_and_updates_inputs (line 233) | async def test_routing_stream_emits_text_and_updates_inputs() -> None: class MathHomeworkOutput (line 265) | class MathHomeworkOutput(BaseModel): function test_input_guardrail_agent_trips_and_returns_info (line 271) | async def test_input_guardrail_agent_trips_and_returns_info() -> None: class MessageOutput (line 306) | class MessageOutput(BaseModel): function test_output_guardrail_blocks_sensitive_data (line 313) | async def test_output_guardrail_blocks_sensitive_data() -> None: function test_streaming_guardrail_style_cancel_after_threshold (line 356) | async def test_streaming_guardrail_style_cancel_after_threshold() -> None: function test_streaming_cancel_after_turn_allows_turn_completion (line 387) | async def test_streaming_cancel_after_turn_allows_turn_completion() -> N... function test_streaming_handoff_emits_agent_updated_event (line 410) | async def test_streaming_handoff_emits_agent_updated_event() -> None: function test_agent_as_tool_streaming_example_collects_events (line 439) | async def test_agent_as_tool_streaming_example_collects_events() -> None: function test_forcing_tool_use_behaviors_align_with_example (line 491) | async def test_forcing_tool_use_behaviors_align_with_example() -> None: function test_routing_multi_turn_continues_with_handoff_agent (line 572) | async def test_routing_multi_turn_continues_with_handoff_agent() -> None: function test_agents_as_tools_conditional_enabling_matches_preference (line 602) | async def test_agents_as_tools_conditional_enabling_matches_preference()... function test_agents_as_tools_orchestrator_runs_multiple_translations (line 687) | async def test_agents_as_tools_orchestrator_runs_multiple_translations()... function test_agents_as_tools_subagent_cancellation_preserves_parent_final_output (line 724) | async def test_agents_as_tools_subagent_cancellation_preserves_parent_fi... function test_agents_as_tools_streaming_subagent_cancellation_preserves_parent_output (line 801) | async def test_agents_as_tools_streaming_subagent_cancellation_preserves... function test_agents_as_tools_failure_error_function_none_reraises_cancelled_error (line 924) | async def test_agents_as_tools_failure_error_function_none_reraises_canc... FILE: tests/test_extended_thinking_message_order.py class TestExtendedThinkingMessageOrder (line 10) | class TestExtendedThinkingMessageOrder: method test_basic_reordering_tool_result_before_call (line 13) | def test_basic_reordering_tool_result_before_call(self): method test_consecutive_tool_calls_get_separated (line 43) | def test_consecutive_tool_calls_get_separated(self): method test_unmatched_tool_results_preserved (line 86) | def test_unmatched_tool_results_preserved(self): method test_tool_calls_without_results_preserved (line 118) | def test_tool_calls_without_results_preserved(self): method test_correctly_ordered_messages_unchanged (line 145) | def test_correctly_ordered_messages_unchanged(self): method test_multiple_tool_calls_single_message (line 175) | def test_multiple_tool_calls_single_message(self): method test_empty_messages_list (line 215) | def test_empty_messages_list(self): method test_no_tool_messages (line 224) | def test_no_tool_messages(self): method test_complex_mixed_scenario (line 237) | def test_complex_mixed_scenario(self): FILE: tests/test_extension_filters.py function fake_agent (line 31) | def fake_agent(): function _get_message_input_item (line 37) | def _get_message_input_item(content: str) -> TResponseInputItem: function _get_user_input_item (line 44) | def _get_user_input_item(content: str) -> TResponseInputItem: function _get_reasoning_input_item (line 51) | def _get_reasoning_input_item() -> TResponseInputItem: function _get_function_result_input_item (line 55) | def _get_function_result_input_item(content: str) -> TResponseInputItem: function _get_tool_search_call_input_item (line 63) | def _get_tool_search_call_input_item() -> dict[str, Any]: function _get_tool_search_result_input_item (line 71) | def _get_tool_search_result_input_item() -> dict[str, Any]: function _get_message_output_run_item (line 78) | def _get_message_output_run_item(content: str) -> MessageOutputItem: function _get_tool_output_run_item (line 93) | def _get_tool_output_run_item(content: str) -> ToolCallOutputItem: function _get_tool_search_call_run_item (line 105) | def _get_tool_search_call_run_item() -> ToolSearchCallItem: function _get_tool_search_output_run_item (line 109) | def _get_tool_search_output_run_item() -> ToolSearchOutputItem: function _get_handoff_input_item (line 113) | def _get_handoff_input_item(content: str) -> TResponseInputItem: function _get_handoff_output_run_item (line 121) | def _get_handoff_output_run_item(content: str) -> HandoffOutputItem: function _get_reasoning_output_run_item (line 134) | def _get_reasoning_output_run_item() -> ReasoningItem: function handoff_data (line 140) | def handoff_data( function _as_message (line 153) | def _as_message(item: TResponseInputItem) -> dict[str, Any]: function test_nest_handoff_history_with_string_input (line 161) | def test_nest_handoff_history_with_string_input() -> None: function test_empty_data (line 177) | def test_empty_data(): function test_str_historyonly (line 183) | def test_str_historyonly(): function test_str_history_and_list (line 191) | def test_str_history_and_list(): function test_list_history_and_list (line 200) | def test_list_history_and_list(): function test_removes_tools_from_history (line 210) | def test_removes_tools_from_history(): function test_removes_tools_from_new_items (line 229) | def test_removes_tools_from_new_items(): function test_removes_tools_from_new_items_and_history (line 242) | def test_removes_tools_from_new_items_and_history(): function test_removes_tool_search_from_history_and_items (line 267) | def test_removes_tool_search_from_history_and_items() -> None: function test_removes_handoffs_from_history (line 292) | def test_removes_handoffs_from_history(): function test_nest_handoff_history_wraps_transcript (line 317) | def test_nest_handoff_history_wraps_transcript() -> None: function test_nest_handoff_history_handles_missing_user (line 344) | def test_nest_handoff_history_handles_missing_user() -> None: function test_nest_handoff_history_appends_existing_history (line 360) | def test_nest_handoff_history_appends_existing_history() -> None: function test_nest_handoff_history_honors_custom_wrappers (line 396) | def test_nest_handoff_history_honors_custom_wrappers() -> None: function test_nest_handoff_history_supports_custom_mapper (line 430) | def test_nest_handoff_history_supports_custom_mapper() -> None: function test_nest_handoff_history_empty_transcript (line 459) | def test_nest_handoff_history_empty_transcript() -> None: function test_nest_handoff_history_role_with_name (line 474) | def test_nest_handoff_history_role_with_name() -> None: function test_nest_handoff_history_item_without_role (line 491) | def test_nest_handoff_history_item_without_role() -> None: function test_nest_handoff_history_content_handling (line 512) | def test_nest_handoff_history_content_handling() -> None: function test_nest_handoff_history_extract_nested_non_string_content (line 541) | def test_nest_handoff_history_extract_nested_non_string_content() -> None: function test_nest_handoff_history_parse_summary_line_edge_cases (line 562) | def test_nest_handoff_history_parse_summary_line_edge_cases() -> None: function test_nest_handoff_history_role_with_name_parsing (line 589) | def test_nest_handoff_history_role_with_name_parsing() -> None: function test_nest_handoff_history_parses_role_with_name_in_parentheses (line 614) | def test_nest_handoff_history_parses_role_with_name_in_parentheses() -> ... function test_nest_handoff_history_handles_parsing_edge_cases (line 640) | def test_nest_handoff_history_handles_parsing_edge_cases() -> None: function test_nest_handoff_history_handles_unserializable_items (line 668) | def test_nest_handoff_history_handles_unserializable_items() -> None: function test_nest_handoff_history_handles_unserializable_content (line 699) | def test_nest_handoff_history_handles_unserializable_content() -> None: function test_nest_handoff_history_handles_empty_lines_in_parsing (line 720) | def test_nest_handoff_history_handles_empty_lines_in_parsing() -> None: function test_nest_handoff_history_json_dumps_typeerror (line 746) | def test_nest_handoff_history_json_dumps_typeerror() -> None: function test_nest_handoff_history_stringify_content_typeerror (line 763) | def test_nest_handoff_history_stringify_content_typeerror() -> None: function test_nest_handoff_history_parse_summary_line_empty_stripped (line 781) | def test_nest_handoff_history_parse_summary_line_empty_stripped() -> None: FILE: tests/test_extra_headers.py function test_extra_headers_passed_to_openai_responses_model (line 11) | async def test_extra_headers_passed_to_openai_responses_model(): function test_extra_headers_passed_to_openai_client (line 61) | async def test_extra_headers_passed_to_openai_client(): FILE: tests/test_function_schema.py function no_args_function (line 14) | def no_args_function(): function test_no_args_function (line 20) | def test_no_args_function(): function no_args_function_with_context (line 32) | def no_args_function_with_context(ctx: RunContextWrapper[str]): function test_no_args_function_with_context (line 36) | def test_no_args_function_with_context() -> None: function simple_function (line 47) | def simple_function(a: int, b: int = 5): function test_simple_function (line 59) | def test_simple_function(): function varargs_function (line 95) | def varargs_function(x: int, *numbers: float, flag: bool = False, **kwar... function test_varargs_function (line 99) | def test_varargs_function(): class Foo (line 137) | class Foo(TypedDict): class InnerModel (line 142) | class InnerModel(BaseModel): class OuterModel (line 147) | class OuterModel(BaseModel): function complex_args_function (line 152) | def complex_args_function(model: OuterModel) -> str: function test_nested_data_function (line 156) | def test_nested_data_function(): function complex_args_and_docs_function (line 174) | def complex_args_and_docs_function(model: OuterModel, some_flag: int = 0... function test_complex_args_and_docs_function (line 188) | def test_complex_args_and_docs_function(): function function_with_context (line 225) | def function_with_context(ctx: RunContextWrapper[str], a: int, b: int = 5): function test_function_with_context (line 229) | def test_function_with_context(): class MyClass (line 243) | class MyClass: method foo (line 244) | def foo(self, a: int, b: int = 5): method foo_ctx (line 247) | def foo_ctx(self, ctx: RunContextWrapper[str], a: int, b: int = 5): method bar (line 251) | def bar(cls, a: int, b: int = 5): method bar_ctx (line 255) | def bar_ctx(cls, ctx: RunContextWrapper[str], a: int, b: int = 5): method baz (line 259) | def baz(a: int, b: int = 5): method baz_ctx (line 263) | def baz_ctx(ctx: RunContextWrapper[str], a: int, b: int = 5): function test_class_based_functions (line 267) | def test_class_based_functions(): class MyEnum (line 341) | class MyEnum(str, Enum): function enum_and_literal_function (line 347) | def enum_and_literal_function(a: MyEnum, b: Literal["a", "b", "c"]) -> str: function test_enum_and_literal_function (line 351) | def test_enum_and_literal_function(): function test_run_context_in_non_first_position_raises_value_error (line 392) | def test_run_context_in_non_first_position_raises_value_error(): function test_var_positional_tuple_annotation (line 402) | def test_var_positional_tuple_annotation(): function test_var_keyword_dict_annotation (line 418) | def test_var_keyword_dict_annotation(): function test_schema_with_mapping_raises_strict_mode_error (line 434) | def test_schema_with_mapping_raises_strict_mode_error(): function test_name_override_without_docstring (line 444) | def test_name_override_without_docstring() -> None: function test_function_with_field_required_constraints (line 456) | def test_function_with_field_required_constraints(): function test_function_with_field_optional_with_default (line 487) | def test_function_with_field_optional_with_default(): function test_function_uses_annotated_descriptions_without_docstring (line 524) | def test_function_uses_annotated_descriptions_without_docstring() -> None: function test_function_prefers_docstring_descriptions_over_annotated_metadata (line 540) | def test_function_prefers_docstring_descriptions_over_annotated_metadata... function test_function_with_field_description_merge (line 562) | def test_function_with_field_description_merge(): function func_with_field_desc_only (line 590) | def func_with_field_desc_only( function test_function_with_field_description_only (line 597) | def test_function_with_field_description_only(): function test_function_with_field_string_constraints (line 611) | def test_function_with_field_string_constraints(): function test_function_with_field_multiple_constraints (line 649) | def test_function_with_field_multiple_constraints(): function test_function_with_annotated_field_required_constraints (line 714) | def test_function_with_annotated_field_required_constraints(): function test_function_with_annotated_field_optional_with_default (line 747) | def test_function_with_annotated_field_optional_with_default(): function test_function_with_annotated_field_string_constraints (line 784) | def test_function_with_annotated_field_string_constraints(): function test_function_with_annotated_field_multiple_constraints (line 825) | def test_function_with_annotated_field_multiple_constraints(): FILE: tests/test_function_tool.py function argless_function (line 36) | def argless_function() -> str: function test_tool_namespace_copies_tools_with_metadata (line 40) | def test_tool_namespace_copies_tools_with_metadata() -> None: function test_tool_namespace_requires_keyword_arguments (line 58) | def test_tool_namespace_requires_keyword_arguments() -> None: function test_tool_namespace_requires_non_empty_description (line 65) | def test_tool_namespace_requires_non_empty_description() -> None: function test_tool_namespace_rejects_reserved_same_name_shape (line 83) | def test_tool_namespace_rejects_reserved_same_name_shape() -> None: function test_argless_function (line 95) | async def test_argless_function(): function argless_with_context (line 105) | def argless_with_context(ctx: ToolContext[str]) -> str: function test_argless_with_context (line 110) | async def test_argless_with_context(): function simple_function (line 127) | def simple_function(a: int, b: int = 5): function test_simple_function (line 132) | async def test_simple_function(): function test_sync_function_runs_via_to_thread (line 156) | async def test_sync_function_runs_via_to_thread(monkeypatch: pytest.Monk... function test_sync_function_does_not_block_event_loop (line 184) | async def test_sync_function_does_not_block_event_loop() -> None: class Foo (line 219) | class Foo(BaseModel): class Bar (line 224) | class Bar(TypedDict): function complex_args_function (line 229) | def complex_args_function(foo: Foo, bar: Bar, baz: str = "hello"): function reject_args_guardrail (line 234) | def reject_args_guardrail(data: ToolInputGuardrailData) -> ToolGuardrail... function allow_output_guardrail (line 243) | def allow_output_guardrail(data: ToolOutputGuardrailData) -> ToolGuardra... function test_complex_args_function (line 249) | async def test_complex_args_function(): function test_function_config_overrides (line 300) | def test_function_config_overrides(): function test_func_schema_is_strict (line 316) | def test_func_schema_is_strict(): function test_manual_function_tool_creation_works (line 333) | async def test_manual_function_tool_creation_works(): function test_function_tool_default_error_works (line 389) | async def test_function_tool_default_error_works(): function test_sync_custom_error_function_works (line 410) | async def test_sync_custom_error_function_works(): function test_async_custom_error_function_works (line 434) | async def test_async_custom_error_function_works(): class BoolCtx (line 457) | class BoolCtx(BaseModel): function test_is_enabled_bool_and_callable (line 462) | async def test_is_enabled_bool_and_callable(): function test_get_all_tools_preserves_explicit_tool_search_when_deferred_tools_are_disabled (line 499) | async def test_get_all_tools_preserves_explicit_tool_search_when_deferre... function test_get_all_tools_keeps_tool_search_for_namespace_only_tools (line 523) | async def test_get_all_tools_keeps_tool_search_for_namespace_only_tools(): function test_get_all_tools_keeps_tool_search_for_deferred_hosted_mcp (line 539) | async def test_get_all_tools_keeps_tool_search_for_deferred_hosted_mcp()... function test_async_failure_error_function_is_awaited (line 560) | async def test_async_failure_error_function_is_awaited() -> None: function test_failure_error_function_normalizes_cancelled_error_to_exception (line 575) | async def test_failure_error_function_normalizes_cancelled_error_to_exce... function test_default_failure_error_function_is_resolved_at_invoke_time (line 599) | async def test_default_failure_error_function_is_resolved_at_invoke_time( function test_manual_function_tool_uses_default_failure_error_function (line 618) | async def test_manual_function_tool_uses_default_failure_error_function(... function test_failure_error_function_survives_dataclasses_replace (line 646) | async def test_failure_error_function_survives_dataclasses_replace() -> ... function test_replaced_function_tool_normal_failure_uses_replaced_policy (line 664) | async def test_replaced_function_tool_normal_failure_uses_replaced_polic... function test_shallow_copied_function_tool_normal_failure_uses_copied_policy (line 683) | async def test_shallow_copied_function_tool_normal_failure_uses_copied_p... function test_copied_function_tool_invalid_input_uses_current_name (line 707) | async def test_copied_function_tool_invalid_input_uses_current_name(copy... function test_default_failure_error_function_survives_deepcopy (line 735) | async def test_default_failure_error_function_survives_deepcopy() -> None: function test_function_tool_accepts_guardrail_arguments (line 759) | def test_function_tool_accepts_guardrail_arguments(): function test_function_tool_decorator_accepts_guardrail_arguments (line 770) | def test_function_tool_decorator_accepts_guardrail_arguments(): function test_invoke_function_tool_timeout_returns_default_message (line 783) | async def test_invoke_function_tool_timeout_returns_default_message() ->... function test_invoke_function_tool_timeout_uses_custom_error_function (line 802) | async def test_invoke_function_tool_timeout_uses_custom_error_function()... function test_invoke_function_tool_timeout_can_raise_exception (line 823) | async def test_invoke_function_tool_timeout_can_raise_exception() -> None: function test_invoke_function_tool_does_not_rewrite_tool_raised_timeout_error (line 839) | async def test_invoke_function_tool_does_not_rewrite_tool_raised_timeout... function test_invoke_function_tool_does_not_rewrite_manual_tool_raised_timeout_error (line 856) | async def test_invoke_function_tool_does_not_rewrite_manual_tool_raised_... function _noop_on_invoke_tool (line 877) | async def _noop_on_invoke_tool(_ctx: ToolContext[Any], _args: str) -> str: function test_function_tool_timeout_seconds_must_be_positive_number (line 881) | def test_function_tool_timeout_seconds_must_be_positive_number() -> None: function test_function_tool_timeout_not_supported_for_sync_handlers (line 919) | def test_function_tool_timeout_not_supported_for_sync_handlers() -> None: function test_function_tool_timeout_behavior_must_be_supported (line 933) | def test_function_tool_timeout_behavior_must_be_supported() -> None: function test_function_tool_timeout_error_function_must_be_callable (line 944) | def test_function_tool_timeout_error_function_must_be_callable() -> None: FILE: tests/test_function_tool_decorator.py class DummyContext (line 14) | class DummyContext: method __init__ (line 15) | def __init__(self): function ctx_wrapper (line 19) | def ctx_wrapper() -> ToolContext[DummyContext]: function sync_no_context_no_args (line 26) | def sync_no_context_no_args() -> str: function test_sync_no_context_no_args_invocation (line 31) | async def test_sync_no_context_no_args_invocation(): function sync_no_context_with_args (line 38) | def sync_no_context_with_args(a: int, b: int) -> int: function test_sync_no_context_with_args_invocation (line 43) | async def test_sync_no_context_with_args_invocation(): function sync_with_context (line 51) | def sync_with_context(ctx: ToolContext[DummyContext], name: str) -> str: function test_sync_with_context_invocation (line 56) | async def test_sync_with_context_invocation(): function async_no_context (line 64) | async def async_no_context(a: int, b: int) -> int: function test_async_no_context_invocation (line 70) | async def test_async_no_context_invocation(): function async_with_context (line 78) | async def async_with_context(ctx: ToolContext[DummyContext], prefix: str... function test_async_with_context_invocation (line 84) | async def test_async_with_context_invocation(): function sync_no_context_override (line 92) | def sync_no_context_override() -> str: function test_sync_no_context_override_invocation (line 97) | async def test_sync_no_context_override_invocation(): function will_fail_on_bad_json (line 106) | def will_fail_on_bad_json(x: int) -> int: function test_error_on_invalid_json (line 111) | async def test_error_on_invalid_json(): function sync_error_handler (line 119) | def sync_error_handler(ctx: RunContextWrapper[Any], error: Exception) ->... function will_not_fail_on_bad_json (line 124) | def will_not_fail_on_bad_json(x: int) -> int: function test_no_error_on_invalid_json (line 129) | async def test_no_error_on_invalid_json(): function async_error_handler (line 136) | def async_error_handler(ctx: RunContextWrapper[Any], error: Exception) -... function will_not_fail_on_bad_json_async (line 141) | def will_not_fail_on_bad_json_async(x: int) -> int: function test_no_error_on_invalid_json_async (line 146) | async def test_no_error_on_invalid_json_async(): function deferred_lookup (line 153) | def deferred_lookup(customer_id: str) -> str: function test_function_tool_defer_loading (line 157) | def test_function_tool_defer_loading(): function optional_param_function (line 162) | def optional_param_function(a: int, b: Optional[int] = None) -> str: function test_non_strict_mode_function (line 169) | async def test_non_strict_mode_function(): function all_optional_params_function (line 186) | def all_optional_params_function( function test_all_optional_params_function (line 197) | async def test_all_optional_params_function(): function get_weather (line 218) | def get_weather(city: str) -> str: function test_extract_descriptions_from_docstring (line 228) | async def test_extract_descriptions_from_docstring(): function timeout_configured_tool (line 256) | async def timeout_configured_tool() -> str: function test_decorator_timeout_configuration_is_applied (line 260) | def test_decorator_timeout_configuration_is_applied() -> None: function test_function_tool_timeout_arguments_are_keyword_only (line 266) | def test_function_tool_timeout_arguments_are_keyword_only() -> None: FILE: tests/test_gemini_thought_signatures.py function test_gemini_thought_signature_roundtrip (line 18) | def test_gemini_thought_signature_roundtrip(): function test_gemini_multiple_tool_calls_with_thought_signatures (line 66) | def test_gemini_multiple_tool_calls_with_thought_signatures(): function test_gemini_thought_signature_items_to_messages (line 98) | def test_gemini_thought_signature_items_to_messages(): FILE: tests/test_gemini_thought_signatures_stream.py function create_tool_call_delta (line 28) | def create_tool_call_delta( function create_chunk (line 62) | def create_chunk( function create_final_chunk (line 94) | def create_final_chunk() -> ChatCompletionChunk: function create_fake_stream (line 105) | async def create_fake_stream( function create_mock_response (line 113) | def create_mock_response() -> Response: function test_stream_captures_litellmprovider_specific_fields_thought_signature (line 131) | async def test_stream_captures_litellmprovider_specific_fields_thought_s... function test_stream_captures_google_extra_content_thought_signature (line 173) | async def test_stream_captures_google_extra_content_thought_signature(): FILE: tests/test_global_hooks.py class RunHooksForTests (line 22) | class RunHooksForTests(RunHooks): method __init__ (line 23) | def __init__(self): method reset (line 26) | def reset(self): method on_agent_start (line 29) | async def on_agent_start( method on_agent_end (line 34) | async def on_agent_end( method on_handoff (line 42) | async def on_handoff( method on_tool_start (line 50) | async def on_tool_start( method on_tool_end (line 58) | async def on_tool_end( function test_non_streamed_agent_hooks (line 69) | async def test_non_streamed_agent_hooks(): function test_streamed_agent_hooks (line 144) | async def test_streamed_agent_hooks(): class Foo (line 221) | class Foo(TypedDict): function test_structured_output_non_streamed_agent_hooks (line 226) | async def test_structured_output_non_streamed_agent_hooks(): function test_structured_output_streamed_agent_hooks (line 299) | async def test_structured_output_streamed_agent_hooks(): FILE: tests/test_guardrails.py function get_sync_guardrail (line 33) | def get_sync_guardrail(triggers: bool, output_info: Any | None = None): function test_sync_input_guardrail (line 46) | async def test_sync_input_guardrail(): function get_async_input_guardrail (line 71) | def get_async_input_guardrail(triggers: bool, output_info: Any | None = ... function test_async_input_guardrail (line 84) | async def test_async_input_guardrail(): function test_invalid_input_guardrail_raises_user_error (line 110) | async def test_invalid_input_guardrail_raises_user_error(): function get_sync_output_guardrail (line 119) | def get_sync_output_guardrail(triggers: bool, output_info: Any | None = ... function test_sync_output_guardrail (line 130) | async def test_sync_output_guardrail(): function get_async_output_guardrail (line 155) | def get_async_output_guardrail(triggers: bool, output_info: Any | None =... function test_async_output_guardrail (line 168) | async def test_async_output_guardrail(): function test_invalid_output_guardrail_raises_user_error (line 194) | async def test_invalid_output_guardrail_raises_user_error(): function decorated_input_guardrail (line 204) | def decorated_input_guardrail( function decorated_named_input_guardrail (line 214) | def decorated_named_input_guardrail( function test_input_guardrail_decorators (line 224) | async def test_input_guardrail_decorators(): function decorated_output_guardrail (line 242) | def decorated_output_guardrail( function decorated_named_output_guardrail (line 252) | def decorated_named_output_guardrail( function test_output_guardrail_decorators (line 262) | async def test_output_guardrail_decorators(): function test_input_guardrail_run_in_parallel_default (line 280) | async def test_input_guardrail_run_in_parallel_default(): function test_input_guardrail_run_in_parallel_false (line 290) | async def test_input_guardrail_run_in_parallel_false(): function test_input_guardrail_decorator_with_run_in_parallel (line 301) | async def test_input_guardrail_decorator_with_run_in_parallel(): function test_input_guardrail_decorator_with_name_and_run_in_parallel (line 320) | async def test_input_guardrail_decorator_with_name_and_run_in_parallel(): function test_parallel_guardrail_runs_concurrently_with_agent (line 335) | async def test_parallel_guardrail_runs_concurrently_with_agent(): function test_parallel_guardrail_runs_concurrently_with_agent_streaming (line 369) | async def test_parallel_guardrail_runs_concurrently_with_agent_streaming(): function test_blocking_guardrail_prevents_agent_execution (line 405) | async def test_blocking_guardrail_prevents_agent_execution(): function test_blocking_guardrail_prevents_agent_execution_streaming (line 438) | async def test_blocking_guardrail_prevents_agent_execution_streaming(): function test_parallel_guardrail_may_not_prevent_tool_execution (line 473) | async def test_parallel_guardrail_may_not_prevent_tool_execution(): function test_parallel_guardrail_trip_cancels_model_task (line 517) | async def test_parallel_guardrail_trip_cancels_model_task(): function test_parallel_guardrail_trip_compat_mode_does_not_cancel_model_task (line 564) | async def test_parallel_guardrail_trip_compat_mode_does_not_cancel_model... function test_parallel_guardrail_may_not_prevent_tool_execution_streaming (line 615) | async def test_parallel_guardrail_may_not_prevent_tool_execution_streami... function test_blocking_guardrail_prevents_tool_execution (line 662) | async def test_blocking_guardrail_prevents_tool_execution(): function test_blocking_guardrail_prevents_tool_execution_streaming (line 703) | async def test_blocking_guardrail_prevents_tool_execution_streaming(): function test_parallel_guardrail_passes_agent_continues (line 747) | async def test_parallel_guardrail_passes_agent_continues(): function test_parallel_guardrail_passes_agent_continues_streaming (line 779) | async def test_parallel_guardrail_passes_agent_continues_streaming(): function test_blocking_guardrail_passes_agent_continues (line 815) | async def test_blocking_guardrail_passes_agent_continues(): function test_blocking_guardrail_passes_agent_continues_streaming (line 847) | async def test_blocking_guardrail_passes_agent_continues_streaming(): function test_mixed_blocking_and_parallel_guardrails (line 883) | async def test_mixed_blocking_and_parallel_guardrails(): function test_mixed_blocking_and_parallel_guardrails_streaming (line 953) | async def test_mixed_blocking_and_parallel_guardrails_streaming(): function test_multiple_blocking_guardrails_complete_before_agent (line 1026) | async def test_multiple_blocking_guardrails_complete_before_agent(): function test_multiple_blocking_guardrails_complete_before_agent_streaming (line 1093) | async def test_multiple_blocking_guardrails_complete_before_agent_stream... function test_multiple_blocking_guardrails_one_triggers (line 1163) | async def test_multiple_blocking_guardrails_one_triggers(): function test_multiple_blocking_guardrails_one_triggers_streaming (line 1220) | async def test_multiple_blocking_guardrails_one_triggers_streaming(): function test_guardrail_via_agent_and_run_config_equivalent (line 1280) | async def test_guardrail_via_agent_and_run_config_equivalent(): function test_blocking_guardrail_cancels_remaining_on_trigger (line 1340) | async def test_blocking_guardrail_cancels_remaining_on_trigger(): function test_blocking_guardrail_cancels_remaining_on_trigger_streaming (line 1422) | async def test_blocking_guardrail_cancels_remaining_on_trigger_streaming(): FILE: tests/test_handoff_history_duplication.py function _create_mock_agent (line 35) | def _create_mock_agent() -> Agent: function _create_tool_call_item (line 40) | def _create_tool_call_item(agent: Agent) -> ToolCallItem: function _create_tool_output_item (line 52) | def _create_tool_output_item(agent: Agent) -> ToolCallOutputItem: function _create_handoff_call_item (line 67) | def _create_handoff_call_item(agent: Agent) -> HandoffCallItem: function _create_handoff_output_item (line 79) | def _create_handoff_output_item(agent: Agent[Any]) -> HandoffOutputItem: function _create_message_item (line 95) | def _create_message_item(agent: Agent) -> MessageOutputItem: function _create_reasoning_item (line 107) | def _create_reasoning_item(agent: Agent) -> ReasoningItem: function _create_tool_approval_item (line 117) | def _create_tool_approval_item(agent: Agent) -> ToolApprovalItem: class TestHandoffHistoryDuplicationFix (line 128) | class TestHandoffHistoryDuplicationFix: method test_pre_handoff_tool_items_are_filtered (line 131) | def test_pre_handoff_tool_items_are_filtered(self): method test_tool_approval_items_are_skipped (line 161) | def test_tool_approval_items_are_skipped(self): method test_pre_handoff_reasoning_items_are_filtered (line 177) | def test_pre_handoff_reasoning_items_are_filtered(self): method test_new_items_handoff_output_is_filtered_for_input (line 199) | def test_new_items_handoff_output_is_filtered_for_input(self): method test_message_items_are_preserved_in_new_items (line 228) | def test_message_items_are_preserved_in_new_items(self): method test_reasoning_items_are_filtered_from_input_items (line 251) | def test_reasoning_items_are_filtered_from_input_items(self): method test_summary_contains_filtered_items_as_text (line 280) | def test_summary_contains_filtered_items_as_text(self): method test_input_items_field_exists_after_nesting (line 307) | def test_input_items_field_exists_after_nesting(self): method test_full_handoff_scenario_no_duplication (line 326) | def test_full_handoff_scenario_no_duplication(self): function test_to_input_list_normalized_uses_filtered_continuation_after_nested_handoff (line 376) | async def test_to_input_list_normalized_uses_filtered_continuation_after... function test_to_input_list_normalized_keeps_delegate_tool_items_after_nested_handoff (line 423) | async def test_to_input_list_normalized_keeps_delegate_tool_items_after_... function test_to_input_list_normalized_uses_custom_filter_input_items (line 488) | async def test_to_input_list_normalized_uses_custom_filter_input_items()... FILE: tests/test_handoff_prompt.py function test_prompt_with_handoff_instructions_includes_prefix (line 7) | def test_prompt_with_handoff_instructions_includes_prefix() -> None: FILE: tests/test_handoff_tool.py function message_item (line 22) | def message_item(content: str, agent: Agent[Any]) -> MessageOutputItem: function get_len (line 37) | def get_len(data: HandoffInputData) -> int: function test_single_handoff_setup (line 45) | async def test_single_handoff_setup(): function test_multiple_handoffs_setup (line 63) | async def test_multiple_handoffs_setup(): function test_custom_handoff_setup (line 85) | async def test_custom_handoff_setup(): class Foo (line 120) | class Foo(BaseModel): function test_handoff_input_type (line 125) | async def test_handoff_input_type(): function test_on_handoff_called (line 150) | async def test_on_handoff_called(): function test_on_handoff_without_input_called (line 171) | async def test_on_handoff_without_input_called(): function test_async_on_handoff_without_input_called (line 188) | async def test_async_on_handoff_without_input_called(): function test_invalid_on_handoff_raises_error (line 205) | async def test_invalid_on_handoff_raises_error(): function test_handoff_input_data (line 219) | def test_handoff_input_data(): function test_handoff_input_schema_is_strict (line 279) | def test_handoff_input_schema_is_strict(): function test_get_transfer_message_is_valid_json (line 293) | def test_get_transfer_message_is_valid_json() -> None: function test_handoff_is_enabled_bool (line 300) | def test_handoff_is_enabled_bool(): function test_handoff_is_enabled_callable (line 318) | async def test_handoff_is_enabled_callable(): function test_handoff_is_enabled_filtering_integration (line 355) | async def test_handoff_is_enabled_filtering_integration(): FILE: tests/test_hitl_error_scenarios.py class TrackingComputer (line 87) | class TrackingComputer(Computer): method __init__ (line 90) | def __init__(self) -> None: method environment (line 94) | def environment(self) -> Environment: method dimensions (line 98) | def dimensions(self) -> tuple[int, int]: method screenshot (line 101) | def screenshot(self) -> str: method click (line 105) | def click(self, _x: int, _y: int, _button: str) -> None: method double_click (line 108) | def double_click(self, _x: int, _y: int) -> None: method scroll (line 111) | def scroll(self, _x: int, _y: int, _scroll_x: int, _scroll_y: int) -> ... method type (line 114) | def type(self, _text: str) -> None: method wait (line 117) | def wait(self) -> None: method move (line 120) | def move(self, _x: int, _y: int) -> None: method keypress (line 123) | def keypress(self, _keys: list[str]) -> None: method drag (line 126) | def drag(self, _path: list[tuple[int, int]]) -> None: function _shell_approval_setup (line 130) | def _shell_approval_setup() -> ApprovalScenario: function _apply_patch_approval_setup (line 147) | def _apply_patch_approval_setup() -> ApprovalScenario: function _shell_pending_setup (line 167) | def _shell_pending_setup() -> PendingScenario: function _apply_patch_pending_setup (line 175) | def _apply_patch_pending_setup() -> PendingScenario: function test_resumed_hitl_executes_approved_tools (line 198) | async def test_resumed_hitl_executes_approved_tools( function test_resuming_skips_approvals_for_non_hitl_tools (line 221) | async def test_resuming_skips_approvals_for_non_hitl_tools(tool_kind: st... function test_nested_agent_tool_resumes_after_rejection (line 275) | async def test_nested_agent_tool_resumes_after_rejection() -> None: function test_nested_agent_tool_interruptions_dont_collide_on_duplicate_call_ids (line 337) | async def test_nested_agent_tool_interruptions_dont_collide_on_duplicate... function test_nested_agent_tool_does_not_inherit_parent_approvals (line 383) | async def test_nested_agent_tool_does_not_inherit_parent_approvals() -> ... function test_pending_approvals_stay_pending_on_resume (line 441) | async def test_pending_approvals_stay_pending_on_resume( function test_resume_does_not_duplicate_pending_shell_approvals (line 462) | async def test_resume_does_not_duplicate_pending_shell_approvals() -> None: function test_resuming_pending_mcp_approvals_raises_typeerror (line 488) | async def test_resuming_pending_mcp_approvals_raises_typeerror(): function test_route_local_shell_calls_to_remote_shell_tool (line 502) | async def test_route_local_shell_calls_to_remote_shell_tool(): function test_preserve_max_turns_when_resuming_from_runresult_state (line 545) | async def test_preserve_max_turns_when_resuming_from_runresult_state(): function test_current_turn_not_preserved_in_to_state (line 583) | async def test_current_turn_not_preserved_in_to_state(): function test_deserialize_interruptions_preserve_tool_calls (line 629) | async def test_deserialize_interruptions_preserve_tool_calls( function test_deserialize_interruptions_preserve_mcp_tools (line 644) | async def test_deserialize_interruptions_preserve_mcp_tools( function test_hosted_mcp_approval_matches_unknown_tool_key (line 666) | async def test_hosted_mcp_approval_matches_unknown_tool_key() -> None: function test_shell_call_without_call_id_raises (line 727) | async def test_shell_call_without_call_id_raises() -> None: function test_preserve_persisted_item_counter_when_resuming_streamed_runs (line 762) | async def test_preserve_persisted_item_counter_when_resuming_streamed_ru... function test_preserve_tool_output_types_during_serialization (line 823) | async def test_preserve_tool_output_types_during_serialization(): function test_function_needs_approval_invalid_type_raises (line 851) | async def test_function_needs_approval_invalid_type_raises() -> None: function test_resume_invalid_needs_approval_raises (line 866) | async def test_resume_invalid_needs_approval_raises() -> None: function test_agent_as_tool_with_nested_approvals_propagates (line 908) | async def test_agent_as_tool_with_nested_approvals_propagates() -> None: function test_resume_rebuilds_function_runs_from_pending_approvals (line 976) | async def test_resume_rebuilds_function_runs_from_pending_approvals() ->... function test_resume_rebuilds_deferred_function_runs_from_lookup_key_without_raw_namespace (line 1033) | async def test_resume_rebuilds_deferred_function_runs_from_lookup_key_wi... function test_resume_honors_permanent_namespaced_function_approval_with_new_call_id (line 1103) | async def test_resume_honors_permanent_namespaced_function_approval_with... function test_resume_rebuilds_function_runs_from_object_approvals (line 1169) | async def test_resume_rebuilds_function_runs_from_object_approvals() -> ... function test_resume_rebuilds_local_mcp_function_runs_from_approvals (line 1225) | async def test_resume_rebuilds_local_mcp_function_runs_from_approvals() ... function test_resume_rebuild_rejections_use_deferred_tool_display_name (line 1280) | async def test_resume_rebuild_rejections_use_deferred_tool_display_name(... function test_rebuild_function_runs_handles_object_pending_and_rejections (line 1343) | async def test_rebuild_function_runs_handles_object_pending_and_rejectio... function test_resume_keeps_unmatched_pending_approvals_with_function_runs (line 1403) | async def test_resume_keeps_unmatched_pending_approvals_with_function_ru... function test_resume_executes_non_hitl_function_calls_without_output (line 1457) | async def test_resume_executes_non_hitl_function_calls_without_output() ... function test_resume_skips_non_hitl_function_calls_with_existing_output (line 1500) | async def test_resume_skips_non_hitl_function_calls_with_existing_output... function test_resume_skips_shell_calls_with_existing_output (line 1558) | async def test_resume_skips_shell_calls_with_existing_output() -> None: function test_resume_keeps_approved_shell_outputs_with_pending_interruptions (line 1613) | async def test_resume_keeps_approved_shell_outputs_with_pending_interrup... function test_resume_executes_pending_computer_actions (line 1681) | async def test_resume_executes_pending_computer_actions() -> None: function test_resume_skips_computer_actions_with_existing_output (line 1737) | async def test_resume_skips_computer_actions_with_existing_output() -> N... function test_rebuild_function_runs_handles_pending_and_rejections (line 1798) | async def test_rebuild_function_runs_handles_pending_and_rejections() ->... function test_rebuild_preserves_unmatched_pending_approvals (line 1890) | async def test_rebuild_preserves_unmatched_pending_approvals( function test_rejected_shell_calls_emit_rejection_output (line 1930) | async def test_rejected_shell_calls_emit_rejection_output() -> None: function test_rejected_shell_calls_with_existing_output_are_not_duplicated (line 1990) | async def test_rejected_shell_calls_with_existing_output_are_not_duplica... function test_mcp_callback_approvals_are_processed (line 2070) | async def test_mcp_callback_approvals_are_processed() -> None: FILE: tests/test_hitl_session_scenario.py function approval_echo (line 42) | def approval_echo(query: str) -> str: function approval_note (line 52) | def approval_note(query: str) -> str: class ScenarioStep (line 58) | class ScenarioStep: class ScenarioResult (line 67) | class ScenarioResult: class ScenarioModel (line 72) | class ScenarioModel(Model): method __init__ (line 73) | def __init__(self) -> None: method get_response (line 76) | async def get_response( method stream_response (line 109) | async def stream_response( function test_memory_session_hitl_scenario (line 129) | async def test_memory_session_hitl_scenario() -> None: function test_openai_conversations_session_hitl_scenario (line 184) | async def test_openai_conversations_session_hitl_scenario() -> None: function run_scenario_step (line 281) | async def run_scenario_step( function assert_counts (line 312) | def assert_counts(items: list[TResponseInputItem], turn: int) -> None: function assert_step_output (line 318) | def assert_step_output( function assert_step_items (line 339) | def assert_step_items( function extract_user_message (line 361) | def extract_user_message(input: str | list[TResponseInputItem]) -> str: function input_has_rejection (line 382) | def input_has_rejection(input: str | list[TResponseInputItem]) -> bool: function count_user_messages (line 402) | def count_user_messages(items: list[TResponseInputItem]) -> int: function count_function_calls (line 406) | def count_function_calls(items: list[TResponseInputItem]) -> int: function count_function_outputs (line 412) | def count_function_outputs(items: list[TResponseInputItem]) -> int: function find_last_function_call (line 418) | def find_last_function_call( function find_last_function_output (line 427) | def find_last_function_output( function get_last_user_text (line 436) | def get_last_user_text(items: list[TResponseInputItem]) -> str | None: function extract_user_text (line 443) | def extract_user_text(item: dict[str, Any]) -> str: function extract_call_id (line 456) | def extract_call_id(item: Any) -> str | None: function extract_output_text (line 462) | def extract_output_text(item: dict[str, Any] | None) -> str: FILE: tests/test_hitl_utils.py function test_recording_editor_records_operations (line 6) | def test_recording_editor_records_operations() -> None: FILE: tests/test_items_helpers.py function make_message (line 51) | def make_message( function test_extract_last_content_of_text_message (line 67) | def test_extract_last_content_of_text_message() -> None: function test_extract_last_content_of_refusal_message (line 76) | def test_extract_last_content_of_refusal_message() -> None: function test_extract_last_content_non_message_returns_empty (line 87) | def test_extract_last_content_non_message_returns_empty() -> None: function test_extract_last_text_returns_text_only (line 99) | def test_extract_last_text_returns_text_only() -> None: function test_extract_text_concatenates_all_text_segments (line 110) | def test_extract_text_concatenates_all_text_segments() -> None: function test_input_to_new_input_list_from_string (line 131) | def test_input_to_new_input_list_from_string() -> None: function test_input_to_new_input_list_deep_copies_lists (line 138) | def test_input_to_new_input_list_deep_copies_lists() -> None: function test_text_message_output_concatenates_text_segments (line 148) | def test_text_message_output_concatenates_text_segments() -> None: function test_text_message_outputs_across_list_of_runitems (line 160) | def test_text_message_outputs_across_list_of_runitems() -> None: function test_message_output_item_retains_agent_until_release (line 181) | def test_message_output_item_retains_agent_until_release() -> None: function test_handoff_output_item_retains_agents_until_gc (line 202) | def test_handoff_output_item_retains_agents_until_gc() -> None: function test_handoff_output_item_converts_protocol_payload (line 239) | def test_handoff_output_item_converts_protocol_payload() -> None: function test_handoff_output_item_stringifies_object_output (line 264) | def test_handoff_output_item_stringifies_object_output() -> None: function test_tool_call_output_item_preserves_function_output_structure (line 290) | def test_tool_call_output_item_preserves_function_output_structure() -> ... function test_tool_call_output_item_constructs_function_call_output_dict (line 305) | def test_tool_call_output_item_constructs_function_call_output_dict(): function test_to_input_items_for_message (line 332) | def test_to_input_items_for_message() -> None: function test_to_input_items_for_function_call (line 361) | def test_to_input_items_for_function_call() -> None: function test_to_input_items_for_file_search_call (line 379) | def test_to_input_items_for_file_search_call() -> None: function test_to_input_items_for_web_search_call (line 396) | def test_to_input_items_for_web_search_call() -> None: function test_to_input_items_for_computer_call_click (line 416) | def test_to_input_items_for_computer_call_click() -> None: function test_to_input_items_for_computer_call_batched_actions (line 443) | def test_to_input_items_for_computer_call_batched_actions() -> None: function test_to_input_items_for_reasoning (line 472) | def test_to_input_items_for_reasoning() -> None: function test_to_input_items_for_tool_search_strips_created_by (line 491) | def test_to_input_items_for_tool_search_strips_created_by() -> None: function test_input_to_new_input_list_copies_the_ones_produced_by_pydantic (line 537) | def test_input_to_new_input_list_copies_the_ones_produced_by_pydantic() ... FILE: tests/test_local_shell_tool.py class RecordingLocalShellExecutor (line 29) | class RecordingLocalShellExecutor: method __init__ (line 32) | def __init__(self, output: str = "shell output") -> None: method __call__ (line 36) | def __call__(self, request: LocalShellCommandRequest) -> str: function test_local_shell_action_execute_invokes_executor (line 42) | async def test_local_shell_action_execute_invokes_executor() -> None: function test_runner_executes_local_shell_calls (line 96) | async def test_runner_executes_local_shell_calls() -> None: FILE: tests/test_logprobs.py class DummyResponses (line 7) | class DummyResponses: method create (line 8) | async def create(self, **kwargs): class DummyClient (line 29) | class DummyClient: method __init__ (line 30) | def __init__(self): function test_top_logprobs_param_passed (line 36) | async def test_top_logprobs_param_passed(): FILE: tests/test_max_turns.py function test_non_streamed_max_turns (line 25) | async def test_non_streamed_max_turns(): function test_streamed_max_turns (line 49) | async def test_streamed_max_turns(): class Foo (line 88) | class Foo(TypedDict): class FooModel (line 92) | class FooModel(BaseModel): function test_structured_output_non_streamed_max_turns (line 97) | async def test_structured_output_non_streamed_max_turns(): function test_structured_output_streamed_max_turns (line 120) | async def test_structured_output_streamed_max_turns(): function test_structured_output_max_turns_handler_invalid_output (line 145) | async def test_structured_output_max_turns_handler_invalid_output(): function test_structured_output_max_turns_handler_pydantic_output (line 163) | async def test_structured_output_max_turns_handler_pydantic_output(): function test_structured_output_max_turns_handler_list_output (line 184) | async def test_structured_output_max_turns_handler_list_output(): function test_non_streamed_max_turns_handler_returns_output (line 204) | async def test_non_streamed_max_turns_handler_returns_output(): function test_non_streamed_max_turns_handler_skip_history (line 224) | async def test_non_streamed_max_turns_handler_skip_history(): function test_non_streamed_max_turns_handler_raw_output (line 245) | async def test_non_streamed_max_turns_handler_raw_output(): function test_non_streamed_max_turns_handler_raw_dict_output (line 261) | async def test_non_streamed_max_turns_handler_raw_dict_output(): function test_streamed_max_turns_handler_returns_output (line 276) | async def test_streamed_max_turns_handler_returns_output(): function test_streamed_max_turns_handler_pydantic_output (line 299) | async def test_streamed_max_turns_handler_pydantic_output(): function test_streamed_max_turns_handler_list_output (line 326) | async def test_streamed_max_turns_handler_list_output(): FILE: tests/test_model_payload_iterators.py class _SingleUseIterable (line 24) | class _SingleUseIterable: method __init__ (line 27) | def __init__(self, values: list[object]) -> None: method __iter__ (line 31) | def __iter__(self) -> Iterator[object]: function _force_materialization (line 38) | def _force_materialization(value: object) -> None: function test_chat_completions_materializes_iterator_payload (line 51) | async def test_chat_completions_materializes_iterator_payload( function test_responses_materializes_iterator_payload (line 123) | async def test_responses_materializes_iterator_payload(monkeypatch: pyte... FILE: tests/test_model_retry.py function _connection_error (line 32) | def _connection_error(message: str = "connection error") -> APIConnectio... function _conversation_locked_error (line 39) | def _conversation_locked_error() -> BadRequestError: function _status_error (line 55) | def _status_error(status_code: int, code: str = "server_error") -> APISt... function _status_error_without_code (line 71) | def _status_error_without_code(status_code: int, body_code: str = "serve... class _AcloseTrackingStream (line 85) | class _AcloseTrackingStream: method __init__ (line 86) | def __init__( method __aiter__ (line 96) | def __aiter__(self) -> _AcloseTrackingStream: method __anext__ (line 99) | async def __anext__(self) -> TResponseStreamEvent: method aclose (line 108) | async def aclose(self) -> None: class _CloseTrackingStream (line 112) | class _CloseTrackingStream: method __init__ (line 113) | def __init__(self, events: list[TResponseStreamEvent]) -> None: method __aiter__ (line 117) | def __aiter__(self) -> _CloseTrackingStream: method __anext__ (line 120) | async def __anext__(self) -> TResponseStreamEvent: method close (line 125) | async def close(self) -> None: function test_get_response_with_retry_retries_and_augments_usage (line 130) | async def test_get_response_with_retry_retries_and_augments_usage(monkey... function test_get_response_with_retry_keeps_provider_retries_on_first_attempt (line 175) | async def test_get_response_with_retry_keeps_provider_retries_on_first_a... function test_get_response_with_retry_disables_provider_retries_on_first_stateful_provider_hint (line 217) | async def test_get_response_with_retry_disables_provider_retries_on_firs... function test_get_response_with_retry_disables_stateful_provider_retries_with_narrow_policy (line 262) | async def test_get_response_with_retry_disables_stateful_provider_retrie... function test_get_response_with_retry_keeps_stateful_provider_retries_when_budget_omitted (line 300) | async def test_get_response_with_retry_keeps_stateful_provider_retries_w... function test_get_response_with_retry_disables_stateful_provider_retries_for_network_only_policy (line 337) | async def test_get_response_with_retry_disables_stateful_provider_retrie... function test_get_response_with_retry_disables_stateful_provider_retries_for_partial_policy (line 375) | async def test_get_response_with_retry_disables_stateful_provider_retrie... function test_get_response_with_retry_disables_provider_retries_when_explicitly_disabled (line 416) | async def test_get_response_with_retry_disables_provider_retries_when_ex... function test_get_response_with_retry_keeps_provider_retries_without_runner_policy (line 457) | async def test_get_response_with_retry_keeps_provider_retries_without_ru... function test_get_response_with_retry_preserves_successful_request_usage_entry (line 497) | async def test_get_response_with_retry_preserves_successful_request_usag... function test_get_response_with_retry_preserves_zero_token_successful_request_usage_entry (line 548) | async def test_get_response_with_retry_preserves_zero_token_successful_r... function test_get_response_with_retry_preserves_inferred_normalized_error_flags (line 592) | async def test_get_response_with_retry_preserves_inferred_normalized_err... function test_get_response_with_retry_honors_explicit_false_provider_normalized_override (line 629) | async def test_get_response_with_retry_honors_explicit_false_provider_no... function test_get_response_with_retry_honors_explicit_none_retry_after_override (line 663) | async def test_get_response_with_retry_honors_explicit_none_retry_after_... function test_get_response_with_retry_preserves_conversation_locked_compatibility (line 705) | async def test_get_response_with_retry_preserves_conversation_locked_com... function test_get_response_with_retry_disables_provider_retries_on_stateful_compat_replay (line 751) | async def test_get_response_with_retry_disables_provider_retries_on_stat... function test_get_response_with_retry_respects_explicit_disable_for_conversation_locked (line 797) | async def test_get_response_with_retry_respects_explicit_disable_for_con... function test_get_response_with_retry_keeps_conversation_locked_compatibility_with_retry (line 837) | async def test_get_response_with_retry_keeps_conversation_locked_compati... function test_get_response_with_retry_allows_stateful_retry_when_provider_marks_safe (line 883) | async def test_get_response_with_retry_allows_stateful_retry_when_provid... function test_get_response_with_retry_allows_stateful_retry_for_http_failure_advice (line 930) | async def test_get_response_with_retry_allows_stateful_retry_for_http_fa... function test_get_response_with_retry_allows_provider_safe_stateful_retry_for_generic_policy (line 975) | async def test_get_response_with_retry_allows_provider_safe_stateful_ret... function test_get_response_with_retry_rejects_stateful_retry_without_replay_safety (line 1022) | async def test_get_response_with_retry_rejects_stateful_retry_without_re... function test_get_response_with_retry_exposes_provider_error_code_to_retry_policies (line 1051) | async def test_get_response_with_retry_exposes_provider_error_code_to_re... function test_get_response_with_retry_stops_after_retry_budget_exhausted (line 1097) | async def test_get_response_with_retry_stops_after_retry_budget_exhauste... function test_get_response_with_retry_caps_conversation_locked_compatibility_retries (line 1136) | async def test_get_response_with_retry_caps_conversation_locked_compatib... function test_get_response_with_retry_prefers_retry_after_over_backoff (line 1173) | async def test_get_response_with_retry_prefers_retry_after_over_backoff(... function test_get_response_with_retry_honors_provider_hard_veto (line 1217) | async def test_get_response_with_retry_honors_provider_hard_veto() -> None: function test_get_response_with_retry_allows_custom_policy_to_override_provider_veto (line 1250) | async def test_get_response_with_retry_allows_custom_policy_to_override_... function test_retry_policies_any_merges_later_positive_metadata (line 1304) | async def test_retry_policies_any_merges_later_positive_metadata() -> None: function test_get_response_with_retry_honors_unsafe_replay_veto (line 1329) | async def test_get_response_with_retry_honors_unsafe_replay_veto() -> None: function test_stream_response_with_retry_retries_before_first_event (line 1360) | async def test_stream_response_with_retry_retries_before_first_event(mon... function test_stream_response_with_retry_keeps_provider_retries_on_first_attempt (line 1411) | async def test_stream_response_with_retry_keeps_provider_retries_on_firs... function test_stream_response_with_retry_disables_provider_retries_on_first_stateful_provider_hint (line 1457) | async def test_stream_response_with_retry_disables_provider_retries_on_f... function test_stream_response_with_retry_disables_stateful_provider_retries_with_narrow_policy (line 1506) | async def test_stream_response_with_retry_disables_stateful_provider_ret... function test_stream_response_with_retry_keeps_provider_retries_without_runner_policy (line 1550) | async def test_stream_response_with_retry_keeps_provider_retries_without... function test_get_response_with_retry_disables_websocket_pre_event_retries_when_runner_managed (line 1594) | async def test_get_response_with_retry_disables_websocket_pre_event_retr... function test_stream_response_with_retry_keeps_websocket_pre_event_retries_with_unrelated_policy (line 1636) | async def test_stream_response_with_retry_keeps_websocket_pre_event_retr... function test_stream_response_with_retry_keeps_websocket_pre_event_retries_for_partial_all_policy (line 1680) | async def test_stream_response_with_retry_keeps_websocket_pre_event_retr... function test_get_response_with_retry_disables_websocket_pre_event_retries_when_disabled (line 1727) | async def test_get_response_with_retry_disables_websocket_pre_event_retr... function test_stream_response_with_retry_does_not_leak_provider_retry_disable_to_consumer (line 1764) | async def test_stream_response_with_retry_does_not_leak_provider_retry_d... function test_stream_response_with_retry_treats_timeout_error_as_retryable (line 1809) | async def test_stream_response_with_retry_treats_timeout_error_as_retrya... function test_stream_response_with_retry_allows_stateful_retry_when_provider_marks_safe (line 1854) | async def test_stream_response_with_retry_allows_stateful_retry_when_pro... function test_stream_response_with_retry_allows_stateful_retry_for_http_failure_advice (line 1907) | async def test_stream_response_with_retry_allows_stateful_retry_for_http... function test_stream_response_with_retry_allows_custom_policy_to_override_provider_veto (line 1957) | async def test_stream_response_with_retry_allows_custom_policy_to_overri... function test_stream_response_with_retry_rejects_stateful_retry_without_replay_safety (line 2011) | async def test_stream_response_with_retry_rejects_stateful_retry_without... function test_stream_response_with_retry_stops_after_retry_budget_exhausted (line 2045) | async def test_stream_response_with_retry_stops_after_retry_budget_exhau... function test_stream_response_with_retry_retries_after_pre_output_event (line 2092) | async def test_stream_response_with_retry_retries_after_pre_output_event... function test_stream_response_with_retry_does_not_retry_after_output_event (line 2146) | async def test_stream_response_with_retry_does_not_retry_after_output_ev... function test_stream_response_with_retry_closes_abandoned_stream_before_retry (line 2180) | async def test_stream_response_with_retry_closes_abandoned_stream_before... function test_stream_response_with_retry_preserves_conversation_locked_compatibility (line 2227) | async def test_stream_response_with_retry_preserves_conversation_locked_... function test_stream_response_with_retry_disables_provider_retries_on_stateful_compat_replay (line 2279) | async def test_stream_response_with_retry_disables_provider_retries_on_s... function test_stream_response_with_retry_closes_current_stream_when_consumer_stops_early (line 2328) | async def test_stream_response_with_retry_closes_current_stream_when_con... FILE: tests/test_openai_chatcompletions.py function test_get_response_with_text_message (line 49) | async def test_get_response_with_text_message(monkeypatch) -> None: function test_get_response_attaches_logprobs (line 109) | async def test_get_response_attaches_logprobs(monkeypatch) -> None: function test_get_response_with_refusal (line 168) | async def test_get_response_with_refusal(monkeypatch) -> None: function test_get_response_with_tool_call (line 217) | async def test_get_response_with_tool_call(monkeypatch) -> None: function test_get_client_disables_provider_managed_retries_on_runner_retry (line 266) | def test_get_client_disables_provider_managed_retries_on_runner_retry() ... function test_get_response_with_no_message (line 289) | async def test_get_response_with_no_message(monkeypatch) -> None: function test_fetch_response_non_stream (line 324) | async def test_fetch_response_non_stream(monkeypatch) -> None: function test_fetch_response_stream (line 388) | async def test_fetch_response_stream(monkeypatch) -> None: function test_store_param (line 441) | def test_store_param(): function test_get_retry_advice_uses_openai_headers (line 461) | def test_get_retry_advice_uses_openai_headers() -> None: function test_get_retry_advice_keeps_stateful_transport_failures_ambiguous (line 496) | def test_get_retry_advice_keeps_stateful_transport_failures_ambiguous() ... function test_get_retry_advice_marks_stateful_http_failures_replay_safe (line 519) | def test_get_retry_advice_marks_stateful_http_failures_replay_safe() -> ... function test_get_client_disables_provider_managed_retries_when_requested (line 547) | def test_get_client_disables_provider_managed_retries_when_requested() -... function test_user_agent_header_chat_completions (line 570) | async def test_user_agent_header_chat_completions(override_ua): FILE: tests/test_openai_chatcompletions_converter.py function test_message_to_output_items_with_text_only (line 50) | def test_message_to_output_items_with_text_only(): function test_message_to_output_items_with_refusal (line 71) | def test_message_to_output_items_with_refusal(): function test_message_to_output_items_with_tool_call (line 86) | def test_message_to_output_items_with_tool_call(): function test_items_to_messages_with_string_user_content (line 111) | def test_items_to_messages_with_string_user_content(): function test_items_to_messages_with_easy_input_message (line 124) | def test_items_to_messages_with_easy_input_message(): function test_items_to_messages_with_output_message_and_function_call (line 143) | def test_items_to_messages_with_output_message_and_function_call(): function test_convert_tool_choice_handles_standard_and_named_options (line 201) | def test_convert_tool_choice_handles_standard_and_named_options() -> None: function test_convert_tool_choice_allows_tool_search_as_named_function_for_chat_models (line 218) | def test_convert_tool_choice_allows_tool_search_as_named_function_for_ch... function test_convert_response_format_returns_not_given_for_plain_text_and_dict_for_schemas (line 225) | def test_convert_response_format_returns_not_given_for_plain_text_and_di... function test_items_to_messages_with_function_output_item (line 248) | def test_items_to_messages_with_function_output_item(): function test_extract_all_and_text_content_for_strings_and_lists (line 266) | def test_extract_all_and_text_content_for_strings_and_lists(): function test_extract_all_content_handles_input_audio (line 292) | def test_extract_all_content_handles_input_audio(): function test_extract_all_content_rejects_invalid_input_audio (line 310) | def test_extract_all_content_rejects_invalid_input_audio(): function test_items_to_messages_handles_system_and_developer_roles (line 325) | def test_items_to_messages_handles_system_and_developer_roles(): function test_maybe_input_message_allows_message_typed_dict (line 343) | def test_maybe_input_message_allows_message_typed_dict(): function test_tool_call_conversion (line 363) | def test_tool_call_conversion(): function test_input_message_with_all_roles (line 395) | def test_input_message_with_all_roles(role: str): function test_item_reference_errors (line 416) | def test_item_reference_errors(): class TestObject (line 431) | class TestObject: function test_unknown_object_errors (line 435) | def test_unknown_object_errors(): function test_assistant_messages_in_history (line 444) | def test_assistant_messages_in_history(): FILE: tests/test_openai_chatcompletions_stream.py function test_stream_response_yields_events_for_text_content (line 38) | async def test_stream_response_yields_events_for_text_content(monkeypatc... function test_stream_response_includes_logprobs (line 139) | async def test_stream_response_includes_logprobs(monkeypatch) -> None: function test_stream_response_yields_events_for_refusal_content (line 246) | async def test_stream_response_yields_events_for_refusal_content(monkeyp... function test_stream_response_yields_events_for_tool_call (line 326) | async def test_stream_response_yields_events_for_tool_call(monkeypatch) ... function test_stream_response_yields_real_time_function_call_arguments (line 421) | async def test_stream_response_yields_real_time_function_call_arguments(... FILE: tests/test_openai_conversations_session.py function mock_openai_client (line 19) | def mock_openai_client(): function agent (line 39) | def agent() -> Agent: class TestStartOpenAIConversationsSession (line 44) | class TestStartOpenAIConversationsSession: method test_start_with_provided_client (line 48) | async def test_start_with_provided_client(self, mock_openai_client): method test_start_with_none_client (line 56) | async def test_start_with_none_client(self): method test_start_with_none_client_fallback (line 76) | async def test_start_with_none_client_fallback(self): class TestOpenAIConversationsSessionConstructor (line 100) | class TestOpenAIConversationsSessionConstructor: method test_init_with_conversation_id_and_client (line 103) | def test_init_with_conversation_id_and_client(self, mock_openai_client): method test_init_with_conversation_id_only (line 112) | def test_init_with_conversation_id_only(self): method test_init_with_client_only (line 127) | def test_init_with_client_only(self, mock_openai_client): method test_init_with_no_args_fallback (line 134) | def test_init_with_no_args_fallback(self): class TestOpenAIConversationsSessionLifecycle (line 155) | class TestOpenAIConversationsSessionLifecycle: method test_get_session_id_with_existing_id (line 159) | async def test_get_session_id_with_existing_id(self, mock_openai_client): method test_get_session_id_creates_new_conversation (line 172) | async def test_get_session_id_creates_new_conversation(self, mock_open... method test_clear_session_id (line 183) | async def test_clear_session_id(self, mock_openai_client): class TestOpenAIConversationsSessionBasicOperations (line 194) | class TestOpenAIConversationsSessionBasicOperations: method test_add_items_simple (line 198) | async def test_add_items_simple(self, mock_openai_client): method test_add_items_creates_session_id (line 216) | async def test_add_items_creates_session_id(self, mock_openai_client): method test_pop_item_with_items (line 232) | async def test_pop_item_with_items(self, mock_openai_client): method test_pop_item_empty_session (line 250) | async def test_pop_item_empty_session(self, mock_openai_client): method test_clear_session (line 264) | async def test_clear_session(self, mock_openai_client): method test_clear_session_creates_session_id_first (line 277) | async def test_clear_session_creates_session_id_first(self, mock_opena... class TestOpenAIConversationsSessionRunnerIntegration (line 291) | class TestOpenAIConversationsSessionRunnerIntegration: method test_runner_integration_basic (line 295) | async def test_runner_integration_basic(self, agent: Agent, mock_opena... method test_runner_with_conversation_history (line 316) | async def test_runner_with_conversation_history(self, agent: Agent, mo... class TestOpenAIConversationsSessionErrorHandling (line 345) | class TestOpenAIConversationsSessionErrorHandling: method test_api_failure_during_conversation_creation (line 349) | async def test_api_failure_during_conversation_creation(self, mock_ope... method test_api_failure_during_add_items (line 360) | async def test_api_failure_during_add_items(self, mock_openai_client): method test_api_failure_during_clear_session (line 374) | async def test_api_failure_during_clear_session(self, mock_openai_clie... method test_invalid_item_id_in_pop_item (line 386) | async def test_invalid_item_id_in_pop_item(self, mock_openai_client): class TestOpenAIConversationsSessionConcurrentAccess (line 401) | class TestOpenAIConversationsSessionConcurrentAccess: method test_multiple_sessions_different_conversation_ids (line 405) | async def test_multiple_sessions_different_conversation_ids(self, mock... method test_session_id_lazy_creation_consistency (line 432) | async def test_session_id_lazy_creation_consistency(self, mock_openai_... class TestOpenAIConversationsSessionSettings (line 453) | class TestOpenAIConversationsSessionSettings: method test_session_settings_default (line 456) | def test_session_settings_default(self, mock_openai_client): method test_session_settings_constructor (line 466) | def test_session_settings_constructor(self, mock_openai_client): FILE: tests/test_openai_responses.py class DummyWSConnection (line 41) | class DummyWSConnection: method __init__ (line 42) | def __init__(self, frames: list[str]): method send (line 48) | async def send(self, payload: str) -> None: method recv (line 51) | async def recv(self) -> str: method close (line 56) | async def close(self) -> None: class DummyWSClient (line 62) | class DummyWSClient: method __init__ (line 63) | def __init__(self): method _refresh_api_key (line 74) | async def _refresh_api_key(self) -> None: function _response_event_frame (line 78) | def _response_event_frame(event_type: str, response_id: str, sequence_nu... function _response_completed_frame (line 90) | def _response_completed_frame(response_id: str, sequence_number: int) ->... function _response_error_frame (line 94) | def _response_error_frame(code: str, message: str, sequence_number: int)... function _connection_closed_error (line 104) | def _connection_closed_error(message: str) -> Exception: function test_user_agent_header_responses (line 115) | async def test_user_agent_header_responses(override_ua: str | None): function test_get_response_exposes_request_id (line 169) | async def test_get_response_exposes_request_id(): function test_get_client_disables_provider_managed_retries_on_runner_retry (line 196) | def test_get_client_disables_provider_managed_retries_on_runner_retry() ... function test_fetch_response_stream_attaches_request_id_to_terminal_response (line 218) | async def test_fetch_response_stream_attaches_request_id_to_terminal_res... function test_fetch_response_stream_parse_failure_exits_streaming_context (line 304) | async def test_fetch_response_stream_parse_failure_exits_streaming_conte... function test_fetch_response_stream_without_request_id_still_returns_events (line 359) | async def test_fetch_response_stream_without_request_id_still_returns_ev... function test_stream_response_ignores_streaming_context_exit_failure_after_terminal_event (line 444) | async def test_stream_response_ignores_streaming_context_exit_failure_af... function test_stream_response_close_closes_inner_http_stream_with_async_close (line 513) | async def test_stream_response_close_closes_inner_http_stream_with_async... function test_stream_response_normal_exhaustion_closes_inner_http_stream (line 566) | async def test_stream_response_normal_exhaustion_closes_inner_http_strea... function test_stream_response_ignores_inner_close_failure_after_terminal_event (line 617) | async def test_stream_response_ignores_inner_close_failure_after_termina... function test_stream_response_cancellation_does_not_block_on_inner_stream_close (line 669) | async def test_stream_response_cancellation_does_not_block_on_inner_stre... function test_build_response_create_kwargs_rejects_duplicate_extra_args_keys (line 726) | def test_build_response_create_kwargs_rejects_duplicate_extra_args_keys(): function test_build_response_create_kwargs_preserves_unknown_response_include_values (line 746) | def test_build_response_create_kwargs_preserves_unknown_response_include... function test_build_response_create_kwargs_preserves_unknown_tool_types (line 767) | def test_build_response_create_kwargs_preserves_unknown_tool_types(monke... function test_prompt_id_omits_model_parameter (line 799) | async def test_prompt_id_omits_model_parameter(): function test_prompt_id_omits_tools_parameter_when_no_tools_configured (line 835) | async def test_prompt_id_omits_tools_parameter_when_no_tools_configured(): function test_prompt_id_omits_tool_choice_when_no_tools_configured (line 870) | async def test_prompt_id_omits_tool_choice_when_no_tools_configured(): function test_prompt_id_keeps_literal_tool_choice_without_local_tools (line 907) | async def test_prompt_id_keeps_literal_tool_choice_without_local_tools(t... function test_prompt_id_keeps_explicit_tool_search_without_local_surface (line 943) | async def test_prompt_id_keeps_explicit_tool_search_without_local_surfac... function test_ga_computer_tool_does_not_require_preview_metadata (line 979) | async def test_ga_computer_tool_does_not_require_preview_metadata() -> N... function test_prompt_id_uses_preview_computer_payload_when_prompt_owns_model (line 1042) | async def test_prompt_id_uses_preview_computer_payload_when_prompt_owns_... function test_prompt_id_computer_without_preview_metadata_raises_clear_error (line 1122) | async def test_prompt_id_computer_without_preview_metadata_raises_clear_... function test_prompt_id_unresolved_computer_uses_preview_payload_shape (line 1189) | async def test_prompt_id_unresolved_computer_uses_preview_payload_shape(... function test_prompt_id_explicit_ga_computer_tool_choice_uses_ga_selector_and_tool (line 1262) | async def test_prompt_id_explicit_ga_computer_tool_choice_uses_ga_select... function test_preview_model_forced_computer_tool_choice_uses_preview_selector (line 1338) | async def test_preview_model_forced_computer_tool_choice_uses_preview_se... function test_websocket_model_reuses_connection_and_sends_response_create_frames (line 1418) | async def test_websocket_model_reuses_connection_and_sends_response_crea... function test_websocket_model_reconnects_when_reused_from_different_event_loop (line 1471) | def test_websocket_model_reconnects_when_reused_from_different_event_loo... function test_websocket_model_init_lazily_creates_request_lock (line 1518) | def test_websocket_model_init_lazily_creates_request_lock(monkeypatch): function test_websocket_model_stream_response_yields_typed_events (line 1533) | async def test_websocket_model_stream_response_yields_typed_events(monke... function test_websocket_model_get_response_accepts_terminal_response_payload_events (line 1565) | async def test_websocket_model_get_response_accepts_terminal_response_pa... function test_websocket_model_stream_response_accepts_terminal_response_payload_events (line 1595) | async def test_websocket_model_stream_response_accepts_terminal_response... function test_websocket_model_get_response_surfaces_response_error_event (line 1628) | async def test_websocket_model_get_response_surfaces_response_error_even... function test_websocket_model_stream_response_raises_on_response_error_event (line 1660) | async def test_websocket_model_stream_response_raises_on_response_error_... function test_websocket_model_stream_break_drops_persistent_connection (line 1690) | async def test_websocket_model_stream_break_drops_persistent_connection(... function test_websocket_model_stream_close_after_terminal_event_preserves_persistent_connection (line 1730) | async def test_websocket_model_stream_close_after_terminal_event_preserv... function test_websocket_model_stream_response_terminal_close_keeps_connection (line 1790) | async def test_websocket_model_stream_response_terminal_close_keeps_conn... function test_websocket_model_stream_response_close_releases_inner_iterator (line 1846) | async def test_websocket_model_stream_response_close_releases_inner_iter... function test_websocket_model_stream_response_non_terminal_close_does_not_await_close_handshake (line 1886) | async def test_websocket_model_stream_response_non_terminal_close_does_n... function test_websocket_model_cancellation_drops_persistent_connection (line 1954) | async def test_websocket_model_cancellation_drops_persistent_connection(... function test_websocket_model_cancellation_does_not_await_close_handshake (line 1987) | async def test_websocket_model_cancellation_does_not_await_close_handsha... function test_websocket_model_preserves_pre_event_usererror (line 2054) | async def test_websocket_model_preserves_pre_event_usererror(monkeypatch): function test_websocket_model_preserves_pre_event_server_error_frame_message (line 2079) | async def test_websocket_model_preserves_pre_event_server_error_frame_me... function test_websocket_model_reconnects_if_cached_connection_is_closed (line 2119) | async def test_websocket_model_reconnects_if_cached_connection_is_closed... function test_websocket_model_does_not_retry_if_send_raises_after_writing_on_reused_connection (line 2170) | async def test_websocket_model_does_not_retry_if_send_raises_after_writi... function test_websocket_model_does_not_retry_after_pre_event_disconnect_once_request_sent (line 2238) | async def test_websocket_model_does_not_retry_after_pre_event_disconnect... function test_websocket_model_does_not_retry_after_client_initiated_close (line 2297) | async def test_websocket_model_does_not_retry_after_client_initiated_clo... function test_websocket_model_prepare_websocket_url_preserves_non_tls_scheme_mapping (line 2372) | def test_websocket_model_prepare_websocket_url_preserves_non_tls_scheme_... function test_websocket_model_prepare_websocket_url_appends_path_with_existing_query (line 2383) | def test_websocket_model_prepare_websocket_url_appends_path_with_existin... function test_websocket_model_prepare_websocket_url_normalizes_explicit_http_schemes (line 2403) | def test_websocket_model_prepare_websocket_url_normalizes_explicit_http_... function test_websocket_model_prepare_websocket_url_treats_top_level_omit_sentinels_as_absent (line 2420) | def test_websocket_model_prepare_websocket_url_treats_top_level_omit_sen... function test_websocket_model_prepare_websocket_url_skips_not_given_query_values (line 2435) | def test_websocket_model_prepare_websocket_url_skips_not_given_query_val... function test_websocket_model_prepare_websocket_request_filters_omit_from_extra_body (line 2450) | async def test_websocket_model_prepare_websocket_request_filters_omit_fr... function test_websocket_model_prepare_websocket_request_ignores_top_level_extra_body_sentinels (line 2471) | async def test_websocket_model_prepare_websocket_request_ignores_top_lev... function test_websocket_model_prepare_websocket_request_preserves_envelope_fields (line 2494) | async def test_websocket_model_prepare_websocket_request_preserves_envel... function test_websocket_model_prepare_websocket_request_strips_client_timeout_kwarg (line 2518) | async def test_websocket_model_prepare_websocket_request_strips_client_t... function test_websocket_model_prepare_websocket_request_skips_not_given_values (line 2539) | async def test_websocket_model_prepare_websocket_request_skips_not_given... function test_websocket_model_get_response_applies_timeout_to_recv (line 2568) | async def test_websocket_model_get_response_applies_timeout_to_recv(monk... function test_websocket_model_get_response_marks_partial_receive_timeout_unsafe_to_replay (line 2602) | async def test_websocket_model_get_response_marks_partial_receive_timeou... function test_websocket_model_get_response_applies_timeout_while_waiting_for_request_lock (line 2659) | async def test_websocket_model_get_response_applies_timeout_while_waitin... function test_websocket_model_get_response_allows_zero_pool_timeout_when_lock_uncontended (line 2721) | async def test_websocket_model_get_response_allows_zero_pool_timeout_whe... function test_websocket_model_get_response_allows_zero_timeout_when_ws_ops_are_immediate (line 2752) | async def test_websocket_model_get_response_allows_zero_timeout_when_ws_... function test_websocket_model_get_response_uses_client_default_timeout_when_no_override (line 2782) | async def test_websocket_model_get_response_uses_client_default_timeout_... function test_websocket_model_get_response_uses_client_default_timeout_when_override_is_not_given (line 2819) | async def test_websocket_model_get_response_uses_client_default_timeout_... function test_websocket_model_prepare_websocket_request_omit_removes_inherited_header (line 2856) | async def test_websocket_model_prepare_websocket_request_omit_removes_in... function test_websocket_model_prepare_websocket_request_replaces_header_case_insensitively (line 2875) | async def test_websocket_model_prepare_websocket_request_replaces_header... function test_websocket_model_prepare_websocket_request_skips_not_given_header_values (line 2899) | async def test_websocket_model_prepare_websocket_request_skips_not_given... function test_websocket_model_prepare_websocket_url_includes_client_default_query (line 2921) | def test_websocket_model_prepare_websocket_url_includes_client_default_q... function test_websocket_model_prepare_websocket_url_omit_removes_inherited_query_params (line 2941) | def test_websocket_model_prepare_websocket_url_omit_removes_inherited_qu... function test_websocket_model_close_closes_persistent_connection (line 2956) | async def test_websocket_model_close_closes_persistent_connection(monkey... function test_websocket_model_close_falls_back_to_transport_abort_on_close_error (line 2985) | async def test_websocket_model_close_falls_back_to_transport_abort_on_cl... function test_websocket_model_close_does_not_wait_for_held_request_lock (line 3016) | async def test_websocket_model_close_does_not_wait_for_held_request_lock(): function test_websocket_model_open_websocket_connection_disables_message_size_limit (line 3056) | async def test_websocket_model_open_websocket_connection_disables_messag... function test_websocket_model_open_websocket_connection_honors_connect_timeout (line 3085) | async def test_websocket_model_open_websocket_connection_honors_connect_... function test_get_retry_advice_uses_openai_headers (line 3109) | def test_get_retry_advice_uses_openai_headers() -> None: function test_get_retry_advice_keeps_stateful_transport_failures_ambiguous (line 3145) | def test_get_retry_advice_keeps_stateful_transport_failures_ambiguous() ... function test_get_retry_advice_marks_stateful_http_failures_replay_safe (line 3169) | def test_get_retry_advice_marks_stateful_http_failures_replay_safe() -> ... function test_get_retry_advice_keeps_stateless_transport_failures_retryable (line 3198) | def test_get_retry_advice_keeps_stateless_transport_failures_retryable()... function test_websocket_get_retry_advice_marks_ambiguous_replay_unsafe (line 3221) | def test_websocket_get_retry_advice_marks_ambiguous_replay_unsafe() -> N... function test_websocket_get_retry_advice_allows_stateless_ambiguous_disconnect_retry (line 3241) | def test_websocket_get_retry_advice_allows_stateless_ambiguous_disconnec... function test_websocket_get_retry_advice_keeps_wrapped_pre_send_disconnect_safe (line 3260) | def test_websocket_get_retry_advice_keeps_wrapped_pre_send_disconnect_sa... function test_websocket_get_retry_advice_allows_stateless_wrapped_post_send_disconnect_retry (line 3283) | def test_websocket_get_retry_advice_allows_stateless_wrapped_post_send_d... function test_websocket_get_retry_advice_allows_stateless_nonstream_post_send_retry (line 3305) | def test_websocket_get_retry_advice_allows_stateless_nonstream_post_send... function test_websocket_get_retry_advice_marks_wrapped_post_send_disconnect_unsafe (line 3327) | def test_websocket_get_retry_advice_marks_wrapped_post_send_disconnect_u... function test_websocket_get_retry_advice_marks_partial_nonstream_failure_unsafe (line 3350) | def test_websocket_get_retry_advice_marks_partial_nonstream_failure_unsa... function test_websocket_get_retry_advice_marks_connect_timeout_replay_safe (line 3370) | def test_websocket_get_retry_advice_marks_connect_timeout_replay_safe() ... function test_websocket_get_retry_advice_marks_request_lock_timeout_replay_safe (line 3389) | def test_websocket_get_retry_advice_marks_request_lock_timeout_replay_sa... function test_websocket_get_retry_advice_marks_stateful_receive_timeout_unsafe (line 3408) | def test_websocket_get_retry_advice_marks_stateful_receive_timeout_unsaf... function test_websocket_get_retry_advice_allows_stateless_receive_timeout_retry (line 3427) | def test_websocket_get_retry_advice_allows_stateless_receive_timeout_ret... function test_get_client_disables_provider_managed_retries_when_requested (line 3444) | def test_get_client_disables_provider_managed_retries_when_requested() -... function test_websocket_pre_event_disconnect_retry_respects_websocket_retry_disable (line 3464) | def test_websocket_pre_event_disconnect_retry_respects_websocket_retry_d... FILE: tests/test_openai_responses_converter.py class DummyComputer (line 53) | class DummyComputer(Computer): method environment (line 55) | def environment(self): method dimensions (line 59) | def dimensions(self): method screenshot (line 62) | def screenshot(self) -> str: method click (line 65) | def click(self, x: int, y: int, button: str) -> None: method double_click (line 68) | def double_click(self, x: int, y: int) -> None: method scroll (line 71) | def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: method type (line 74) | def type(self, text: str) -> None: method wait (line 77) | def wait(self) -> None: method move (line 80) | def move(self, x: int, y: int) -> None: method keypress (line 83) | def keypress(self, keys: list[str]) -> None: method drag (line 86) | def drag(self, path: list[tuple[int, int]]) -> None: function test_convert_tool_choice_standard_values (line 90) | def test_convert_tool_choice_standard_values(): function test_convert_tool_choice_computer_variants_follow_effective_model (line 110) | def test_convert_tool_choice_computer_variants_follow_effective_model() ... function test_convert_tool_choice_allows_function_named_computer_without_computer_tool (line 155) | def test_convert_tool_choice_allows_function_named_computer_without_comp... function test_convert_tool_choice_allows_function_named_tool_search (line 169) | def test_convert_tool_choice_allows_function_named_tool_search() -> None: function test_convert_tool_choice_rejects_hosted_tool_search_choice (line 178) | def test_convert_tool_choice_rejects_hosted_tool_search_choice() -> None: function test_convert_tool_choice_rejects_tool_search_without_matching_definition (line 189) | def test_convert_tool_choice_rejects_tool_search_without_matching_defini... function test_convert_tool_choice_allows_function_named_tool_search_with_hosted_tool_search (line 203) | def test_convert_tool_choice_allows_function_named_tool_search_with_host... function test_convert_tool_choice_required_allows_eager_namespace_tools_without_tool_search (line 220) | def test_convert_tool_choice_required_allows_eager_namespace_tools_witho... function test_convert_tool_choice_required_allows_eager_namespace_tools_with_tool_search (line 230) | def test_convert_tool_choice_required_allows_eager_namespace_tools_with_... function test_convert_tool_choice_required_rejects_deferred_function_tools (line 243) | def test_convert_tool_choice_required_rejects_deferred_function_tools() ... function test_convert_tool_choice_required_allows_deferred_function_tools_with_tool_search (line 256) | def test_convert_tool_choice_required_allows_deferred_function_tools_wit... function test_convert_tool_choice_required_allows_deferred_hosted_mcp_tools_with_tool_search (line 269) | def test_convert_tool_choice_required_allows_deferred_hosted_mcp_tools_w... function test_convert_tool_choice_allows_qualified_namespaced_function_tools (line 288) | def test_convert_tool_choice_allows_qualified_namespaced_function_tools(... function test_convert_tool_choice_rejects_namespace_wrapper_and_bare_inner_name (line 301) | def test_convert_tool_choice_rejects_namespace_wrapper_and_bare_inner_na... function test_convert_tool_choice_allows_top_level_function_with_namespaced_tools_present (line 315) | def test_convert_tool_choice_allows_top_level_function_with_namespaced_t... function test_convert_tool_choice_allows_handoff_with_namespaced_function_name_clash (line 329) | def test_convert_tool_choice_allows_handoff_with_namespaced_function_nam... function test_convert_tool_choice_rejects_deferred_only_function_tools (line 344) | def test_convert_tool_choice_rejects_deferred_only_function_tools() -> N... function test_convert_tool_choice_allows_visible_top_level_function_with_deferred_peer (line 355) | def test_convert_tool_choice_allows_visible_top_level_function_with_defe... function test_get_response_format_plain_text_and_json_schema (line 369) | def test_get_response_format_plain_text_and_json_schema(): function test_convert_tools_basic_types_and_includes (line 400) | def test_convert_tools_basic_types_and_includes(): function test_convert_tools_uses_preview_computer_payload_for_preview_model (line 453) | def test_convert_tools_uses_preview_computer_payload_for_preview_model()... function test_convert_tools_prompt_managed_computer_defaults_to_preview_payload (line 472) | def test_convert_tools_prompt_managed_computer_defaults_to_preview_paylo... function test_convert_tools_shell_local_environment (line 491) | def test_convert_tools_shell_local_environment() -> None: function test_convert_tools_shell_container_reference_environment (line 500) | def test_convert_tools_shell_container_reference_environment() -> None: function test_convert_tools_shell_container_auto_environment (line 516) | def test_convert_tools_shell_container_auto_environment() -> None: function test_convert_tools_tool_search_and_namespaces (line 581) | def test_convert_tools_tool_search_and_namespaces() -> None: function test_convert_tools_top_level_deferred_function_requires_tool_search (line 631) | def test_convert_tools_top_level_deferred_function_requires_tool_search(... function test_convert_tools_rejects_tool_search_without_deferred_function (line 642) | def test_convert_tools_rejects_tool_search_without_deferred_function() -... function test_convert_tools_allows_prompt_managed_tool_search_without_local_surface (line 652) | def test_convert_tools_allows_prompt_managed_tool_search_without_local_s... function test_convert_tools_rejects_duplicate_tool_search_tools (line 662) | def test_convert_tools_rejects_duplicate_tool_search_tools() -> None: function test_convert_tools_top_level_deferred_function_with_tool_search (line 676) | def test_convert_tools_top_level_deferred_function_with_tool_search() ->... function test_convert_tools_preserves_tool_search_config_fields (line 698) | def test_convert_tools_preserves_tool_search_config_fields() -> None: function test_convert_tools_allows_client_executed_tool_search_for_manual_flows (line 735) | def test_convert_tools_allows_client_executed_tool_search_for_manual_flo... function test_convert_tools_namespace_only_allows_eager_namespaces_without_tool_search (line 768) | def test_convert_tools_namespace_only_allows_eager_namespaces_without_to... function test_convert_tools_allows_tool_search_with_namespace_only_tools (line 800) | def test_convert_tools_allows_tool_search_with_namespace_only_tools() ->... function test_convert_tools_deferred_hosted_mcp_requires_tool_search (line 834) | def test_convert_tools_deferred_hosted_mcp_requires_tool_search() -> None: function test_convert_tools_deferred_hosted_mcp_with_tool_search (line 851) | def test_convert_tools_deferred_hosted_mcp_with_tool_search() -> None: function test_convert_tools_rejects_reserved_same_name_namespace_shape (line 877) | def test_convert_tools_rejects_reserved_same_name_namespace_shape() -> N... function test_convert_tools_rejects_qualified_name_collision_with_dotted_top_level_tool (line 889) | def test_convert_tools_rejects_qualified_name_collision_with_dotted_top_... function test_convert_tools_rejects_duplicate_deferred_top_level_names (line 907) | def test_convert_tools_rejects_duplicate_deferred_top_level_names() -> N... function test_convert_tools_allows_dotted_non_function_tool_name_with_namespaced_function (line 926) | def test_convert_tools_allows_dotted_non_function_tool_name_with_namespa... function test_convert_tools_shell_environment_passes_through_unknown_fields (line 961) | def test_convert_tools_shell_environment_passes_through_unknown_fields()... function test_convert_tools_includes_handoffs (line 992) | def test_convert_tools_includes_handoffs(): function test_convert_tools_accepts_unresolved_computer_initializer (line 1010) | def test_convert_tools_accepts_unresolved_computer_initializer(): function test_resolve_computer_tool_model_returns_none_when_request_model_is_omitted (line 1016) | def test_resolve_computer_tool_model_returns_none_when_request_model_is_... function test_convert_tools_preview_tool_choice_uses_ga_payload_for_ga_model (line 1027) | def test_convert_tools_preview_tool_choice_uses_ga_payload_for_ga_model(... function test_convert_tools_prompt_managed_computer_respects_explicit_ga_tool_choice (line 1040) | def test_convert_tools_prompt_managed_computer_respects_explicit_ga_tool... function test_convert_tools_prompt_managed_computer_accepts_mcp_tool_choice (line 1053) | def test_convert_tools_prompt_managed_computer_accepts_mcp_tool_choice()... FILE: tests/test_output_tool.py function test_plain_text_output (line 20) | def test_plain_text_output(): class Foo (line 29) | class Foo(BaseModel): function test_structured_output_pydantic (line 33) | def test_structured_output_pydantic(): class Bar (line 49) | class Bar(TypedDict): function test_structured_output_typed_dict (line 53) | def test_structured_output_typed_dict(): function test_structured_output_list (line 66) | def test_structured_output_list(): function test_bad_json_raises_error (line 80) | def test_bad_json_raises_error(mocker): function test_plain_text_obj_doesnt_produce_schema (line 104) | def test_plain_text_obj_doesnt_produce_schema(): function test_structured_output_is_strict (line 110) | def test_structured_output_is_strict(): function test_setting_strict_false_works (line 122) | def test_setting_strict_false_works(): class CustomOutputSchema (line 138) | class CustomOutputSchema(AgentOutputSchemaBase): method is_plain_text (line 139) | def is_plain_text(self) -> bool: method name (line 142) | def name(self) -> str: method json_schema (line 145) | def json_schema(self) -> dict[str, Any]: method is_strict_json_schema (line 148) | def is_strict_json_schema(self) -> bool: method validate_json (line 151) | def validate_json(self, json_str: str) -> Any: function test_custom_output_schema (line 155) | def test_custom_output_schema(): FILE: tests/test_pr_labels.py function load_pr_labels_module (line 10) | def load_pr_labels_module() -> Any: function test_infer_fallback_labels_for_chat_completions (line 25) | def test_infer_fallback_labels_for_chat_completions() -> None: function test_infer_fallback_labels_ignores_tests_only_feature_touches (line 31) | def test_infer_fallback_labels_ignores_tests_only_feature_touches() -> N... function test_infer_fallback_labels_marks_core_for_runtime_changes (line 37) | def test_infer_fallback_labels_marks_core_for_runtime_changes() -> None: function test_infer_fallback_labels_marks_sessions_for_extensions_memory_changes (line 43) | def test_infer_fallback_labels_marks_sessions_for_extensions_memory_chan... function test_compute_desired_labels_removes_stale_fallback_labels (line 51) | def test_compute_desired_labels_removes_stale_fallback_labels() -> None: function test_compute_desired_labels_falls_back_when_codex_output_is_invalid (line 66) | def test_compute_desired_labels_falls_back_when_codex_output_is_invalid(... function test_compute_desired_labels_uses_fallback_feature_labels_when_codex_valid_but_empty (line 81) | def test_compute_desired_labels_uses_fallback_feature_labels_when_codex_... function test_compute_desired_labels_infers_bug_from_fix_title (line 96) | def test_compute_desired_labels_infers_bug_from_fix_title() -> None: function test_compute_desired_labels_infers_sessions_for_extensions_memory_fix (line 111) | def test_compute_desired_labels_infers_sessions_for_extensions_memory_fi... function test_compute_managed_labels_preserves_model_only_labels_without_signal (line 129) | def test_compute_managed_labels_preserves_model_only_labels_without_sign... function test_compute_managed_labels_manages_model_only_labels_with_fix_title (line 142) | def test_compute_managed_labels_manages_model_only_labels_with_fix_title... FILE: tests/test_pretty_print.py function test_pretty_result (line 16) | async def test_pretty_result(): function test_pretty_run_result_streaming (line 37) | async def test_pretty_run_result_streaming(): class Foo (line 62) | class Foo(BaseModel): function test_pretty_run_result_structured_output (line 67) | async def test_pretty_run_result_structured_output(): function test_pretty_run_result_streaming_structured_output (line 95) | async def test_pretty_run_result_streaming_structured_output(): function test_pretty_run_result_list_structured_output (line 129) | async def test_pretty_run_result_list_structured_output(): function test_pretty_run_result_streaming_list_structured_output (line 164) | async def test_pretty_run_result_streaming_list_structured_output(): FILE: tests/test_process_model_response.py function _response (line 54) | def _response(output: list[object]) -> ModelResponse: function _make_hosted_mcp_list_tools (line 60) | def _make_hosted_mcp_list_tools(server_label: str, tool_name: str) -> Mc... function test_process_model_response_shell_call_without_tool_raises (line 76) | def test_process_model_response_shell_call_without_tool_raises() -> None: function test_process_model_response_sets_title_for_local_mcp_function_tool (line 90) | def test_process_model_response_sets_title_for_local_mcp_function_tool()... function test_process_model_response_uses_mcp_list_tools_metadata_for_hosted_mcp_calls (line 121) | def test_process_model_response_uses_mcp_list_tools_metadata_for_hosted_... function test_process_model_response_skips_local_shell_execution_for_hosted_environment (line 164) | def test_process_model_response_skips_local_shell_execution_for_hosted_e... function test_process_model_response_sanitizes_shell_call_model_object (line 183) | def test_process_model_response_sanitizes_shell_call_model_object() -> N... function test_process_model_response_preserves_shell_call_output (line 217) | def test_process_model_response_preserves_shell_call_output() -> None: function test_process_model_response_sanitizes_shell_call_output_model_object (line 249) | def test_process_model_response_sanitizes_shell_call_output_model_object... function test_process_model_response_apply_patch_call_without_tool_raises (line 301) | def test_process_model_response_apply_patch_call_without_tool_raises() -... function test_process_model_response_sanitizes_apply_patch_call_model_object (line 315) | def test_process_model_response_sanitizes_apply_patch_call_model_object(... function test_process_model_response_converts_custom_apply_patch_call (line 357) | def test_process_model_response_converts_custom_apply_patch_call() -> None: function test_process_model_response_prefers_namespaced_function_over_apply_patch_fallback (line 377) | def test_process_model_response_prefers_namespaced_function_over_apply_p... function test_process_model_response_handles_compaction_item (line 407) | def test_process_model_response_handles_compaction_item() -> None: function test_process_model_response_classifies_tool_search_items (line 433) | def test_process_model_response_classifies_tool_search_items() -> None: function test_process_model_response_uses_namespace_for_duplicate_function_names (line 487) | def test_process_model_response_uses_namespace_for_duplicate_function_na... function test_process_model_response_collapses_synthetic_deferred_namespace_in_tools_used (line 524) | def test_process_model_response_collapses_synthetic_deferred_namespace_i... function test_process_model_response_rejects_bare_name_for_duplicate_namespaced_functions (line 553) | def test_process_model_response_rejects_bare_name_for_duplicate_namespac... function test_process_model_response_uses_last_duplicate_top_level_function (line 581) | def test_process_model_response_uses_last_duplicate_top_level_function()... function test_process_model_response_rejects_reserved_same_name_namespace_shape (line 599) | def test_process_model_response_rejects_reserved_same_name_namespace_sha... function test_process_model_response_rejects_qualified_name_collision_with_dotted_top_level_tool (line 624) | def test_process_model_response_rejects_qualified_name_collision_with_do... function test_process_model_response_prefers_visible_top_level_function_over_deferred_same_name_tool (line 657) | def test_process_model_response_prefers_visible_top_level_function_over_... function test_process_model_response_uses_internal_lookup_key_for_deferred_top_level_calls (line 687) | def test_process_model_response_uses_internal_lookup_key_for_deferred_to... function test_process_model_response_preserves_synthetic_namespace_for_deferred_top_level_tools (line 720) | def test_process_model_response_preserves_synthetic_namespace_for_deferr... function test_process_model_response_prefers_namespaced_function_over_handoff_name_collision (line 748) | def test_process_model_response_prefers_namespaced_function_over_handoff... function test_process_model_response_rejects_mismatched_function_namespace (line 784) | def test_process_model_response_rejects_mismatched_function_namespace() ... FILE: tests/test_reasoning_content.py function create_content_delta (line 28) | def create_content_delta(content: str) -> dict[str, Any]: function create_reasoning_delta (line 33) | def create_reasoning_delta(content: str) -> dict[str, Any]: function create_chunk (line 44) | def create_chunk(delta: dict[str, Any], include_usage: bool = False) -> ... function create_fake_stream (line 81) | async def create_fake_stream( function test_stream_response_yields_events_for_reasoning_content (line 90) | async def test_stream_response_yields_events_for_reasoning_content(monke... function test_stream_response_keeps_reasoning_item_open_across_interleaved_text (line 180) | async def test_stream_response_keeps_reasoning_item_open_across_interlea... function test_get_response_with_reasoning_content (line 262) | async def test_get_response_with_reasoning_content(monkeypatch) -> None: function test_stream_response_preserves_usage_from_earlier_chunk (line 333) | async def test_stream_response_preserves_usage_from_earlier_chunk(monkey... function test_stream_response_with_empty_reasoning_content (line 387) | async def test_stream_response_with_empty_reasoning_content(monkeypatch)... FILE: tests/test_remove_openai_responses_api_incompatible_fields.py function model (line 13) | def model() -> OpenAIResponsesModel: class TestRemoveOpenAIResponsesAPIIncompatibleFields (line 19) | class TestRemoveOpenAIResponsesAPIIncompatibleFields: method test_returns_unchanged_when_no_provider_data (line 22) | def test_returns_unchanged_when_no_provider_data(self, model: OpenAIRe... method test_removes_reasoning_items_with_provider_data (line 33) | def test_removes_reasoning_items_with_provider_data(self, model: OpenA... method test_keeps_reasoning_items_without_provider_data (line 47) | def test_keeps_reasoning_items_without_provider_data(self, model: Open... method test_removes_provider_data_from_all_items (line 60) | def test_removes_provider_data_from_all_items(self, model: OpenAIRespo... method test_removes_fake_responses_id (line 77) | def test_removes_fake_responses_id(self, model: OpenAIResponsesModel): method test_preserves_real_ids (line 94) | def test_preserves_real_ids(self, model: OpenAIResponsesModel): method test_handles_empty_list (line 109) | def test_handles_empty_list(self, model: OpenAIResponsesModel): method test_combined_scenario (line 117) | def test_combined_scenario(self, model: OpenAIResponsesModel): FILE: tests/test_repl.py function test_run_demo_loop_conversation (line 10) | async def test_run_demo_loop_conversation(monkeypatch, capsys): FILE: tests/test_responses.py function get_text_input_item (line 22) | def get_text_input_item(content: str) -> TResponseInputItem: function get_text_message (line 29) | def get_text_message(content: str) -> ResponseOutputItem: function get_function_tool (line 39) | def get_function_tool( function get_function_tool_call (line 52) | def get_function_tool_call( function get_handoff_tool_call (line 71) | def get_handoff_tool_call( function get_final_output_message (line 78) | def get_final_output_message(args: str) -> ResponseOutputItem: FILE: tests/test_responses_tracing.py class DummyTracing (line 16) | class DummyTracing: method is_disabled (line 17) | def is_disabled(self): class DummyUsage (line 21) | class DummyUsage: method __init__ (line 22) | def __init__( class DummyResponse (line 43) | class DummyResponse: method __init__ (line 44) | def __init__(self): method __aiter__ (line 49) | def __aiter__(self): function test_get_response_creates_trace (line 59) | async def test_get_response_creates_trace(monkeypatch): function test_non_data_tracing_doesnt_set_response_id (line 105) | async def test_non_data_tracing_doesnt_set_response_id(monkeypatch): function test_disable_tracing_does_not_create_span (line 149) | async def test_disable_tracing_does_not_create_span(monkeypatch): function test_stream_response_creates_trace (line 190) | async def test_stream_response_creates_trace(monkeypatch): function test_stream_response_failed_or_incomplete_terminal_event_creates_trace (line 246) | async def test_stream_response_failed_or_incomplete_terminal_event_creat... function test_stream_non_data_tracing_doesnt_set_response_id (line 302) | async def test_stream_non_data_tracing_doesnt_set_response_id(monkeypatch): function test_stream_disabled_tracing_doesnt_create_span (line 356) | async def test_stream_disabled_tracing_doesnt_create_span(monkeypatch): FILE: tests/test_responses_websocket_session.py function test_responses_websocket_session_builds_shared_run_config (line 11) | async def test_responses_websocket_session_builds_shared_run_config(): function test_responses_websocket_session_preserves_openai_prefix_routing (line 21) | async def test_responses_websocket_session_preserves_openai_prefix_routi... function test_responses_websocket_session_can_preserve_openai_prefix_model_ids (line 39) | async def test_responses_websocket_session_can_preserve_openai_prefix_mo... function test_responses_websocket_session_can_preserve_unknown_prefix_model_ids (line 57) | async def test_responses_websocket_session_can_preserve_unknown_prefix_m... function test_responses_websocket_session_run_streamed_injects_run_config (line 75) | async def test_responses_websocket_session_run_streamed_injects_run_conf... function test_responses_websocket_session_run_injects_run_config (line 99) | async def test_responses_websocket_session_run_injects_run_config(monkey... function test_responses_websocket_session_rejects_run_config_override (line 123) | async def test_responses_websocket_session_rejects_run_config_override(): function test_responses_websocket_session_context_manager_closes_provider (line 132) | async def test_responses_websocket_session_context_manager_closes_provid... function test_responses_websocket_session_does_not_expose_run_sync (line 147) | async def test_responses_websocket_session_does_not_expose_run_sync(): FILE: tests/test_result_cast.py function create_run_result (line 25) | def create_run_result( class Foo (line 46) | class Foo(BaseModel): function test_run_result_streaming_supports_pydantic_model_rebuild (line 50) | def test_run_result_streaming_supports_pydantic_model_rebuild() -> None: function _create_message (line 60) | def _create_message(text: str) -> ResponseOutputMessage: function test_result_cast_typechecks (line 70) | def test_result_cast_typechecks(): function test_bad_cast_doesnt_raise (line 82) | def test_bad_cast_doesnt_raise(): function test_bad_cast_with_param_raises (line 91) | def test_bad_cast_with_param_raises(): function test_run_result_release_agents_breaks_strong_refs (line 106) | def test_run_result_release_agents_breaks_strong_refs() -> None: function test_run_item_retains_agent_when_result_is_garbage_collected (line 125) | def test_run_item_retains_agent_when_result_is_garbage_collected() -> None: function test_run_item_repr_and_asdict_after_release (line 141) | def test_run_item_repr_and_asdict_after_release() -> None: function test_run_result_repr_and_asdict_after_release_agents (line 167) | def test_run_result_repr_and_asdict_after_release_agents() -> None: function test_run_result_release_agents_without_releasing_new_items (line 180) | def test_run_result_release_agents_without_releasing_new_items() -> None: function test_run_result_release_agents_is_idempotent (line 200) | def test_run_result_release_agents_is_idempotent() -> None: function test_run_result_streaming_release_agents_releases_current_agent (line 233) | def test_run_result_streaming_release_agents_releases_current_agent() ->... function test_run_result_agent_tool_invocation_returns_none_for_plain_context (line 264) | def test_run_result_agent_tool_invocation_returns_none_for_plain_context... function test_run_result_agent_tool_invocation_returns_immutable_metadata (line 270) | def test_run_result_agent_tool_invocation_returns_immutable_metadata() -... function test_run_result_streaming_agent_tool_invocation_returns_metadata (line 303) | def test_run_result_streaming_agent_tool_invocation_returns_metadata() -... FILE: tests/test_run.py function test_static_run_methods_call_into_default_runner (line 15) | async def test_static_run_methods_call_into_default_runner() -> None: function test_run_preserves_duplicate_user_messages (line 31) | async def test_run_preserves_duplicate_user_messages() -> None: FILE: tests/test_run_config.py class DummyProvider (line 12) | class DummyProvider(ModelProvider): method __init__ (line 16) | def __init__(self, model_to_return: Model | None = None) -> None: method get_model (line 20) | def get_model(self, model_name: str | None) -> Model: function test_model_provider_on_run_config_is_used_for_agent_model_name (line 27) | async def test_model_provider_on_run_config_is_used_for_agent_model_name... function test_run_config_model_name_override_takes_precedence (line 44) | async def test_run_config_model_name_override_takes_precedence() -> None: function test_run_config_model_override_object_takes_precedence (line 60) | async def test_run_config_model_override_object_takes_precedence() -> None: function test_agent_model_object_is_used_when_present (line 74) | async def test_agent_model_object_is_used_when_present() -> None: function test_trace_include_sensitive_data_defaults_to_true_when_env_not_set (line 91) | def test_trace_include_sensitive_data_defaults_to_true_when_env_not_set(... function test_trace_include_sensitive_data_follows_env_value (line 125) | def test_trace_include_sensitive_data_follows_env_value(env_value, expec... function test_trace_include_sensitive_data_explicit_override_takes_precedence (line 132) | def test_trace_include_sensitive_data_explicit_override_takes_precedence... FILE: tests/test_run_context_approvals.py function test_latest_approval_decision_wins_for_call_id (line 8) | def test_latest_approval_decision_wins_for_call_id() -> None: function test_namespaced_approval_status_does_not_fall_back_to_bare_tool_decisions (line 23) | def test_namespaced_approval_status_does_not_fall_back_to_bare_tool_deci... function test_namespaced_rejection_message_does_not_fall_back_to_bare_tool_decisions (line 55) | def test_namespaced_rejection_message_does_not_fall_back_to_bare_tool_de... function test_deferred_top_level_per_call_approval_keeps_bare_name_lookup (line 80) | def test_deferred_top_level_per_call_approval_keeps_bare_name_lookup() -... function test_deferred_top_level_rejection_message_keeps_bare_name_lookup (line 96) | def test_deferred_top_level_rejection_message_keeps_bare_name_lookup() -... function test_deferred_top_level_permanent_approval_does_not_alias_to_bare_name (line 112) | def test_deferred_top_level_permanent_approval_does_not_alias_to_bare_na... function test_deferred_top_level_legacy_permanent_approval_key_still_restores (line 138) | def test_deferred_top_level_legacy_permanent_approval_key_still_restores... function test_deferred_top_level_approval_does_not_alias_to_visible_bare_sibling (line 164) | def test_deferred_top_level_approval_does_not_alias_to_visible_bare_sibl... function test_explicit_same_name_namespace_does_not_alias_to_bare_tool (line 189) | def test_explicit_same_name_namespace_does_not_alias_to_bare_tool() -> N... FILE: tests/test_run_context_wrapper.py class BrokenStr (line 8) | class BrokenStr: method __str__ (line 9) | def __str__(self) -> str: function test_run_context_to_str_or_none_handles_errors (line 13) | def test_run_context_to_str_or_none_handles_errors() -> None: function test_run_context_resolve_tool_name_and_call_id_fallbacks (line 20) | def test_run_context_resolve_tool_name_and_call_id_fallbacks() -> None: function test_run_context_scopes_approvals_to_call_ids (line 28) | def test_run_context_scopes_approvals_to_call_ids() -> None: function test_run_context_scopes_rejections_to_call_ids (line 40) | def test_run_context_scopes_rejections_to_call_ids() -> None: function test_run_context_honors_global_approval_and_rejection (line 52) | def test_run_context_honors_global_approval_and_rejection() -> None: function test_run_context_stores_per_call_rejection_messages (line 64) | def test_run_context_stores_per_call_rejection_messages() -> None: function test_run_context_stores_sticky_rejection_messages_for_always_reject (line 75) | def test_run_context_stores_sticky_rejection_messages_for_always_reject(... function test_run_context_clears_rejection_message_after_approval (line 86) | def test_run_context_clears_rejection_message_after_approval() -> None: function test_run_context_unknown_tool_name_fallback (line 97) | def test_run_context_unknown_tool_name_fallback() -> None: function test_tool_approval_item_preserves_positional_type_argument (line 105) | def test_tool_approval_item_preserves_positional_type_argument() -> None: FILE: tests/test_run_error_details.py function test_run_error_includes_data (line 12) | async def test_run_error_includes_data(): function test_streamed_run_error_includes_data (line 31) | async def test_streamed_run_error_includes_data(): FILE: tests/test_run_hooks.py class RunHooksForTests (line 22) | class RunHooksForTests(RunHooks): method __init__ (line 23) | def __init__(self): method reset (line 26) | def reset(self): method on_agent_start (line 29) | async def on_agent_start( method on_agent_end (line 34) | async def on_agent_end( method on_handoff (line 39) | async def on_handoff( method on_tool_start (line 47) | async def on_tool_start( method on_tool_end (line 52) | async def on_tool_end( method on_llm_start (line 61) | async def on_llm_start( method on_llm_end (line 70) | async def on_llm_end( function test_async_run_hooks_with_llm (line 81) | async def test_async_run_hooks_with_llm(): function test_sync_run_hook_with_llm (line 99) | def test_sync_run_hook_with_llm(): function test_streamed_run_hooks_with_llm (line 117) | async def test_streamed_run_hooks_with_llm(): function test_async_run_hooks_with_agent_hooks_with_llm (line 151) | async def test_async_run_hooks_with_agent_hooks_with_llm(): function test_run_hooks_llm_error_non_streaming (line 174) | async def test_run_hooks_llm_error_non_streaming(monkeypatch): class DummyAgentHooks (line 194) | class DummyAgentHooks(AgentHooks): function test_runner_run_rejects_agent_hooks (line 199) | async def test_runner_run_rejects_agent_hooks(): function test_runner_run_streamed_rejects_agent_hooks (line 208) | def test_runner_run_streamed_rejects_agent_hooks(): class BoomModel (line 217) | class BoomModel(Model): method get_response (line 218) | async def get_response(self, *a, **k): method stream_response (line 221) | async def stream_response(self, *a, **k): function test_streamed_run_hooks_llm_error (line 227) | async def test_streamed_run_hooks_llm_error(monkeypatch): class RunHooksWithTurnInput (line 249) | class RunHooksWithTurnInput(RunHooks): method __init__ (line 252) | def __init__(self): method on_agent_start (line 255) | async def on_agent_start( function test_run_hooks_receives_turn_input_string (line 262) | async def test_run_hooks_receives_turn_input_string(): function test_run_hooks_receives_turn_input_list (line 279) | async def test_run_hooks_receives_turn_input_list(): function test_run_hooks_receives_turn_input_streamed (line 301) | async def test_run_hooks_receives_turn_input_streamed(): FILE: tests/test_run_impl_resume_paths.py function test_resolve_interrupted_turn_final_output_short_circuit (line 36) | async def test_resolve_interrupted_turn_final_output_short_circuit(monke... function test_resumed_session_persistence_uses_saved_count (line 104) | async def test_resumed_session_persistence_uses_saved_count(monkeypatch)... function test_resumed_run_again_resets_persisted_count (line 141) | async def test_resumed_run_again_resets_persisted_count(monkeypatch) -> ... function test_resumed_approval_does_not_duplicate_session_items (line 229) | async def test_resumed_approval_does_not_duplicate_session_items() -> None: FILE: tests/test_run_internal_error_handlers.py class _CustomSchema (line 16) | class _CustomSchema(AgentOutputSchemaBase): method is_plain_text (line 17) | def is_plain_text(self) -> bool: method name (line 20) | def name(self) -> str: method json_schema (line 23) | def json_schema(self) -> dict[str, Any]: method is_strict_json_schema (line 26) | def is_strict_json_schema(self) -> bool: method validate_json (line 29) | def validate_json(self, json_str: str) -> Any: function _make_run_data (line 33) | def _make_run_data(agent: Agent[Any]) -> RunErrorData: function test_format_final_output_text_handles_wrapped_payload (line 44) | def test_format_final_output_text_handles_wrapped_payload() -> None: function test_validate_handler_final_output_accepts_wrapped_payload (line 52) | def test_validate_handler_final_output_accepts_wrapped_payload() -> None: function test_format_final_output_text_uses_custom_schema_and_fallback (line 60) | def test_format_final_output_text_uses_custom_schema_and_fallback( function test_validate_handler_final_output_raises_for_unserializable_data (line 75) | def test_validate_handler_final_output_raises_for_unserializable_data( function test_resolve_run_error_handler_result_covers_async_and_validation_paths (line 87) | async def test_resolve_run_error_handler_result_covers_async_and_validat... FILE: tests/test_run_internal_items.py function test_drop_orphan_function_calls_preserves_non_mapping_entries (line 24) | def test_drop_orphan_function_calls_preserves_non_mapping_entries() -> N... function test_drop_orphan_function_calls_handles_tool_search_calls (line 71) | def test_drop_orphan_function_calls_handles_tool_search_calls() -> None: function test_drop_orphan_function_calls_preserves_hosted_tool_search_pairs_without_call_ids (line 121) | def test_drop_orphan_function_calls_preserves_hosted_tool_search_pairs_w... function test_drop_orphan_function_calls_matches_latest_anonymous_tool_search_call (line 152) | def test_drop_orphan_function_calls_matches_latest_anonymous_tool_search... function test_drop_orphan_function_calls_does_not_pair_named_tool_search_with_anonymous_output (line 195) | def test_drop_orphan_function_calls_does_not_pair_named_tool_search_with... function test_normalize_and_ensure_input_item_format_keep_non_dict_entries (line 224) | def test_normalize_and_ensure_input_item_format_keep_non_dict_entries() ... function test_fingerprint_input_item_handles_edge_cases (line 230) | def test_fingerprint_input_item_handles_edge_cases(monkeypatch: pytest.M... function test_deduplicate_input_items_handles_fake_ids_and_approval_request_ids (line 264) | def test_deduplicate_input_items_handles_fake_ids_and_approval_request_i... function test_extract_mcp_request_id_supports_dicts_and_objects (line 315) | def test_extract_mcp_request_id_supports_dicts_and_objects() -> None: function test_extract_mcp_request_id_from_run_variants (line 340) | def test_extract_mcp_request_id_from_run_variants() -> None: function test_run_item_to_input_item_preserves_reasoning_item_ids_by_default (line 370) | def test_run_item_to_input_item_preserves_reasoning_item_ids_by_default(... function test_run_item_to_input_item_omits_reasoning_item_ids_when_configured (line 388) | def test_run_item_to_input_item_omits_reasoning_item_ids_when_configured... function test_run_item_to_input_item_preserves_tool_search_items (line 406) | def test_run_item_to_input_item_preserves_tool_search_items() -> None: function test_run_item_to_input_item_strips_tool_search_created_by (line 426) | def test_run_item_to_input_item_strips_tool_search_created_by() -> None: function test_run_result_to_input_list_preserves_tool_search_items (line 462) | def test_run_result_to_input_list_preserves_tool_search_items() -> None: function test_coerce_tool_search_output_raw_item_rejects_legacy_type (line 493) | def test_coerce_tool_search_output_raw_item_rejects_legacy_type() -> None: FILE: tests/test_run_state.py function make_processed_response (line 124) | def make_processed_response( function make_state (line 153) | def make_state( function set_last_processed_response (line 170) | def set_last_processed_response( class TestRunState (line 180) | class TestRunState: method test_initializes_with_default_values (line 183) | def test_initializes_with_default_values(self): method test_set_tool_use_tracker_snapshot_filters_non_strings (line 199) | def test_set_tool_use_tracker_snapshot_filters_non_strings(self): method test_to_json_and_to_string_produce_valid_json (line 226) | def test_to_json_and_to_string_produce_valid_json(self): method test_reasoning_item_id_policy_survives_serialization (line 245) | async def test_reasoning_item_id_policy_survives_serialization(self): method test_tool_input_survives_serialization_round_trip (line 274) | async def test_tool_input_survives_serialization_round_trip(self): method test_trace_api_key_serialization_is_opt_in (line 285) | async def test_trace_api_key_serialization_is_opt_in(self): method test_throws_error_if_schema_version_is_missing_or_invalid (line 326) | async def test_throws_error_if_schema_version_is_missing_or_invalid(se... method test_approve_updates_context_approvals_correctly (line 351) | def test_approve_updates_context_approvals_correctly(self): method test_returns_undefined_when_approval_status_is_unknown (line 367) | def test_returns_undefined_when_approval_status_is_unknown(self): method test_reject_updates_context_approvals_correctly (line 372) | def test_reject_updates_context_approvals_correctly(self): method test_reject_stores_rejection_message (line 387) | def test_reject_stores_rejection_message(self): method test_to_json_non_mapping_context_warns_and_omits (line 402) | def test_to_json_non_mapping_context_warns_and_omits(self, caplog): method test_to_json_strict_context_requires_serializer (line 421) | def test_to_json_strict_context_requires_serializer(self): method test_from_json_with_context_deserializer (line 435) | async def test_from_json_with_context_deserializer(self, caplog): method test_to_json_with_context_serializer_records_metadata (line 462) | def test_to_json_with_context_serializer_records_metadata(self): method test_from_json_warns_without_deserializer (line 485) | async def test_from_json_warns_without_deserializer(self, caplog): method test_from_json_strict_context_requires_deserializer (line 504) | async def test_from_json_strict_context_requires_deserializer(self): method test_from_json_context_deserializer_can_return_wrapper (line 521) | async def test_from_json_context_deserializer_can_return_wrapper(self): method test_to_json_pydantic_context_records_metadata (line 546) | def test_to_json_pydantic_context_records_metadata(self, caplog): method test_guardrail_results_round_trip (line 567) | async def test_guardrail_results_round_trip(self): method test_tool_guardrail_results_round_trip (line 626) | async def test_tool_guardrail_results_round_trip(self): method test_reject_permanently_when_always_reject_option_is_passed (line 680) | def test_reject_permanently_when_always_reject_option_is_passed(self): method test_rejection_is_scoped_to_call_ids (line 702) | def test_rejection_is_scoped_to_call_ids(self): method test_always_reject_reuses_rejection_message_for_future_calls (line 719) | def test_always_reject_reuses_rejection_message_for_future_calls(self): method test_approve_raises_when_context_is_none (line 735) | def test_approve_raises_when_context_is_none(self): method test_reject_raises_when_context_is_none (line 748) | def test_reject_raises_when_context_is_none(self): method test_generated_items_not_duplicated_by_last_processed_response (line 762) | async def test_generated_items_not_duplicated_by_last_processed_respon... method test_anonymous_tool_search_items_keep_later_same_content_snapshot (line 793) | async def test_anonymous_tool_search_items_keep_later_same_content_sna... method test_anonymous_tool_search_items_not_duplicated_across_round_trip (line 844) | async def test_anonymous_tool_search_items_not_duplicated_across_round... method test_to_json_deduplicates_items_with_direct_id_type_attributes (line 915) | async def test_to_json_deduplicates_items_with_direct_id_type_attribut... method test_from_string_reconstructs_state_for_simple_agent (line 951) | async def test_from_string_reconstructs_state_for_simple_agent(self): method test_from_json_reconstructs_state (line 969) | async def test_from_json_reconstructs_state(self): method test_get_interruptions_returns_empty_when_no_interruptions (line 985) | def test_get_interruptions_returns_empty_when_no_interruptions(self): method test_get_interruptions_returns_interruptions_when_present (line 993) | def test_get_interruptions_returns_interruptions_when_present(self): method test_serializes_and_restores_approvals (line 1013) | async def test_serializes_and_restores_approvals(self): method test_serializes_and_restores_rejection_messages (line 1051) | async def test_serializes_and_restores_rejection_messages(self): method test_from_json_accepts_previous_schema_version_without_rejection_messages (line 1073) | async def test_from_json_accepts_previous_schema_version_without_rejec... method test_from_json_with_context_override_uses_serialized_rejection_messages (line 1099) | async def test_from_json_with_context_override_uses_serialized_rejecti... class TestBuildAgentMap (line 1139) | class TestBuildAgentMap: method test_build_agent_map_collects_agents_without_looping (line 1142) | def test_build_agent_map_collects_agents_without_looping(self): method test_build_agent_map_handles_complex_handoff_graphs (line 1159) | def test_build_agent_map_handles_complex_handoff_graphs(self): method test_build_agent_map_handles_handoff_objects (line 1176) | def test_build_agent_map_handles_handoff_objects(self): method test_build_agent_map_supports_legacy_handoff_agent_attribute (line 1186) | def test_build_agent_map_supports_legacy_handoff_agent_attribute(self): method test_build_agent_map_supports_legacy_non_handoff_agent_wrapper (line 1204) | def test_build_agent_map_supports_legacy_non_handoff_agent_wrapper(self): method test_build_agent_map_skips_unresolved_handoff_objects (line 1219) | def test_build_agent_map_skips_unresolved_handoff_objects(self): class TestSerializationRoundTrip (line 1241) | class TestSerializationRoundTrip: method test_preserves_usage_data (line 1244) | async def test_preserves_usage_data(self): method test_serializes_generated_items (line 1267) | def test_serializes_generated_items(self): method test_serializes_current_step_interruption (line 1282) | async def test_serializes_current_step_interruption(self): method test_deserializes_various_item_types (line 1308) | async def test_deserializes_various_item_types(self): method test_serializes_original_input_with_function_call_output (line 1379) | async def test_serializes_original_input_with_function_call_output(self): method test_serializes_assistant_messages (line 1448) | async def test_serializes_assistant_messages( method test_from_string_normalizes_original_input_dict_items (line 1468) | async def test_from_string_normalizes_original_input_dict_items(self): method test_serializes_original_input_with_non_dict_items (line 1533) | async def test_serializes_original_input_with_non_dict_items(self): method test_from_json_preserves_function_output_original_input (line 1553) | async def test_from_json_preserves_function_output_original_input(self): method test_serialize_tool_call_output_looks_up_name (line 1591) | def test_serialize_tool_call_output_looks_up_name(self): method test_lookup_function_name_sources (line 1747) | def test_lookup_function_name_sources( method test_deserialization_handles_unknown_agent_gracefully (line 1761) | async def test_deserialization_handles_unknown_agent_gracefully(self): method test_deserialization_handles_malformed_items_gracefully (line 1789) | async def test_deserialization_handles_malformed_items_gracefully(self): class TestRunContextApprovals (line 1817) | class TestRunContextApprovals: method test_approval_takes_precedence_over_rejection_when_both_true (line 1820) | def test_approval_takes_precedence_over_rejection_when_both_true(self): method test_individual_approval_takes_precedence_over_individual_rejection (line 1833) | def test_individual_approval_takes_precedence_over_individual_rejectio... method test_returns_none_when_no_approval_or_rejection (line 1846) | def test_returns_none_when_no_approval_or_rejection(self): class TestRunStateEdgeCases (line 1860) | class TestRunStateEdgeCases: method test_to_json_raises_when_no_current_agent (line 1863) | def test_to_json_raises_when_no_current_agent(self): method test_to_json_raises_when_no_context (line 1873) | def test_to_json_raises_when_no_context(self): class TestDeserializeHelpers (line 1885) | class TestDeserializeHelpers: method test_serialization_includes_handoff_fields (line 1888) | async def test_serialization_includes_handoff_fields(self): method test_model_response_serialization_roundtrip (line 1920) | async def test_model_response_serialization_roundtrip(self): method test_interruptions_serialization_roundtrip (line 1954) | async def test_interruptions_serialization_roundtrip(self): method test_nested_agent_tool_interruptions_roundtrip (line 1982) | async def test_nested_agent_tool_interruptions_roundtrip(self): method test_nested_agent_tool_hitl_resume_survives_json_round_trip_after_gc (line 2011) | async def test_nested_agent_tool_hitl_resume_survives_json_round_trip_... method test_json_decode_error_handling (line 2166) | async def test_json_decode_error_handling(self): method test_missing_agent_in_map_error (line 2173) | async def test_missing_agent_in_map_error(self): class TestRunStateResumption (line 2189) | class TestRunStateResumption: method test_resume_from_run_state (line 2193) | async def test_resume_from_run_state(self): method test_resume_from_run_state_with_context (line 2212) | async def test_resume_from_run_state_with_context(self): method test_resume_from_run_state_with_conversation_id (line 2237) | async def test_resume_from_run_state_with_conversation_id(self): method test_resume_from_run_state_with_previous_response_id (line 2256) | async def test_resume_from_run_state_with_previous_response_id(self): method test_resume_from_run_state_with_interruption (line 2275) | async def test_resume_from_run_state_with_interruption(self): method test_resume_from_run_state_streamed (line 2308) | async def test_resume_from_run_state_streamed(self): method test_resume_from_run_state_streamed_uses_context_from_state (line 2333) | async def test_resume_from_run_state_streamed_uses_context_from_state(... method test_resume_from_run_state_streamed_with_context_override (line 2353) | async def test_resume_from_run_state_streamed_with_context_override(se... method test_run_result_streaming_to_state_with_interruptions (line 2373) | async def test_run_result_streaming_to_state_with_interruptions(self): class TestRunStateSerializationEdgeCases (line 2410) | class TestRunStateSerializationEdgeCases: method test_to_json_includes_tool_call_items_from_last_processed_response (line 2414) | async def test_to_json_includes_tool_call_items_from_last_processed_re... method test_to_json_camelizes_nested_dicts_and_lists (line 2446) | async def test_to_json_camelizes_nested_dicts_and_lists(self): method test_to_string_serializes_non_json_outputs (line 2480) | async def test_to_string_serializes_non_json_outputs(self): method test_from_json_with_last_processed_response (line 2507) | async def test_from_json_with_last_processed_response(self): method test_last_processed_response_serializes_local_shell_actions (line 2539) | async def test_last_processed_response_serializes_local_shell_actions(... method test_serialize_tool_action_groups (line 2580) | def test_serialize_tool_action_groups(self): method test_serialize_tool_action_groups_preserves_synthetic_namespace_for_deferred_tools (line 2651) | def test_serialize_tool_action_groups_preserves_synthetic_namespace_fo... method test_serialize_guardrail_results (line 2696) | def test_serialize_guardrail_results(self): method test_serialize_handoff_with_name_fallback (line 2723) | async def test_serialize_handoff_with_name_fallback(self): method test_serialize_function_with_description_and_schema (line 2759) | async def test_serialize_function_with_description_and_schema(self): method test_serialize_computer_action_with_description (line 2796) | async def test_serialize_computer_action_with_description(self): method test_serialize_shell_action_with_description (line 2868) | async def test_serialize_shell_action_with_description(self): method test_serialize_apply_patch_action_with_description (line 2906) | async def test_serialize_apply_patch_action_with_description(self): method test_serialize_mcp_approval_request (line 2952) | async def test_serialize_mcp_approval_request(self): method test_serialize_item_with_non_dict_raw_item (line 2990) | async def test_serialize_item_with_non_dict_raw_item(self): method test_deserialize_tool_call_output_item_different_types (line 3016) | async def test_deserialize_tool_call_output_item_different_types(self): method test_deserialize_reasoning_item (line 3064) | async def test_deserialize_reasoning_item(self): method test_deserialize_compaction_item (line 3083) | async def test_deserialize_compaction_item(self): method test_deserialize_handoff_call_item (line 3105) | async def test_deserialize_handoff_call_item(self): method test_deserialize_handoff_output_item_without_agent (line 3125) | async def test_deserialize_handoff_output_item_without_agent(self): method test_deserialize_mcp_items (line 3151) | async def test_deserialize_mcp_items(self): method test_deserialize_tool_approval_item (line 3203) | async def test_deserialize_tool_approval_item(self): method test_serialize_item_with_non_dict_non_model_raw_item (line 3223) | async def test_serialize_item_with_non_dict_non_model_raw_item(self): method test_deserialize_processed_response_without_get_all_tools (line 3245) | async def test_deserialize_processed_response_without_get_all_tools(se... method test_deserialize_processed_response_handoff_with_tool_name (line 3272) | async def test_deserialize_processed_response_handoff_with_tool_name(s... method test_deserialize_processed_response_function_in_tools_map (line 3311) | async def test_deserialize_processed_response_function_in_tools_map(se... method test_deserialize_processed_response_function_uses_namespace (line 3356) | async def test_deserialize_processed_response_function_uses_namespace(... method test_deserialize_processed_response_rejects_qualified_name_collision (line 3409) | async def test_deserialize_processed_response_rejects_qualified_name_c... method test_deserialize_processed_response_uses_last_duplicate_top_level_function (line 3453) | async def test_deserialize_processed_response_uses_last_duplicate_top_... method test_deserialize_processed_response_uses_tool_call_namespace_for_deferred_top_level (line 3492) | async def test_deserialize_processed_response_uses_tool_call_namespace... method test_deserialize_processed_response_uses_serialized_lookup_key_for_deferred_top_level (line 3540) | async def test_deserialize_processed_response_uses_serialized_lookup_k... method test_deserialize_processed_response_computer_action_in_map (line 3594) | async def test_deserialize_processed_response_computer_action_in_map(s... method test_deserialize_processed_response_computer_action_accepts_preview_name (line 3671) | async def test_deserialize_processed_response_computer_action_accepts_... method test_deserialize_processed_response_shell_action_with_validation_error (line 3743) | async def test_deserialize_processed_response_shell_action_with_valida... method test_deserialize_processed_response_apply_patch_action_with_exception (line 3787) | async def test_deserialize_processed_response_apply_patch_action_with_... method test_deserialize_processed_response_local_shell_action_round_trip (line 3841) | async def test_deserialize_processed_response_local_shell_action_round... method test_deserialize_processed_response_mcp_approval_request_found (line 3885) | async def test_deserialize_processed_response_mcp_approval_request_fou... method test_deserialize_items_fallback_union_type (line 3930) | async def test_deserialize_items_fallback_union_type(self): method test_from_json_missing_schema_version (line 3951) | async def test_from_json_missing_schema_version(self): method test_from_json_unsupported_schema_version (line 3973) | async def test_from_json_unsupported_schema_version(self, schema_versi... method test_from_json_accepts_previous_schema_version (line 3997) | async def test_from_json_accepts_previous_schema_version(self): method test_supported_schema_versions_match_released_boundary (line 4021) | def test_supported_schema_versions_match_released_boundary(self): method test_from_json_agent_not_found (line 4028) | async def test_from_json_agent_not_found(self): method test_deserialize_processed_response_with_last_processed_response (line 4050) | async def test_deserialize_processed_response_with_last_processed_resp... method test_from_string_with_last_processed_response (line 4080) | async def test_from_string_with_last_processed_response(self): method test_run_state_merge_keeps_tool_output_with_same_call_id (line 4110) | async def test_run_state_merge_keeps_tool_output_with_same_call_id(self): method test_deserialize_processed_response_handoff_with_name_fallback (line 4140) | async def test_deserialize_processed_response_handoff_with_name_fallba... method test_deserialize_processed_response_mcp_tool_found (line 4179) | async def test_deserialize_processed_response_mcp_tool_found(self): method test_deserialize_processed_response_agent_without_get_all_tools (line 4231) | async def test_deserialize_processed_response_agent_without_get_all_to... method test_deserialize_processed_response_empty_mcp_tool_data (line 4261) | async def test_deserialize_processed_response_empty_mcp_tool_data(self): method test_deserialize_items_union_adapter_fallback (line 4293) | async def test_deserialize_items_union_adapter_fallback(self): class TestToolApprovalItem (line 4322) | class TestToolApprovalItem: method test_tool_approval_item_with_explicit_tool_name (line 4325) | def test_tool_approval_item_with_explicit_tool_name(self): method test_tool_approval_item_falls_back_to_raw_item_name (line 4344) | def test_tool_approval_item_falls_back_to_raw_item_name(self): method test_tool_approval_item_with_dict_raw_item (line 4361) | def test_tool_approval_item_with_dict_raw_item(self): method test_approve_tool_with_explicit_tool_name (line 4377) | def test_approve_tool_with_explicit_tool_name(self): method test_approve_tool_extracts_call_id_from_dict (line 4394) | def test_approve_tool_extracts_call_id_from_dict(self): method test_reject_tool_with_explicit_tool_name (line 4410) | def test_reject_tool_with_explicit_tool_name(self): method test_serialize_tool_approval_item_with_tool_name (line 4427) | async def test_serialize_tool_approval_item_with_tool_name(self): method test_deserialize_tool_approval_item_with_tool_name (line 4451) | async def test_deserialize_tool_approval_item_with_tool_name(self): method test_round_trip_serialization_with_tool_name (line 4475) | async def test_round_trip_serialization_with_tool_name(self): method test_round_trip_serialization_preserves_allow_bare_name_alias (line 4501) | async def test_round_trip_serialization_preserves_allow_bare_name_alia... method test_tool_approval_item_arguments_property (line 4533) | def test_tool_approval_item_arguments_property(self): method test_tool_approval_item_tracks_namespace (line 4574) | def test_tool_approval_item_tracks_namespace(self): method test_tool_approval_item_collapses_synthetic_deferred_namespace_in_qualified_name (line 4591) | def test_tool_approval_item_collapses_synthetic_deferred_namespace_in_... method test_round_trip_serialization_with_tool_namespace (line 4608) | async def test_round_trip_serialization_with_tool_namespace(self): method test_round_trip_serialization_preserves_tool_lookup_key (line 4633) | async def test_round_trip_serialization_preserves_tool_lookup_key(self... method test_deserialize_items_restores_tool_search_items (line 4660) | async def test_deserialize_items_restores_tool_search_items(self): method test_deserialize_items_handles_missing_agent_name (line 4712) | async def test_deserialize_items_handles_missing_agent_name(self): method test_deserialize_items_handles_string_agent_name (line 4733) | async def test_deserialize_items_handles_string_agent_name(self): method test_deserialize_items_handles_agent_field (line 4754) | async def test_deserialize_items_handles_agent_field(self): method test_deserialize_items_handles_handoff_output_source_agent_string (line 4775) | async def test_deserialize_items_handles_handoff_output_source_agent_s... method test_deserialize_items_handles_handoff_output_target_agent_string (line 4800) | async def test_deserialize_items_handles_handoff_output_target_agent_s... method test_deserialize_items_handles_tool_approval_item_exception (line 4821) | async def test_deserialize_items_handles_tool_approval_item_exception(... class TestDeserializeItemsEdgeCases (line 4842) | class TestDeserializeItemsEdgeCases: method test_deserialize_items_handles_handoff_output_with_string_source_agent (line 4845) | async def test_deserialize_items_handles_handoff_output_with_string_so... method test_deserialize_items_handles_handoff_output_with_string_target_agent (line 4869) | async def test_deserialize_items_handles_handoff_output_with_string_ta... method test_deserialize_items_handles_handoff_output_no_source_no_target (line 4890) | async def test_deserialize_items_handles_handoff_output_no_source_no_t... method test_deserialize_items_handles_non_dict_items_in_original_input (line 4909) | async def test_deserialize_items_handles_non_dict_items_in_original_in... method test_from_json_handles_string_original_input (line 4937) | async def test_from_json_handles_string_original_input(self): method test_from_string_handles_non_dict_items_in_original_input (line 4960) | async def test_from_string_handles_non_dict_items_in_original_input(se... method test_lookup_function_name_searches_last_processed_response_new_items (line 4973) | async def test_lookup_function_name_searches_last_processed_response_n... method test_from_json_preserves_function_call_output_items (line 5021) | async def test_from_json_preserves_function_call_output_items(self): method test_deserialize_items_handles_missing_type_field (line 5058) | async def test_deserialize_items_handles_missing_type_field(self): method test_deserialize_items_handles_dict_target_agent (line 5079) | async def test_deserialize_items_handles_dict_target_agent(self): method test_deserialize_items_handles_handoff_output_dict_target_agent (line 5101) | async def test_deserialize_items_handles_handoff_output_dict_target_ag... method test_deserialize_items_handles_handoff_output_string_target_agent_fallback (line 5123) | async def test_deserialize_items_handles_handoff_output_string_target_... function test_resume_pending_function_approval_reinterrupts (line 5146) | async def test_resume_pending_function_approval_reinterrupts() -> None: function test_resume_rejected_function_approval_emits_output (line 5169) | async def test_resume_rejected_function_approval_emits_output() -> None: FILE: tests/test_run_step_execution.py function _function_span_names (line 92) | def _function_span_names() -> list[str]: function test_empty_response_is_final_output (line 110) | async def test_empty_response_is_final_output(): function test_plaintext_agent_no_tool_calls_is_final_output (line 126) | async def test_plaintext_agent_no_tool_calls_is_final_output(): function test_plaintext_agent_no_tool_calls_multiple_messages_is_final_output (line 143) | async def test_plaintext_agent_no_tool_calls_multiple_messages_is_final_... function test_execute_tools_allows_unhashable_tool_call_arguments (line 172) | async def test_execute_tools_allows_unhashable_tool_call_arguments(): function test_plaintext_agent_with_tool_call_is_run_again (line 190) | async def test_plaintext_agent_with_tool_call_is_run_again(): function test_plaintext_agent_hosted_shell_items_without_message_runs_again (line 214) | async def test_plaintext_agent_hosted_shell_items_without_message_runs_a... function test_plaintext_agent_shell_output_only_without_message_runs_again (line 252) | async def test_plaintext_agent_shell_output_only_without_message_runs_ag... function test_plaintext_agent_tool_search_only_without_message_runs_again (line 285) | async def test_plaintext_agent_tool_search_only_without_message_runs_aga... function test_plaintext_agent_client_tool_search_requires_manual_handling (line 334) | async def test_plaintext_agent_client_tool_search_requires_manual_handli... function test_plaintext_agent_hosted_shell_with_refusal_message_is_final_output (line 356) | async def test_plaintext_agent_hosted_shell_with_refusal_message_is_fina... function test_multiple_tool_calls (line 406) | async def test_multiple_tool_calls(): function test_multiple_tool_calls_with_tool_context (line 441) | async def test_multiple_tool_calls_with_tool_context(): function test_multiple_tool_calls_still_raise_when_sibling_failure_error_function_none (line 477) | async def test_multiple_tool_calls_still_raise_when_sibling_failure_erro... function test_multiple_tool_calls_still_raise_when_sibling_cancelled (line 506) | async def test_multiple_tool_calls_still_raise_when_sibling_cancelled(): function test_multiple_tool_calls_cancel_sibling_when_tool_raises_cancelled_error (line 535) | async def test_multiple_tool_calls_cancel_sibling_when_tool_raises_cance... function test_multiple_tool_calls_use_custom_failure_error_function_for_cancelled_tool (line 592) | async def test_multiple_tool_calls_use_custom_failure_error_function_for... function test_multiple_tool_calls_use_custom_failure_error_function_for_replaced_cancelled_tool (line 636) | async def test_multiple_tool_calls_use_custom_failure_error_function_for... function test_multiple_tool_calls_use_default_failure_error_function_for_copied_cancelled_tool (line 675) | async def test_multiple_tool_calls_use_default_failure_error_function_fo... function test_multiple_tool_calls_use_default_failure_error_function_for_manual_cancelled_tool (line 707) | async def test_multiple_tool_calls_use_default_failure_error_function_fo... function test_multiple_tool_calls_surface_hook_failure_over_sibling_cancellation (line 744) | async def test_multiple_tool_calls_surface_hook_failure_over_sibling_can... function test_multiple_tool_calls_surface_output_guardrail_failure_over_sibling_cancellation (line 791) | async def test_multiple_tool_calls_surface_output_guardrail_failure_over... function test_function_tool_preserves_contextvar_from_tool_body_to_post_invoke_hooks (line 837) | async def test_function_tool_preserves_contextvar_from_tool_body_to_post... function test_mixed_tool_calls_preserve_shell_output_when_function_tool_cancelled (line 882) | async def test_mixed_tool_calls_preserve_shell_output_when_function_tool... function test_multiple_tool_calls_still_raise_tool_timeout_error (line 912) | async def test_multiple_tool_calls_still_raise_tool_timeout_error(): function test_multiple_tool_calls_still_raise_model_behavior_error_when_failure_error_none (line 943) | async def test_multiple_tool_calls_still_raise_model_behavior_error_when... function test_multiple_tool_calls_do_not_run_on_tool_end_for_cancelled_tool (line 972) | async def test_multiple_tool_calls_do_not_run_on_tool_end_for_cancelled_... function test_multiple_tool_calls_skip_post_invoke_work_for_cancelled_sibling_teardown (line 1024) | async def test_multiple_tool_calls_skip_post_invoke_work_for_cancelled_s... function test_execute_function_tool_calls_parent_cancellation_skips_post_invoke_work (line 1094) | async def test_execute_function_tool_calls_parent_cancellation_skips_pos... function test_execute_function_tool_calls_eager_task_factory_tracks_state_safely (line 1171) | async def test_execute_function_tool_calls_eager_task_factory_tracks_sta... function test_execute_function_tool_calls_collapse_trace_name_for_top_level_deferred_tools (line 1222) | async def test_execute_function_tool_calls_collapse_trace_name_for_top_l... function test_execute_function_tool_calls_preserve_trace_name_for_explicit_namespace (line 1258) | async def test_execute_function_tool_calls_preserve_trace_name_for_expli... function test_execute_function_tool_calls_rejects_reserved_same_name_namespace_shape (line 1300) | async def test_execute_function_tool_calls_rejects_reserved_same_name_na... function test_single_tool_call_still_raises_normal_exception (line 1319) | async def test_single_tool_call_still_raises_normal_exception(): function test_single_tool_call_still_raises_cancelled_error (line 1341) | async def test_single_tool_call_still_raises_cancelled_error(): function test_multiple_tool_calls_allow_exception_objects_as_tool_outputs (line 1363) | async def test_multiple_tool_calls_allow_exception_objects_as_tool_outpu... function test_multiple_tool_calls_still_raise_non_cancellation_base_exceptions (line 1396) | async def test_multiple_tool_calls_still_raise_non_cancellation_base_exc... function test_multiple_tool_calls_prioritize_fatal_base_exception_over_user_error (line 1428) | async def test_multiple_tool_calls_prioritize_fatal_base_exception_over_... function test_multiple_tool_calls_prioritize_tool_error_over_same_batch_cancelled_error (line 1480) | async def test_multiple_tool_calls_prioritize_tool_error_over_same_batch... function test_multiple_tool_calls_preserve_tool_call_order_for_same_batch_failures (line 1529) | async def test_multiple_tool_calls_preserve_tool_call_order_for_same_bat... function test_multiple_tool_calls_allow_successful_sibling_on_tool_end_to_finish (line 1574) | async def test_multiple_tool_calls_allow_successful_sibling_on_tool_end_... function test_multiple_tool_calls_surface_post_invoke_failure_unblocked_during_settle_turns (line 1631) | async def test_multiple_tool_calls_surface_post_invoke_failure_unblocked... function test_multiple_tool_calls_surface_sleeping_post_invoke_failure_before_sibling_error (line 1701) | async def test_multiple_tool_calls_surface_sleeping_post_invoke_failure_... function test_multiple_tool_calls_do_not_wait_indefinitely_for_sleeping_post_invoke_sibling (line 1761) | async def test_multiple_tool_calls_do_not_wait_indefinitely_for_sleeping... function test_multiple_tool_calls_do_not_wait_for_cancelled_sibling_tool_before_raising (line 1807) | async def test_multiple_tool_calls_do_not_wait_for_cancelled_sibling_too... function test_multiple_tool_calls_bound_cancelled_sibling_self_rescheduling_cleanup (line 1859) | async def test_multiple_tool_calls_bound_cancelled_sibling_self_reschedu... function test_multiple_tool_calls_drain_completed_fatal_failures_before_raising (line 1912) | async def test_multiple_tool_calls_drain_completed_fatal_failures_before... function test_multiple_tool_calls_raise_late_fatal_sibling_exception_after_cancellation (line 1967) | async def test_multiple_tool_calls_raise_late_fatal_sibling_exception_af... function test_multiple_tool_calls_preserve_triggering_error_over_cancelled_sibling_cleanup_error (line 2019) | async def test_multiple_tool_calls_preserve_triggering_error_over_cancel... function test_multiple_tool_calls_report_late_cleanup_exception_from_cancelled_sibling (line 2064) | async def test_multiple_tool_calls_report_late_cleanup_exception_from_ca... function test_multiple_tool_calls_cancel_pending_tasks_when_parent_cancelled (line 2147) | async def test_multiple_tool_calls_cancel_pending_tasks_when_parent_canc... function test_parent_cancellation_does_not_wait_for_tool_cleanup (line 2197) | async def test_parent_cancellation_does_not_wait_for_tool_cleanup(): function test_parent_cancellation_wins_when_shield_raises_after_tool_finishes (line 2240) | async def test_parent_cancellation_wins_when_shield_raises_after_tool_fi... function test_parent_cancellation_does_not_report_tool_failure_as_background_error (line 2268) | async def test_parent_cancellation_does_not_report_tool_failure_as_backg... function test_function_tool_context_includes_run_config (line 2319) | async def test_function_tool_context_includes_run_config() -> None: function test_deferred_function_tool_context_preserves_search_loaded_namespace (line 2345) | async def test_deferred_function_tool_context_preserves_search_loaded_na... function test_handoff_output_leads_to_handoff_next_step (line 2387) | async def test_handoff_output_leads_to_handoff_next_step(): class Foo (line 2404) | class Foo(BaseModel): function test_final_output_without_tool_runs_again (line 2409) | async def test_final_output_without_tool_runs_again(): function test_final_output_leads_to_final_output_next_step (line 2423) | async def test_final_output_leads_to_final_output_next_step(): function test_handoff_and_final_output_leads_to_handoff_next_step (line 2440) | async def test_handoff_and_final_output_leads_to_handoff_next_step(): function test_multiple_final_output_leads_to_final_output_next_step (line 2459) | async def test_multiple_final_output_leads_to_final_output_next_step(): function test_input_guardrail_runs_on_invalid_json (line 2478) | async def test_input_guardrail_runs_on_invalid_json(): function test_invalid_json_raises_with_failure_error_function_none (line 2515) | async def test_invalid_json_raises_with_failure_error_function_none(): function assert_item_is_message (line 2538) | def assert_item_is_message(item: RunItem, text: str) -> None: function assert_item_is_function_tool_call (line 2546) | def assert_item_is_function_tool_call( function assert_item_is_function_tool_call_output (line 2557) | def assert_item_is_function_tool_call_output(item: RunItem, output: str)... function make_processed_response (line 2564) | def make_processed_response( function get_execute_result (line 2593) | async def get_execute_result( function run_execute_with_processed_response (line 2626) | async def run_execute_with_processed_response( class ToolApprovalRun (line 2645) | class ToolApprovalRun: function _function_tool_approval_run (line 2651) | def _function_tool_approval_run() -> ToolApprovalRun: function _shell_tool_approval_run (line 2667) | def _shell_tool_approval_run() -> ToolApprovalRun: function _apply_patch_tool_approval_run (line 2682) | def _apply_patch_tool_approval_run() -> ToolApprovalRun: function test_execute_tools_handles_tool_approval_items (line 2706) | async def test_execute_tools_handles_tool_approval_items( function test_execute_tools_preserves_synthetic_namespace_for_deferred_top_level_approval (line 2717) | async def test_execute_tools_preserves_synthetic_namespace_for_deferred_... function test_deferred_tool_approval_allows_bare_alias_when_visible_peer_is_disabled (line 2745) | async def test_deferred_tool_approval_allows_bare_alias_when_visible_pee... function test_execute_tools_runs_hosted_mcp_callback_when_present (line 2780) | async def test_execute_tools_runs_hosted_mcp_callback_when_present(): function test_execute_tools_surfaces_hosted_mcp_interruptions_without_callback (line 2818) | async def test_execute_tools_surfaces_hosted_mcp_interruptions_without_c... function test_execute_tools_emits_hosted_mcp_rejection_response (line 2861) | async def test_execute_tools_emits_hosted_mcp_rejection_response(): function test_execute_tools_emits_hosted_mcp_rejection_reason_from_explicit_message (line 2916) | async def test_execute_tools_emits_hosted_mcp_rejection_reason_from_expl... FILE: tests/test_run_step_processing.py function _dummy_ctx (line 47) | def _dummy_ctx() -> RunContextWrapper[None]: function process_response (line 51) | async def process_response( function test_empty_response (line 69) | def test_empty_response(): function test_no_tool_calls (line 88) | def test_no_tool_calls(): function test_single_tool_call (line 103) | async def test_single_tool_call(): function test_missing_tool_call_raises_error (line 123) | async def test_missing_tool_call_raises_error(): function test_multiple_tool_calls (line 139) | async def test_multiple_tool_calls(): function test_handoffs_parsed_correctly (line 172) | async def test_handoffs_parsed_correctly(): function test_handoff_can_disable_run_level_history_nesting (line 207) | async def test_handoff_can_disable_run_level_history_nesting(monkeypatch... function test_handoff_can_enable_history_nesting (line 251) | async def test_handoff_can_enable_history_nesting(monkeypatch: pytest.Mo... function test_missing_handoff_fails (line 303) | async def test_missing_handoff_fails(): function test_multiple_handoffs_doesnt_error (line 321) | async def test_multiple_handoffs_doesnt_error(): class Foo (line 342) | class Foo(BaseModel): function test_final_output_parsed_correctly (line 347) | async def test_final_output_parsed_correctly(): function test_file_search_tool_call_parsed_correctly (line 366) | async def test_file_search_tool_call_parsed_correctly(): function test_function_web_search_tool_call_parsed_correctly (line 393) | async def test_function_web_search_tool_call_parsed_correctly(): function test_reasoning_item_parsed_correctly (line 416) | async def test_reasoning_item_parsed_correctly(): class DummyComputer (line 434) | class DummyComputer(Computer): method environment (line 438) | def environment(self): method dimensions (line 442) | def dimensions(self): method screenshot (line 445) | def screenshot(self) -> str: method click (line 448) | def click(self, x: int, y: int, button: str) -> None: method double_click (line 451) | def double_click(self, x: int, y: int) -> None: method scroll (line 454) | def scroll(self, x: int, y: int, scroll_x: int, scroll_y: int) -> None: method type (line 457) | def type(self, text: str) -> None: method wait (line 460) | def wait(self) -> None: method move (line 463) | def move(self, x: int, y: int) -> None: method keypress (line 466) | def keypress(self, keys: list[str]) -> None: method drag (line 469) | def drag(self, path: list[tuple[int, int]]) -> None: function test_computer_tool_call_without_computer_tool_raises_error (line 474) | async def test_computer_tool_call_without_computer_tool_raises_error(): function test_computer_tool_call_with_computer_tool_parsed_correctly (line 495) | async def test_computer_tool_call_with_computer_tool_parsed_correctly(): function test_tool_and_handoff_parsed_correctly (line 522) | async def test_tool_and_handoff_parsed_correctly(): FILE: tests/test_runner_guardrail_resume.py function test_runner_resume_preserves_guardrail_results (line 25) | async def test_runner_resume_preserves_guardrail_results(monkeypatch: py... FILE: tests/test_server_conversation_tracker.py class DummyRunItem (line 23) | class DummyRunItem: method __init__ (line 26) | def __init__(self, raw_item: dict[str, Any], type: str = "message") ->... function _make_hosted_mcp_list_tools (line 31) | def _make_hosted_mcp_list_tools(server_label: str, tool_name: str) -> Mc... function test_prepare_input_filters_items_seen_by_server_and_tool_calls (line 47) | def test_prepare_input_filters_items_seen_by_server_and_tool_calls() -> ... function test_mark_input_as_sent_and_rewind_input_respects_remaining_initial_input (line 87) | def test_mark_input_as_sent_and_rewind_input_respects_remaining_initial_... function test_mark_input_as_sent_uses_raw_generated_source_for_rebuilt_filtered_item (line 102) | def test_mark_input_as_sent_uses_raw_generated_source_for_rebuilt_filter... function test_hydrate_from_state_skips_restored_tool_search_items_by_object_identity (line 131) | def test_hydrate_from_state_skips_restored_tool_search_items_by_object_i... function test_hydrate_from_state_skips_restored_tool_search_items_by_fingerprint (line 160) | def test_hydrate_from_state_skips_restored_tool_search_items_by_fingerpr... function test_hydrate_from_state_skips_restored_tool_search_items_when_created_by_is_stripped (line 193) | def test_hydrate_from_state_skips_restored_tool_search_items_when_create... function test_hydrate_from_state_skips_restored_tool_search_items_when_only_ids_differ (line 261) | def test_hydrate_from_state_skips_restored_tool_search_items_when_only_i... function test_prepare_input_keeps_repeated_tool_search_items_with_new_ids (line 325) | def test_prepare_input_keeps_repeated_tool_search_items_with_new_ids() -... function test_track_server_items_skips_live_tool_search_items_on_next_prepare (line 412) | def test_track_server_items_skips_live_tool_search_items_on_next_prepare... function test_track_server_items_filters_pending_tool_search_by_sanitized_fingerprint (line 475) | def test_track_server_items_filters_pending_tool_search_by_sanitized_fin... function test_track_server_items_filters_remaining_initial_input_by_fingerprint (line 517) | def test_track_server_items_filters_remaining_initial_input_by_fingerpri... function test_prepare_input_does_not_skip_fake_response_ids (line 540) | def test_prepare_input_does_not_skip_fake_response_ids() -> None: function test_prepare_input_applies_reasoning_item_id_policy_for_generated_items (line 561) | def test_prepare_input_applies_reasoning_item_id_policy_for_generated_it... function test_prepare_input_does_not_resend_reasoning_item_after_marking_omitted_id_as_sent (line 591) | def test_prepare_input_does_not_resend_reasoning_item_after_marking_omit... function test_get_new_response_marks_filtered_input_as_sent (line 629) | async def test_get_new_response_marks_filtered_input_as_sent() -> None: function test_run_single_turn_streamed_marks_filtered_input_as_sent (line 669) | async def test_run_single_turn_streamed_marks_filtered_input_as_sent() -... function test_run_single_turn_streamed_seeds_hosted_mcp_metadata_from_pre_step_items (line 723) | async def test_run_single_turn_streamed_seeds_hosted_mcp_metadata_from_p... FILE: tests/test_session.py function _run_sync_wrapper (line 16) | def _run_sync_wrapper(agent, input_data, **kwargs): function run_agent_async (line 26) | async def run_agent_async(runner_method: str, agent, input_data, **kwargs): function test_session_memory_basic_functionality_parametrized (line 55) | async def test_session_memory_basic_functionality_parametrized(runner_me... function test_session_memory_with_explicit_instance_parametrized (line 95) | async def test_session_memory_with_explicit_instance_parametrized(runner... function test_session_memory_disabled_parametrized (line 125) | async def test_session_memory_disabled_parametrized(runner_method): function test_session_memory_different_sessions_parametrized (line 147) | async def test_session_memory_different_sessions_parametrized(runner_met... function test_sqlite_session_memory_direct (line 187) | async def test_sqlite_session_memory_direct(): function test_sqlite_session_memory_pop_item (line 218) | async def test_sqlite_session_memory_pop_item(): function test_session_memory_pop_different_sessions (line 277) | async def test_session_memory_pop_different_sessions(): function test_sqlite_session_get_items_with_limit (line 319) | async def test_sqlite_session_get_items_with_limit(): function test_session_memory_appends_list_input_by_default (line 373) | async def test_session_memory_appends_list_input_by_default(runner_method): function test_session_callback_prepared_input (line 401) | async def test_session_callback_prepared_input(runner_method): function test_sqlite_session_unicode_content (line 446) | async def test_sqlite_session_unicode_content(): function test_sqlite_session_special_characters_and_sql_injection (line 470) | async def test_sqlite_session_special_characters_and_sql_injection(): function test_sqlite_session_concurrent_access (line 501) | async def test_sqlite_session_concurrent_access(): function test_session_add_items_exception_propagates_in_streamed (line 541) | async def test_session_add_items_exception_propagates_in_streamed(): function test_session_settings_default (line 576) | async def test_session_settings_default(): function test_session_settings_constructor (line 590) | async def test_session_settings_constructor(): function test_get_items_uses_session_settings_limit (line 603) | async def test_get_items_uses_session_settings_limit(): function test_get_items_explicit_limit_overrides_session_settings (line 631) | async def test_get_items_explicit_limit_overrides_session_settings(): function test_session_settings_resolve (line 657) | async def test_session_settings_resolve(): function test_runner_with_session_settings_override (line 675) | async def test_runner_with_session_settings_override(): FILE: tests/test_session_exceptions.py class FakeRealtimeModel (line 21) | class FakeRealtimeModel(RealtimeModel): method __init__ (line 24) | def __init__(self): method set_next_events (line 30) | def set_next_events(self, events: list[RealtimeModelEvent]) -> None: method connect (line 34) | async def connect(self, options: RealtimeModelConfig) -> None: method _send_events (line 39) | async def _send_events(self) -> None: method add_listener (line 46) | def add_listener(self, listener: RealtimeModelListener) -> None: method remove_listener (line 50) | def remove_listener(self, listener: RealtimeModelListener) -> None: method close (line 55) | async def close(self) -> None: method send_message (line 65) | async def send_message( method send_audio (line 71) | async def send_audio(self, audio: bytes, *, commit: bool = False) -> N... method send_event (line 75) | async def send_event(self, event: Any) -> None: method send_tool_output (line 79) | async def send_tool_output(self, tool_call: Any, output: str, start_re... method interrupt (line 83) | async def interrupt(self) -> None: function fake_agent (line 89) | def fake_agent(): function fake_model (line 99) | def fake_model(): class TestSessionExceptions (line 104) | class TestSessionExceptions: method test_end_to_end_exception_propagation_and_cleanup (line 108) | async def test_end_to_end_exception_propagation_and_cleanup( method test_websocket_connection_closure_type_distinction (line 138) | async def test_websocket_connection_closure_type_distinction( method test_json_parsing_error_handling (line 161) | async def test_json_parsing_error_handling(self, fake_model: FakeRealt... method test_exception_context_preservation (line 182) | async def test_exception_context_preservation(self, fake_model: FakeRe... method test_multiple_exception_handling_behavior (line 210) | async def test_multiple_exception_handling_behavior( method test_exception_during_guardrail_processing (line 240) | async def test_exception_during_guardrail_processing( method test_normal_events_still_work_before_exception (line 276) | async def test_normal_events_still_work_before_exception( FILE: tests/test_session_limit.py function test_session_limit_parameter (line 17) | async def test_session_limit_parameter(runner_method): function test_session_limit_zero (line 67) | async def test_session_limit_zero(runner_method): function test_session_limit_none_gets_all_history (line 104) | async def test_session_limit_none_gets_all_history(runner_method): function test_session_limit_larger_than_history (line 144) | async def test_session_limit_larger_than_history(runner_method): FILE: tests/test_shell_call_serialization.py function test_coerce_shell_call_reads_max_output_length (line 13) | def test_coerce_shell_call_reads_max_output_length() -> None: function test_coerce_shell_call_requires_commands (line 26) | def test_coerce_shell_call_requires_commands() -> None: function test_normalize_shell_output_handles_timeout (line 32) | def test_normalize_shell_output_handles_timeout() -> None: function test_normalize_shell_output_converts_string_outcome (line 44) | def test_normalize_shell_output_converts_string_outcome() -> None: function test_serialize_shell_output_emits_canonical_outcome (line 57) | def test_serialize_shell_output_emits_canonical_outcome() -> None: function test_shell_rejection_payload_preserves_missing_exit_code (line 69) | def test_shell_rejection_payload_preserves_missing_exit_code() -> None: function test_shell_output_preserves_zero_exit_code (line 95) | def test_shell_output_preserves_zero_exit_code() -> None: FILE: tests/test_shell_tool.py function _get_function_span (line 36) | def _get_function_span(tool_name: str) -> dict[str, Any]: function _shell_call (line 49) | def _shell_call(call_id: str = "call_shell") -> dict[str, Any]: function test_shell_tool_defaults_to_local_environment (line 61) | def test_shell_tool_defaults_to_local_environment() -> None: function test_shell_tool_supports_hosted_environment_without_executor (line 68) | def test_shell_tool_supports_hosted_environment_without_executor() -> None: function test_shell_tool_normalizes_container_auto_environment (line 80) | def test_shell_tool_normalizes_container_auto_environment() -> None: function test_shell_tool_rejects_local_mode_without_executor (line 144) | def test_shell_tool_rejects_local_mode_without_executor() -> None: function test_shell_tool_allows_unvalidated_hosted_environment_shapes (line 152) | def test_shell_tool_allows_unvalidated_hosted_environment_shapes() -> None: function test_shell_tool_rejects_local_executor_and_approval_for_hosted_environment (line 174) | def test_shell_tool_rejects_local_executor_and_approval_for_hosted_envir... function test_execute_shell_calls_surfaces_missing_local_executor (line 195) | async def test_execute_shell_calls_surfaces_missing_local_executor() -> ... function test_shell_tool_structured_output_is_rendered (line 225) | async def test_shell_tool_structured_output_is_rendered() -> None: function test_shell_tool_emits_function_span (line 289) | async def test_shell_tool_emits_function_span() -> None: function test_shell_tool_redacts_span_error_when_sensitive_data_disabled (line 313) | async def test_shell_tool_redacts_span_error_when_sensitive_data_disable... function test_shell_tool_executor_failure_returns_error (line 354) | async def test_shell_tool_executor_failure_returns_error() -> None: function test_shell_tool_output_respects_max_output_length (line 406) | async def test_shell_tool_output_respects_max_output_length() -> None: function test_shell_tool_uses_smaller_max_output_length (line 452) | async def test_shell_tool_uses_smaller_max_output_length() -> None: function test_shell_tool_executor_can_override_max_output_length_to_zero (line 499) | async def test_shell_tool_executor_can_override_max_output_length_to_zer... function test_shell_tool_action_can_request_zero_max_output_length (line 546) | async def test_shell_tool_action_can_request_zero_max_output_length() ->... function test_shell_tool_action_negative_max_output_length_clamps_to_zero (line 592) | async def test_shell_tool_action_negative_max_output_length_clamps_to_ze... function test_shell_tool_needs_approval_returns_approval_item (line 638) | async def test_shell_tool_needs_approval_returns_approval_item() -> None: function test_shell_tool_needs_approval_rejected_returns_rejection (line 664) | async def test_shell_tool_needs_approval_rejected_returns_rejection() ->... function test_shell_tool_rejection_uses_run_level_formatter (line 697) | async def test_shell_tool_rejection_uses_run_level_formatter() -> None: function test_shell_tool_on_approval_callback_auto_approves (line 729) | async def test_shell_tool_on_approval_callback_auto_approves() -> None: function test_shell_tool_on_approval_callback_auto_rejects (line 756) | async def test_shell_tool_on_approval_callback_auto_rejects() -> None: FILE: tests/test_soft_cancel.py function test_soft_cancel_completes_turn (line 14) | async def test_soft_cancel_completes_turn(): function test_soft_cancel_vs_immediate (line 34) | async def test_soft_cancel_vs_immediate(): function test_soft_cancel_with_tool_calls (line 63) | async def test_soft_cancel_with_tool_calls(): function test_soft_cancel_saves_session (line 100) | async def test_soft_cancel_saves_session(): function test_soft_cancel_tracks_usage (line 127) | async def test_soft_cancel_tracks_usage(): function test_soft_cancel_stops_next_turn (line 143) | async def test_soft_cancel_stops_next_turn(): function test_cancel_mode_backward_compatibility (line 174) | async def test_cancel_mode_backward_compatibility(): function test_soft_cancel_idempotent (line 195) | async def test_soft_cancel_idempotent(): function test_soft_cancel_before_streaming (line 214) | async def test_soft_cancel_before_streaming(): function test_soft_cancel_mixed_modes (line 230) | async def test_soft_cancel_mixed_modes(): function test_soft_cancel_explicit_immediate_mode (line 250) | async def test_soft_cancel_explicit_immediate_mode(): function test_soft_cancel_with_multiple_tool_calls (line 271) | async def test_soft_cancel_with_multiple_tool_calls(): function test_soft_cancel_preserves_state (line 311) | async def test_soft_cancel_preserves_state(): function test_immediate_cancel_clears_queues (line 341) | async def test_immediate_cancel_clears_queues(): function test_soft_cancel_does_not_clear_queues_immediately (line 360) | async def test_soft_cancel_does_not_clear_queues_immediately(): function test_soft_cancel_with_handoff (line 381) | async def test_soft_cancel_with_handoff(): function test_soft_cancel_with_session_and_multiple_turns (line 440) | async def test_soft_cancel_with_session_and_multiple_turns(): FILE: tests/test_source_compat_constructors.py function test_run_config_positional_arguments_remain_backward_compatible (line 28) | def test_run_config_positional_arguments_remain_backward_compatible() ->... function test_run_config_session_settings_positional_binding_is_preserved (line 38) | def test_run_config_session_settings_positional_binding_is_preserved() -... function test_run_config_reasoning_item_id_policy_positional_binding (line 66) | def test_run_config_reasoning_item_id_policy_positional_binding() -> None: function test_function_tool_positional_arguments_keep_guardrail_positions (line 95) | def test_function_tool_positional_arguments_keep_guardrail_positions() -... function test_agent_hook_context_third_positional_argument_is_turn_input (line 131) | def test_agent_hook_context_third_positional_argument_is_turn_input() ->... function test_tool_context_v070_positional_constructor_still_works (line 139) | def test_tool_context_v070_positional_constructor_still_works() -> None: function test_tool_context_supports_agent_keyword_argument (line 150) | def test_tool_context_supports_agent_keyword_argument() -> None: function test_run_result_v070_positional_constructor_still_works (line 162) | def test_run_result_v070_positional_constructor_still_works() -> None: function test_run_result_streaming_v070_positional_constructor_still_works (line 179) | def test_run_result_streaming_v070_positional_constructor_still_works() ... function test_run_result_streaming_v070_optional_positional_constructor_still_works (line 200) | def test_run_result_streaming_v070_optional_positional_constructor_still... function test_run_result_streaming_accepts_legacy_run_impl_task_keyword (line 231) | def test_run_result_streaming_accepts_legacy_run_impl_task_keyword() -> ... function test_run_result_streaming_accepts_run_loop_task_keyword (line 253) | def test_run_result_streaming_accepts_run_loop_task_keyword() -> None: function test_run_result_streaming_v070_run_impl_task_positional_binding_is_preserved (line 275) | def test_run_result_streaming_v070_run_impl_task_positional_binding_is_p... FILE: tests/test_stream_events.py function get_reasoning_item (line 58) | def get_reasoning_item() -> ResponseReasoningItem: function _make_hosted_mcp_list_tools (line 64) | def _make_hosted_mcp_list_tools(server_label: str, tool_name: str) -> Mc... function foo (line 81) | async def foo() -> str: function test_stream_events_main (line 87) | async def test_stream_events_main(): function test_stream_events_tool_called_includes_local_mcp_title (line 126) | async def test_stream_events_tool_called_includes_local_mcp_title() -> N... function test_stream_step_items_to_queue_emits_helper_events_and_skips_approvals (line 162) | def test_stream_step_items_to_queue_emits_helper_events_and_skips_approv... function test_stream_step_result_to_queue_uses_new_step_items (line 237) | def test_stream_step_result_to_queue_uses_new_step_items() -> None: function test_stream_events_main_with_handoff (line 257) | async def test_stream_events_main_with_handoff(): function test_complete_streaming_events (line 311) | async def test_complete_streaming_events(): function test_stream_events_emit_tool_search_items (line 458) | async def test_stream_events_emit_tool_search_items() -> None: FILE: tests/test_stream_input_guardrail_timing.py function make_input_guardrail (line 21) | def make_input_guardrail(delay_seconds: float, *, trip: bool) -> InputGu... function test_input_guardrail_results_follow_completion_order (line 37) | async def test_input_guardrail_results_follow_completion_order(): function test_run_streamed_input_guardrail_timing_is_consistent (line 74) | async def test_run_streamed_input_guardrail_timing_is_consistent(guardra... function test_run_streamed_input_guardrail_sequences_match_between_fast_and_slow (line 121) | async def test_run_streamed_input_guardrail_sequences_match_between_fast... function test_run_streamed_input_guardrail_tripwire_raises (line 148) | async def test_run_streamed_input_guardrail_tripwire_raises(guardrail_de... class SlowCompleteFakeModel (line 176) | class SlowCompleteFakeModel(FakeModel): method __init__ (line 179) | def __init__(self, delay_seconds: float, tracing_enabled: bool = True): method stream_response (line 183) | async def stream_response(self, *args, **kwargs): function _get_span_by_type (line 190) | def _get_span_by_type(spans, span_type: str): function _iso (line 200) | def _iso(s: str | None) -> datetime: function test_parent_span_and_trace_finish_after_slow_input_guardrail (line 206) | async def test_parent_span_and_trace_finish_after_slow_input_guardrail(): function test_parent_span_and_trace_finish_after_slow_model (line 240) | async def test_parent_span_and_trace_finish_after_slow_model(): FILE: tests/test_streaming_logging.py function test_run_streamed_resume_omits_tool_output_in_log_when_dont_log (line 18) | async def test_run_streamed_resume_omits_tool_output_in_log_when_dont_log( FILE: tests/test_streaming_tool_call_arguments.py class StreamingFakeModel (line 34) | class StreamingFakeModel(Model): method __init__ (line 37) | def __init__(self): method set_next_output (line 41) | def set_next_output(self, output: list[TResponseOutputItem]): method get_next_output (line 44) | def get_next_output(self) -> list[TResponseOutputItem]: method get_response (line 49) | async def get_response( method stream_response (line 65) | async def stream_response( function calculate_sum (line 134) | def calculate_sum(a: int, b: int) -> str: function format_message (line 140) | def format_message(name: str, message: str, urgent: bool = False) -> str: function test_streaming_tool_call_arguments_not_empty (line 147) | async def test_streaming_tool_call_arguments_not_empty(): function test_streaming_tool_call_arguments_complex (line 213) | async def test_streaming_tool_call_arguments_complex(): function test_streaming_multiple_tool_calls_arguments (line 266) | async def test_streaming_multiple_tool_calls_arguments(): function test_streaming_tool_call_with_empty_arguments (line 325) | async def test_streaming_tool_call_with_empty_arguments(): FILE: tests/test_strict_schema.py function test_empty_schema_has_additional_properties_false (line 7) | def test_empty_schema_has_additional_properties_false(): function test_non_dict_schema_errors (line 12) | def test_non_dict_schema_errors(): function test_object_without_additional_properties (line 17) | def test_object_without_additional_properties(): function test_object_with_true_additional_properties (line 29) | def test_object_with_true_additional_properties(): function test_array_items_processing_and_default_removal (line 40) | def test_array_items_processing_and_default_removal(): function test_anyOf_processing (line 53) | def test_anyOf_processing(): function test_allOf_single_entry_merging (line 74) | def test_allOf_single_entry_merging(): function test_default_removal_on_non_object (line 90) | def test_default_removal_on_non_object(): function test_ref_expansion (line 98) | def test_ref_expansion(): function test_ref_no_expansion_when_alone (line 114) | def test_ref_no_expansion_when_alone(): function test_invalid_ref_format (line 122) | def test_invalid_ref_format(): FILE: tests/test_strict_schema_oneof.py function test_oneof_converted_to_anyof (line 9) | def test_oneof_converted_to_anyof(): function test_nested_oneof_in_array_items (line 26) | def test_nested_oneof_in_array_items(): function test_discriminated_union_with_pydantic (line 107) | def test_discriminated_union_with_pydantic(): function test_oneof_merged_with_existing_anyof (line 135) | def test_oneof_merged_with_existing_anyof(): function test_discriminator_preserved (line 152) | def test_discriminator_preserved(): function test_deeply_nested_oneof (line 197) | def test_deeply_nested_oneof(): function test_oneof_with_refs (line 236) | def test_oneof_with_refs(): FILE: tests/test_tool_choice_reset.py class TestToolChoiceReset (line 10) | class TestToolChoiceReset: method test_should_reset_tool_choice_direct (line 11) | def test_should_reset_tool_choice_direct(self): method test_required_tool_choice_with_multiple_runs (line 72) | async def test_required_tool_choice_with_multiple_runs(self): method test_required_with_stop_at_tool_name (line 108) | async def test_required_with_stop_at_tool_name(self): method test_specific_tool_choice (line 134) | async def test_specific_tool_choice(self): method test_required_with_single_tool (line 160) | async def test_required_with_single_tool(self): method test_dont_reset_tool_choice_if_not_required (line 190) | async def test_dont_reset_tool_choice_if_not_required(self): FILE: tests/test_tool_context.py function test_tool_context_requires_fields (line 15) | def test_tool_context_requires_fields() -> None: function test_tool_context_missing_defaults_raise (line 21) | def test_tool_context_missing_defaults_raise() -> None: function test_tool_context_from_agent_context_populates_fields (line 31) | def test_tool_context_from_agent_context_populates_fields() -> None: function test_tool_context_agent_none_by_default (line 54) | def test_tool_context_agent_none_by_default() -> None: function test_tool_context_constructor_accepts_agent_keyword (line 68) | def test_tool_context_constructor_accepts_agent_keyword() -> None: function test_tool_context_constructor_infers_namespace_from_tool_call (line 81) | def test_tool_context_constructor_infers_namespace_from_tool_call() -> N... function test_tool_context_qualified_tool_name_collapses_synthetic_namespace (line 102) | def test_tool_context_qualified_tool_name_collapses_synthetic_namespace(... function test_tool_context_from_tool_context_inherits_agent (line 123) | def test_tool_context_from_tool_context_inherits_agent() -> None: function test_tool_context_from_tool_context_inherits_run_config (line 155) | def test_tool_context_from_tool_context_inherits_run_config() -> None: function test_tool_context_from_agent_context_prefers_explicit_run_config (line 187) | def test_tool_context_from_agent_context_prefers_explicit_run_config() -... function test_invoke_function_tool_passes_plain_run_context_when_requested (line 208) | async def test_invoke_function_tool_passes_plain_run_context_when_reques... function test_invoke_function_tool_preserves_tool_context_when_requested (line 248) | async def test_invoke_function_tool_preserves_tool_context_when_requeste... function test_invoke_function_tool_ignores_context_name_substrings_in_string_annotations (line 283) | async def test_invoke_function_tool_ignores_context_name_substrings_in_s... function test_invoke_function_tool_ignores_annotated_string_metadata_when_matching_context (line 319) | async def test_invoke_function_tool_ignores_annotated_string_metadata_wh... FILE: tests/test_tool_converter.py function some_function (line 10) | def some_function(a: str, b: list[int]) -> str: function test_to_openai_with_function_tool (line 14) | def test_to_openai_with_function_tool(): function test_to_openai_respects_non_strict_function_tool (line 31) | def test_to_openai_respects_non_strict_function_tool(): class Foo (line 38) | class Foo(BaseModel): function test_convert_handoff_tool (line 43) | def test_convert_handoff_tool(): function test_tool_converter_hosted_tools_errors (line 59) | def test_tool_converter_hosted_tools_errors(): function test_tool_converter_rejects_namespaced_function_tools_for_chat_backends (line 67) | def test_tool_converter_rejects_namespaced_function_tools_for_chat_backe... function test_tool_converter_rejects_deferred_function_tools_for_chat_backends (line 78) | def test_tool_converter_rejects_deferred_function_tools_for_chat_backend... FILE: tests/test_tool_guardrails.py function get_mock_tool_context (line 23) | def get_mock_tool_context(tool_arguments: str = '{"param": "value"}') ->... function get_sync_input_guardrail (line 33) | def get_sync_input_guardrail(triggers: bool, output_info: Any | None = N... function get_async_input_guardrail (line 45) | def get_async_input_guardrail(triggers: bool, output_info: Any | None = ... function get_sync_output_guardrail (line 57) | def get_sync_output_guardrail(triggers: bool, output_info: Any | None = ... function get_async_output_guardrail (line 69) | def get_async_output_guardrail(triggers: bool, output_info: Any | None =... function test_sync_tool_input_guardrail (line 82) | async def test_sync_tool_input_guardrail(): function test_async_tool_input_guardrail (line 114) | async def test_async_tool_input_guardrail(): function test_sync_tool_output_guardrail (line 146) | async def test_sync_tool_output_guardrail(): function test_async_tool_output_guardrail (line 179) | async def test_async_tool_output_guardrail(): function test_invalid_tool_input_guardrail_raises_user_error (line 212) | async def test_invalid_tool_input_guardrail_raises_user_error(): function test_invalid_tool_output_guardrail_raises_user_error (line 225) | async def test_invalid_tool_output_guardrail_raises_user_error(): function decorated_input_guardrail (line 242) | def decorated_input_guardrail(data: ToolInputGuardrailData) -> ToolGuard... function decorated_named_input_guardrail (line 247) | def decorated_named_input_guardrail(data: ToolInputGuardrailData) -> Too... function test_tool_input_guardrail_decorators (line 252) | async def test_tool_input_guardrail_decorators(): function decorated_output_guardrail (line 274) | def decorated_output_guardrail(data: ToolOutputGuardrailData) -> ToolGua... function decorated_named_output_guardrail (line 279) | def decorated_named_output_guardrail(data: ToolOutputGuardrailData) -> T... function test_tool_output_guardrail_decorators (line 284) | async def test_tool_output_guardrail_decorators(): function test_password_blocking_input_guardrail (line 310) | async def test_password_blocking_input_guardrail(): function test_ssn_blocking_output_guardrail (line 343) | async def test_ssn_blocking_output_guardrail(): function test_tool_input_guardrail_exception (line 376) | def test_tool_input_guardrail_exception(): function test_tool_output_guardrail_exception (line 395) | def test_tool_output_guardrail_exception(): function test_allow_behavior (line 418) | async def test_allow_behavior(): function test_reject_content_behavior (line 435) | async def test_reject_content_behavior(): function test_raise_exception_behavior (line 455) | async def test_raise_exception_behavior(): function test_mixed_behavior_output_guardrail (line 472) | async def test_mixed_behavior_output_guardrail(): function main (line 523) | async def main(): FILE: tests/test_tool_metadata.py class DummyEditor (line 25) | class DummyEditor: method create_file (line 26) | def create_file(self, operation): method update_file (line 29) | def update_file(self, operation): method delete_file (line 32) | def delete_file(self, operation): function test_tool_name_properties (line 36) | def test_tool_name_properties() -> None: function test_shell_command_output_status_property (line 56) | def test_shell_command_output_status_property() -> None: function test_tool_context_from_agent_context (line 61) | def test_tool_context_from_agent_context() -> None: FILE: tests/test_tool_output_conversion.py function _make_tool_call (line 8) | def _make_tool_call() -> ResponseFunctionToolCall: function test_tool_call_output_item_text_model (line 18) | def test_tool_call_output_item_text_model() -> None: function test_tool_call_output_item_image_model (line 31) | def test_tool_call_output_item_image_model() -> None: function test_tool_call_output_item_file_model (line 45) | def test_tool_call_output_item_file_model() -> None: function test_tool_call_output_item_mixed_list (line 59) | def test_tool_call_output_item_mixed_list() -> None: function test_tool_call_output_item_image_forwards_file_id_and_detail (line 79) | def test_tool_call_output_item_image_forwards_file_id_and_detail() -> None: function test_tool_call_output_item_file_forwards_file_id_and_filename (line 94) | def test_tool_call_output_item_file_forwards_file_id_and_filename() -> N... function test_tool_call_output_item_file_forwards_file_url (line 109) | def test_tool_call_output_item_file_forwards_file_url() -> None: function test_tool_call_output_item_text_dict_variant (line 123) | def test_tool_call_output_item_text_dict_variant() -> None: function test_tool_call_output_item_image_dict_variant (line 139) | def test_tool_call_output_item_image_dict_variant() -> None: function test_tool_call_output_item_image_dict_variant_with_file_id (line 155) | def test_tool_call_output_item_image_dict_variant_with_file_id() -> None: function test_tool_call_output_item_file_dict_variant_with_file_data (line 170) | def test_tool_call_output_item_file_dict_variant_with_file_data() -> None: function test_tool_call_output_item_file_dict_variant_with_file_url (line 186) | def test_tool_call_output_item_file_dict_variant_with_file_url() -> None: function test_tool_call_output_item_file_dict_variant_with_file_id (line 202) | def test_tool_call_output_item_file_dict_variant_with_file_id() -> None: function test_tool_call_output_item_image_with_extra_fields (line 218) | def test_tool_call_output_item_image_with_extra_fields() -> None: function test_tool_call_output_item_mixed_list_with_valid_dicts (line 235) | def test_tool_call_output_item_mixed_list_with_valid_dicts() -> None: function test_tool_call_output_item_text_type_only_not_converted (line 257) | def test_tool_call_output_item_text_type_only_not_converted() -> None: function test_tool_call_output_item_image_type_only_not_converted (line 270) | def test_tool_call_output_item_image_type_only_not_converted() -> None: function test_tool_call_output_item_file_type_only_not_converted (line 283) | def test_tool_call_output_item_file_type_only_not_converted() -> None: function test_tool_call_output_item_empty_dict_not_converted (line 295) | def test_tool_call_output_item_empty_dict_not_converted() -> None: function test_tool_call_output_item_dict_without_type_not_converted (line 307) | def test_tool_call_output_item_dict_without_type_not_converted() -> None: function test_tool_call_output_item_image_dict_variant_with_location_not_converted (line 320) | def test_tool_call_output_item_image_dict_variant_with_location_not_conv... function test_tool_call_output_item_file_dict_variant_with_path_not_converted (line 333) | def test_tool_call_output_item_file_dict_variant_with_path_not_converted... function test_tool_call_output_item_list_without_type_not_converted (line 346) | def test_tool_call_output_item_list_without_type_not_converted() -> None: function test_tool_call_output_item_mixed_list_partial_invalid_not_converted (line 359) | def test_tool_call_output_item_mixed_list_partial_invalid_not_converted(... FILE: tests/test_tool_use_behavior.py function _make_function_tool_result (line 25) | def _make_function_tool_result( function test_no_tool_results_returns_not_final_output (line 48) | async def test_no_tool_results_returns_not_final_output() -> None: function test_run_llm_again_behavior (line 61) | async def test_run_llm_again_behavior() -> None: function test_stop_on_first_tool_behavior (line 75) | async def test_stop_on_first_tool_behavior() -> None: function test_custom_tool_use_behavior_sync (line 92) | async def test_custom_tool_use_behavior_sync() -> None: function test_custom_tool_use_behavior_async (line 117) | async def test_custom_tool_use_behavior_async() -> None: function test_invalid_tool_use_behavior_raises (line 142) | async def test_invalid_tool_use_behavior_raises() -> None: function test_tool_names_to_stop_at_behavior (line 157) | async def test_tool_names_to_stop_at_behavior() -> None: function test_stop_at_tool_names_supports_public_and_qualified_names_for_namespaced_tools (line 195) | async def test_stop_at_tool_names_supports_public_and_qualified_names_fo... FILE: tests/test_tool_use_tracker.py function test_tool_use_tracker_as_serializable_uses_agent_map_or_runtime_snapshot (line 20) | def test_tool_use_tracker_as_serializable_uses_agent_map_or_runtime_snap... function test_tool_use_tracker_from_and_serialize_snapshots (line 31) | def test_tool_use_tracker_from_and_serialize_snapshots() -> None: function test_record_used_tools_uses_trace_names_for_namespaced_and_deferred_functions (line 42) | def test_record_used_tools_uses_trace_names_for_namespaced_and_deferred_... function test_record_processed_response_ignores_hosted_tool_search_for_resets (line 80) | def test_record_processed_response_ignores_hosted_tool_search_for_resets(): function test_record_processed_response_keeps_function_named_tool_search (line 108) | def test_record_processed_response_keeps_function_named_tool_search(): function test_record_processed_response_counts_output_only_tools_without_shifting_names (line 136) | def test_record_processed_response_counts_output_only_tools_without_shif... function test_hydrate_tool_use_tracker_skips_unknown_agents (line 171) | def test_hydrate_tool_use_tracker_skips_unknown_agents() -> None: FILE: tests/test_trace_processor.py function get_span (line 16) | def get_span(processor: TracingProcessor) -> SpanImpl[AgentSpanData]: function get_trace (line 28) | def get_trace(processor: TracingProcessor) -> TraceImpl: function mocked_exporter (line 41) | def mocked_exporter(): function test_batch_trace_processor_on_trace_start (line 47) | def test_batch_trace_processor_on_trace_start(mocked_exporter): function test_batch_trace_processor_on_span_end (line 58) | def test_batch_trace_processor_on_span_end(mocked_exporter): function test_batch_trace_processor_queue_full (line 69) | def test_batch_trace_processor_queue_full(mocked_exporter): function test_batch_processor_doesnt_enqueue_on_trace_end_or_span_start (line 86) | def test_batch_processor_doesnt_enqueue_on_trace_end_or_span_start(mocke... function test_batch_trace_processor_force_flush (line 104) | def test_batch_trace_processor_force_flush(mocked_exporter): function test_batch_trace_processor_shutdown_flushes (line 126) | def test_batch_trace_processor_shutdown_flushes(mocked_exporter): function test_batch_trace_processor_scheduled_export (line 144) | def test_batch_trace_processor_scheduled_export(mocked_exporter): function patched_time_sleep (line 175) | def patched_time_sleep(): function mock_processor (line 184) | def mock_processor(): function test_backend_span_exporter_no_items (line 192) | def test_backend_span_exporter_no_items(mock_client): function test_backend_span_exporter_no_api_key (line 201) | def test_backend_span_exporter_no_api_key(mock_client): function test_backend_span_exporter_2xx_success (line 214) | def test_backend_span_exporter_2xx_success(mock_client): function test_backend_span_exporter_4xx_client_error (line 228) | def test_backend_span_exporter_4xx_client_error(mock_client): function test_backend_span_exporter_5xx_retry (line 243) | def test_backend_span_exporter_5xx_retry(mock_client, patched_time_sleep): function test_backend_span_exporter_request_error (line 260) | def test_backend_span_exporter_request_error(mock_client, patched_time_s... function test_backend_span_exporter_close (line 274) | def test_backend_span_exporter_close(mock_client): function test_backend_span_exporter_sanitizes_generation_usage_for_openai_tracing (line 283) | def test_backend_span_exporter_sanitizes_generation_usage_for_openai_tra... function test_backend_span_exporter_truncates_large_input_for_openai_tracing (line 338) | def test_backend_span_exporter_truncates_large_input_for_openai_tracing(... function test_backend_span_exporter_truncates_large_structured_input_without_stringifying (line 372) | def test_backend_span_exporter_truncates_large_structured_input_without_... function test_backend_span_exporter_keeps_generation_usage_for_custom_endpoint (line 412) | def test_backend_span_exporter_keeps_generation_usage_for_custom_endpoin... function test_backend_span_exporter_does_not_modify_non_generation_usage (line 450) | def test_backend_span_exporter_does_not_modify_non_generation_usage(mock... function test_sanitize_for_openai_tracing_api_keeps_allowed_generation_usage (line 475) | def test_sanitize_for_openai_tracing_api_keeps_allowed_generation_usage(): function test_backend_span_exporter_keeps_large_input_for_custom_endpoint (line 492) | def test_backend_span_exporter_keeps_large_input_for_custom_endpoint(moc... function test_sanitize_for_openai_tracing_api_moves_unsupported_generation_usage_to_details (line 524) | def test_sanitize_for_openai_tracing_api_moves_unsupported_generation_us... function test_sanitize_for_openai_tracing_api_filters_non_json_values_in_usage_details (line 554) | def test_sanitize_for_openai_tracing_api_filters_non_json_values_in_usag... function test_sanitize_for_openai_tracing_api_handles_cyclic_usage_values (line 593) | def test_sanitize_for_openai_tracing_api_handles_cyclic_usage_values(): function test_sanitize_for_openai_tracing_api_drops_non_dict_generation_usage_details (line 629) | def test_sanitize_for_openai_tracing_api_drops_non_dict_generation_usage... function test_sanitize_for_openai_tracing_api_drops_generation_usage_missing_required_tokens (line 650) | def test_sanitize_for_openai_tracing_api_drops_generation_usage_missing_... function test_sanitize_for_openai_tracing_api_rejects_boolean_token_counts (line 671) | def test_sanitize_for_openai_tracing_api_rejects_boolean_token_counts(): function test_sanitize_for_openai_tracing_api_skips_non_dict_generation_usage (line 692) | def test_sanitize_for_openai_tracing_api_skips_non_dict_generation_usage(): function test_sanitize_for_openai_tracing_api_keeps_small_input_without_mutation (line 705) | def test_sanitize_for_openai_tracing_api_keeps_small_input_without_mutat... function test_sanitize_for_openai_tracing_api_truncates_oversized_output (line 720) | def test_sanitize_for_openai_tracing_api_truncates_oversized_output(): function test_sanitize_for_openai_tracing_api_preserves_generation_input_list_shape (line 743) | def test_sanitize_for_openai_tracing_api_preserves_generation_input_list... function test_sanitize_for_openai_tracing_api_replaces_unserializable_output (line 779) | def test_sanitize_for_openai_tracing_api_replaces_unserializable_output(): function test_truncate_string_for_json_limit_returns_original_when_within_limit (line 798) | def test_truncate_string_for_json_limit_returns_original_when_within_lim... function test_truncate_string_for_json_limit_returns_suffix_when_limit_equals_suffix (line 807) | def test_truncate_string_for_json_limit_returns_suffix_when_limit_equals... function test_truncate_string_for_json_limit_returns_empty_when_suffix_too_large (line 818) | def test_truncate_string_for_json_limit_returns_empty_when_suffix_too_la... function test_truncate_string_for_json_limit_handles_escape_heavy_input (line 828) | def test_truncate_string_for_json_limit_handles_escape_heavy_input(): FILE: tests/test_tracing.py function standard_span_checks (line 33) | def standard_span_checks( function standard_trace_checks (line 44) | def standard_trace_checks(trace: Trace, name_check: str | None = None) -... function simple_tracing (line 54) | def simple_tracing(): function test_simple_tracing (line 74) | def test_simple_tracing() -> None: function ctxmanager_spans (line 105) | def ctxmanager_spans(): function test_ctxmanager_spans (line 115) | def test_ctxmanager_spans() -> None: function run_subtask (line 143) | async def run_subtask(span_id: str | None = None) -> None: function simple_async_tracing (line 148) | async def simple_async_tracing(): function test_async_tracing (line 155) | async def test_async_tracing() -> None: function run_tasks_parallel (line 172) | async def run_tasks_parallel(span_ids: list[str]) -> None: function run_tasks_as_children (line 178) | async def run_tasks_as_children(first_span_id: str, second_span_id: str)... function complex_async_tracing (line 183) | async def complex_async_tracing(): function test_complex_async_tracing (line 196) | async def test_complex_async_tracing() -> None: function spans_with_setters (line 227) | def spans_with_setters(): function test_spans_with_setters (line 243) | def test_spans_with_setters() -> None: function disabled_tracing (line 276) | def disabled_tracing(): function test_disabled_tracing (line 283) | def test_disabled_tracing(): function enabled_trace_disabled_span (line 288) | def enabled_trace_disabled_span(): function test_enabled_trace_disabled_span (line 296) | def test_enabled_trace_disabled_span(): function test_start_and_end_called_manual (line 314) | def test_start_and_end_called_manual(): function test_start_and_end_called_ctxmanager (line 331) | def test_start_and_end_called_ctxmanager(): function test_start_and_end_called_async_ctxmanager (line 355) | async def test_start_and_end_called_async_ctxmanager(): function test_noop_span_doesnt_record (line 370) | async def test_noop_span_doesnt_record(): function test_multiple_span_start_finish_doesnt_crash (line 384) | async def test_multiple_span_start_finish_doesnt_crash(): function test_noop_parent_is_noop_child (line 392) | async def test_noop_parent_is_noop_child(): function test_trace_and_spans_use_tracing_config_key (line 408) | def test_trace_and_spans_use_tracing_config_key(): function test_trace_metadata_propagates_to_spans (line 415) | def test_trace_metadata_propagates_to_spans(): function test_processor_can_lookup_trace_metadata_by_span_trace_id (line 426) | def test_processor_can_lookup_trace_metadata_by_span_trace_id(): function test_trace_to_json_only_includes_tracing_api_key_when_requested (line 473) | def test_trace_to_json_only_includes_tracing_api_key_when_requested(): FILE: tests/test_tracing_errors.py function test_single_turn_model_error (line 33) | async def test_single_turn_model_error(): function test_multi_turn_no_handoffs (line 74) | async def test_multi_turn_no_handoffs(): function test_tool_call_error (line 136) | async def test_tool_call_error(): function test_multiple_handoff_doesnt_error (line 203) | async def test_multiple_handoff_doesnt_error(): class Foo (line 288) | class Foo(TypedDict): function test_multiple_final_output_doesnt_error (line 293) | async def test_multiple_final_output_doesnt_error(): function test_handoffs_lead_to_correct_agent_spans (line 329) | async def test_handoffs_lead_to_correct_agent_spans(): function test_max_turns_exceeded (line 457) | async def test_max_turns_exceeded(): function guardrail_function (line 513) | def guardrail_function( function test_guardrail_error (line 523) | async def test_guardrail_error(): FILE: tests/test_tracing_errors_streamed.py function wait_for_normalized_spans (line 35) | async def wait_for_normalized_spans(timeout: float = 0.2): function test_single_turn_model_error (line 54) | async def test_single_turn_model_error(): function test_multi_turn_no_handoffs (line 98) | async def test_multi_turn_no_handoffs(): function test_tool_call_error (line 163) | async def test_tool_call_error(): function test_multiple_handoff_doesnt_error (line 232) | async def test_multiple_handoff_doesnt_error(): class Foo (line 315) | class Foo(TypedDict): function test_multiple_final_output_no_error (line 320) | async def test_multiple_final_output_no_error(): function test_handoffs_lead_to_correct_agent_spans (line 360) | async def test_handoffs_lead_to_correct_agent_spans(): function test_max_turns_exceeded (line 485) | async def test_max_turns_exceeded(): function input_guardrail_function (line 543) | def input_guardrail_function( function test_input_guardrail_error (line 553) | async def test_input_guardrail_error(): function output_guardrail_function (line 596) | def output_guardrail_function( function test_output_guardrail_error (line 606) | async def test_output_guardrail_error(): FILE: tests/test_tracing_provider_safe_debug.py class _CapturingHandler (line 10) | class _CapturingHandler(logging.Handler): method __init__ (line 11) | def __init__(self) -> None: method emit (line 15) | def emit(self, record: logging.LogRecord) -> None: # pragma: no cover... function test_safe_debug_skips_logging_when_handler_stream_closed (line 19) | def test_safe_debug_skips_logging_when_handler_stream_closed() -> None: FILE: tests/test_usage.py function test_runner_run_carries_request_usage_entries (line 14) | async def test_runner_run_carries_request_usage_entries() -> None: function test_usage_add_aggregates_all_fields (line 47) | def test_usage_add_aggregates_all_fields(): function test_usage_add_aggregates_with_none_values (line 75) | def test_usage_add_aggregates_with_none_values(): function test_request_usage_creation (line 96) | def test_request_usage_creation(): function test_usage_add_preserves_single_request (line 113) | def test_usage_add_preserves_single_request(): function test_usage_add_ignores_zero_token_requests (line 137) | def test_usage_add_ignores_zero_token_requests(): function test_usage_add_ignores_multi_request_usage (line 155) | def test_usage_add_ignores_multi_request_usage(): function test_usage_add_merges_existing_request_usage_entries (line 173) | def test_usage_add_merges_existing_request_usage_entries(): function test_usage_add_with_pre_existing_request_usage_entries (line 215) | def test_usage_add_with_pre_existing_request_usage_entries(): function test_usage_request_usage_entries_default_empty (line 249) | def test_usage_request_usage_entries_default_empty(): function test_anthropic_cost_calculation_scenario (line 255) | def test_anthropic_cost_calculation_scenario(): function test_usage_normalizes_none_token_details (line 313) | def test_usage_normalizes_none_token_details(): function test_usage_normalizes_chat_completions_types (line 352) | def test_usage_normalizes_chat_completions_types(): FILE: tests/test_visualization.py function mock_agent (line 21) | def mock_agent(): function test_get_main_graph (line 42) | def test_get_main_graph(mock_agent): function test_get_all_nodes (line 76) | def test_get_all_nodes(mock_agent): function test_get_all_edges (line 105) | def test_get_all_edges(mock_agent): function test_draw_graph (line 117) | def test_draw_graph(mock_agent): function _assert_mcp_nodes (line 151) | def _assert_mcp_nodes(source: str): function _assert_mcp_edges (line 161) | def _assert_mcp_edges(source: str): function test_cycle_detection (line 169) | def test_cycle_detection(): function test_draw_graph_with_real_agent_no_handoffs (line 184) | def test_draw_graph_with_real_agent_no_handoffs(): function test_draw_graph_with_real_agent_with_handoffs (line 203) | def test_draw_graph_with_real_agent_with_handoffs(): FILE: tests/testing_processor.py class SpanProcessorForTests (line 12) | class SpanProcessorForTests(TracingProcessor): method __init__ (line 18) | def __init__(self) -> None: method on_trace_start (line 25) | def on_trace_start(self, trace: Trace) -> None: method on_trace_end (line 30) | def on_trace_end(self, trace: Trace) -> None: method on_span_start (line 35) | def on_span_start(self, span: Span[Any]) -> None: method on_span_end (line 40) | def on_span_end(self, span: Span[Any]) -> None: method get_ordered_spans (line 45) | def get_ordered_spans(self, including_empty: bool = False) -> list[Spa... method get_traces (line 50) | def get_traces(self, including_empty: bool = False) -> list[Trace]: method clear (line 55) | def clear(self) -> None: method shutdown (line 61) | def shutdown(self) -> None: method force_flush (line 64) | def force_flush(self) -> None: function fetch_ordered_spans (line 71) | def fetch_ordered_spans() -> list[Span[Any]]: function fetch_traces (line 75) | def fetch_traces() -> list[Trace]: function fetch_events (line 79) | def fetch_events() -> list[TestSpanProcessorEvent]: function assert_no_spans (line 83) | def assert_no_spans(): function assert_no_traces (line 89) | def assert_no_traces(): function fetch_normalized_spans (line 96) | def fetch_normalized_spans( FILE: tests/tracing/test_import_side_effects.py function _run_python (line 14) | def _run_python(script: str) -> dict[str, object]: function test_import_agents_has_no_tracing_side_effects (line 36) | def test_import_agents_has_no_tracing_side_effects() -> None: function test_get_trace_provider_lazily_initializes_defaults (line 70) | def test_get_trace_provider_lazily_initializes_defaults() -> None: function test_get_trace_provider_bootstraps_once (line 120) | def test_get_trace_provider_bootstraps_once() -> None: function test_set_trace_provider_skips_default_bootstrap (line 168) | def test_set_trace_provider_skips_default_bootstrap() -> None: FILE: tests/tracing/test_logger.py function test_tracing_logger_is_configured (line 4) | def test_tracing_logger_is_configured() -> None: FILE: tests/tracing/test_processor_api_key.py function test_processor_api_key (line 14) | async def test_processor_api_key(monkeypatch): function test_processor_api_key_from_env (line 26) | async def test_processor_api_key_from_env(monkeypatch): function test_exporter_uses_item_api_keys (line 37) | def test_exporter_uses_item_api_keys(monkeypatch): FILE: tests/tracing/test_set_api_key_fix.py function test_set_api_key_preserves_env_fallback (line 6) | def test_set_api_key_preserves_env_fallback(monkeypatch: pytest.MonkeyPa... FILE: tests/tracing/test_setup.py class _DummyProvider (line 15) | class _DummyProvider: method __init__ (line 16) | def __init__(self) -> None: method shutdown (line 19) | def shutdown(self) -> None: class _BootstrapProvider (line 23) | class _BootstrapProvider: method __init__ (line 24) | def __init__(self) -> None: method register_processor (line 28) | def register_processor(self, processor: Any) -> None: method shutdown (line 31) | def shutdown(self) -> None: function test_shutdown_global_trace_provider_calls_shutdown (line 35) | def test_shutdown_global_trace_provider_calls_shutdown(monkeypatch: pyte... function test_set_trace_provider_registers_shutdown_once (line 44) | def test_set_trace_provider_registers_shutdown_once(monkeypatch: pytest.... function test_get_trace_provider_returns_existing_provider (line 65) | def test_get_trace_provider_returns_existing_provider(monkeypatch: pytes... function test_get_trace_provider_bootstraps_provider_in_process (line 77) | def test_get_trace_provider_bootstraps_provider_in_process( FILE: tests/tracing/test_trace_context.py function _new_trace_id (line 19) | def _new_trace_id() -> str: function _clear_started_trace_ids (line 23) | def _clear_started_trace_ids() -> None: function _mark_trace_as_started (line 28) | def _mark_trace_as_started( function test_create_trace_for_run_reattaches_matching_started_trace (line 56) | def test_create_trace_for_run_reattaches_matching_started_trace() -> None: function test_create_trace_for_run_does_not_reattach_after_trace_state_reload (line 74) | def test_create_trace_for_run_does_not_reattach_after_trace_state_reload... function test_create_trace_for_run_reattaches_stripped_trace_key_with_matching_resume_key (line 93) | def test_create_trace_for_run_reattaches_stripped_trace_key_with_matchin... function test_create_trace_for_run_does_not_reattach_stripped_trace_key_with_mismatch (line 115) | def test_create_trace_for_run_does_not_reattach_stripped_trace_key_with_... function test_create_trace_for_run_does_not_reattach_when_settings_mismatch (line 135) | def test_create_trace_for_run_does_not_reattach_when_settings_mismatch()... function test_create_trace_for_run_respects_disabled_flag_for_resume (line 182) | def test_create_trace_for_run_respects_disabled_flag_for_resume() -> None: function test_create_trace_for_run_uses_existing_current_trace (line 199) | def test_create_trace_for_run_uses_existing_current_trace() -> None: function test_started_trace_id_cache_is_bounded (line 219) | def test_started_trace_id_cache_is_bounded(monkeypatch) -> None: FILE: tests/tracing/test_traces_impl.py class DummyProcessor (line 10) | class DummyProcessor(TracingProcessor): method __init__ (line 11) | def __init__(self) -> None: method on_trace_start (line 15) | def on_trace_start(self, trace: Trace) -> None: method on_trace_end (line 18) | def on_trace_end(self, trace: Trace) -> None: method on_span_start (line 21) | def on_span_start(self, span: Span[Any]) -> None: method on_span_end (line 24) | def on_span_end(self, span: Span[Any]) -> None: method shutdown (line 27) | def shutdown(self) -> None: method force_flush (line 30) | def force_flush(self) -> None: function test_no_op_trace_double_enter_logs_error (line 34) | def test_no_op_trace_double_enter_logs_error(caplog) -> None: function test_trace_impl_lifecycle_sets_scope (line 45) | def test_trace_impl_lifecycle_sets_scope() -> None: function test_trace_impl_double_start_and_finish_without_start (line 73) | def test_trace_impl_double_start_and_finish_without_start(caplog) -> None: function test_reattached_trace_restores_scope_without_reemitting_processor_events (line 104) | def test_reattached_trace_restores_scope_without_reemitting_processor_ev... FILE: tests/tracing/test_tracing_env_disable.py function test_env_read_on_first_use (line 5) | def test_env_read_on_first_use(monkeypatch): function test_env_cached_after_first_use (line 15) | def test_env_cached_after_first_use(monkeypatch): function test_manual_override_after_cache (line 30) | def test_manual_override_after_cache(monkeypatch): function test_manual_override_env_disable (line 45) | def test_manual_override_env_disable(monkeypatch): FILE: tests/utils/factories.py function make_tool_call (line 21) | def make_tool_call( function make_tool_approval_item (line 44) | def make_tool_approval_item( function make_message_output (line 78) | def make_message_output( function make_run_state (line 96) | def make_run_state( function roundtrip_state (line 119) | async def roundtrip_state( FILE: tests/utils/hitl.py class ApprovalScenario (line 22) | class ApprovalScenario: class PendingScenario (line 32) | class PendingScenario: function roundtrip_interruptions_via_run (line 40) | async def roundtrip_interruptions_via_run( function assert_roundtrip_tool_name (line 56) | async def assert_roundtrip_tool_name( function make_state_with_interruptions (line 74) | def make_state_with_interruptions( function assert_tool_output_roundtrip (line 93) | async def assert_tool_output_roundtrip( function run_and_resume (line 139) | async def run_and_resume( function approve_first_interruption (line 152) | def approve_first_interruption( function resume_after_first_approval (line 164) | async def resume_after_first_approval( function resume_streamed_after_first_approval (line 175) | async def resume_streamed_after_first_approval( function run_and_resume_after_approval (line 188) | async def run_and_resume_after_approval( function collect_tool_outputs (line 204) | def collect_tool_outputs( function consume_stream (line 219) | async def consume_stream(result: Any) -> None: function assert_single_approval_interruption (line 225) | def assert_single_approval_interruption( function require_approval (line 240) | async def require_approval( class RecordingEditor (line 247) | class RecordingEditor: method __init__ (line 250) | def __init__(self) -> None: method create_file (line 253) | def create_file(self, operation: Any) -> Any: method update_file (line 257) | def update_file(self, operation: Any) -> Any: method delete_file (line 261) | def delete_file(self, operation: Any) -> Any: function make_shell_call (line 266) | def make_shell_call( function make_apply_patch_call (line 286) | def make_apply_patch_call(call_id: str, diff: str = "-a\n+b\n") -> Respo... function make_apply_patch_dict (line 297) | def make_apply_patch_dict(call_id: str, diff: str = "-a\n+b\n") -> TResp... function make_function_tool_call (line 309) | def make_function_tool_call( function queue_function_call_and_text (line 333) | def queue_function_call_and_text( function run_and_resume_with_mutation (line 355) | async def run_and_resume_with_mutation( function assert_pending_resume (line 374) | async def assert_pending_resume( function make_mcp_raw_item (line 398) | def make_mcp_raw_item( function make_mcp_approval_item (line 427) | def make_mcp_approval_item( function make_context_wrapper (line 450) | def make_context_wrapper() -> RunContextWrapper[dict[str, Any]]: function make_agent (line 455) | def make_agent( function make_model_and_agent (line 465) | def make_model_and_agent( function reject_tool_call (line 476) | def reject_tool_call( function make_on_approval_callback (line 490) | def make_on_approval_callback( FILE: tests/utils/simple_session.py class SimpleListSession (line 10) | class SimpleListSession(Session): method __init__ (line 15) | def __init__( method get_items (line 27) | async def get_items(self, limit: int | None = None) -> list[TResponseI... method add_items (line 34) | async def add_items(self, items: list[TResponseInputItem]) -> None: method pop_item (line 37) | async def pop_item(self) -> TResponseInputItem | None: method clear_session (line 42) | async def clear_session(self) -> None: class CountingSession (line 46) | class CountingSession(SimpleListSession): method __init__ (line 49) | def __init__( method pop_item (line 57) | async def pop_item(self) -> TResponseInputItem | None: class IdStrippingSession (line 62) | class IdStrippingSession(CountingSession): method __init__ (line 65) | def __init__( method add_items (line 73) | async def add_items(self, items: list[TResponseInputItem]) -> None: FILE: tests/utils/test_json.py function test_to_dump_compatible (line 9) | def test_to_dump_compatible(): FILE: tests/utils/test_simple_session.py function test_simple_list_session_preserves_history_and_saved_items (line 12) | async def test_simple_list_session_preserves_history_and_saved_items() -... function test_counting_session_tracks_pop_calls (line 28) | async def test_counting_session_tracks_pop_calls() -> None: function test_id_stripping_session_removes_ids_on_add (line 41) | async def test_id_stripping_session_removes_ids_on_add() -> None: FILE: tests/voice/fake_models.py class FakeTTS (line 24) | class FakeTTS(TTSModel): method __init__ (line 27) | def __init__(self, strategy: Literal["default", "split_words"] = "defa... method model_name (line 31) | def model_name(self) -> str: method run (line 34) | async def run(self, text: str, settings: TTSModelSettings) -> AsyncIte... method verify_audio (line 41) | async def verify_audio(self, text: str, audio: bytes, dtype: npt.DType... method verify_audio_chunks (line 44) | async def verify_audio_chunks( class FakeSession (line 50) | class FakeSession(StreamedTranscriptionSession): method __init__ (line 53) | def __init__(self): method transcribe_turns (line 56) | async def transcribe_turns(self) -> AsyncIterator[str]: method close (line 60) | async def close(self) -> None: class FakeSTT (line 64) | class FakeSTT(STTModel): method __init__ (line 67) | def __init__(self, outputs: list[str] | None = None): method model_name (line 71) | def model_name(self) -> str: method transcribe (line 74) | async def transcribe(self, _: AudioInput, __: STTModelSettings, ___: b... method create_session (line 77) | async def create_session( class FakeWorkflow (line 89) | class FakeWorkflow(VoiceWorkflowBase): method __init__ (line 92) | def __init__(self, outputs: list[list[str]] | None = None): method add_output (line 95) | def add_output(self, output: list[str]) -> None: method add_multiple_outputs (line 98) | def add_multiple_outputs(self, outputs: list[list[str]]) -> None: method run (line 101) | async def run(self, _: str) -> AsyncIterator[str]: class FakeStreamedAudioInput (line 109) | class FakeStreamedAudioInput: method get (line 111) | async def get(cls, count: int) -> StreamedAudioInput: FILE: tests/voice/helpers.py function extract_events (line 7) | async def extract_events(result: StreamedAudioResult) -> tuple[list[str]... FILE: tests/voice/test_input.py function test_buffer_to_audio_file_int16 (line 15) | def test_buffer_to_audio_file_int16(): function test_buffer_to_audio_file_float32 (line 34) | def test_buffer_to_audio_file_float32(): function test_buffer_to_audio_file_invalid_dtype (line 53) | def test_buffer_to_audio_file_invalid_dtype(): class TestAudioInput (line 61) | class TestAudioInput: method test_audio_input_default_params (line 62) | def test_audio_input_default_params(self): method test_audio_input_custom_params (line 74) | def test_audio_input_custom_params(self): method test_audio_input_to_audio_file (line 86) | def test_audio_input_to_audio_file(self): class TestStreamedAudioInput (line 106) | class TestStreamedAudioInput: method test_streamed_audio_input (line 108) | async def test_streamed_audio_input(self): FILE: tests/voice/test_openai_stt.py function create_mock_websocket (line 25) | def create_mock_websocket(messages: list[str]) -> AsyncMock: function fake_time (line 38) | def fake_time(increment: int): function test_non_json_messages_should_crash (line 47) | async def test_non_json_messages_should_crash(): function test_session_connects_and_configures_successfully (line 76) | async def test_session_connects_and_configures_successfully(): function test_stream_audio_sends_correct_json (line 129) | async def test_stream_audio_sends_correct_json(): function test_transcription_event_puts_output_in_queue (line 187) | async def test_transcription_event_puts_output_in_queue(created, updated... function test_timeout_waiting_for_created_event (line 228) | async def test_timeout_waiting_for_created_event(monkeypatch): function test_session_error_event (line 273) | async def test_session_error_event(): function test_inactivity_timeout (line 309) | async def test_inactivity_timeout(): FILE: tests/voice/test_openai_tts.py class _FakeStreamResponse (line 14) | class _FakeStreamResponse: method __init__ (line 17) | def __init__(self, chunks: list[bytes]): method __aenter__ (line 20) | async def __aenter__(self) -> "_FakeStreamResponse": method __aexit__ (line 23) | async def __aexit__(self, exc_type, exc_val, exc_tb) -> None: method iter_bytes (line 26) | async def iter_bytes(self, chunk_size: int = 1024): function _make_fake_openai_client (line 31) | def _make_fake_openai_client(fake_create) -> SimpleNamespace: function test_openai_tts_default_voice_and_instructions (line 41) | async def test_openai_tts_default_voice_and_instructions() -> None: function test_openai_tts_custom_voice_and_instructions (line 71) | async def test_openai_tts_custom_voice_and_instructions() -> None: FILE: tests/voice/test_pipeline.py function test_streamed_audio_result_odd_length_buffer_int16 (line 29) | def test_streamed_audio_result_odd_length_buffer_int16() -> None: function test_streamed_audio_result_odd_length_buffer_float32 (line 42) | def test_streamed_audio_result_odd_length_buffer_float32() -> None: function test_streamed_audio_result_preserves_cross_chunk_sample_boundaries (line 57) | async def test_streamed_audio_result_preserves_cross_chunk_sample_bounda... function test_voicepipeline_run_single_turn (line 86) | async def test_voicepipeline_run_single_turn() -> None: function test_voicepipeline_streamed_audio_input (line 109) | async def test_voicepipeline_streamed_audio_input() -> None: function test_voicepipeline_run_single_turn_split_words (line 136) | async def test_voicepipeline_run_single_turn_split_words() -> None: function test_voicepipeline_run_multi_turn_split_words (line 162) | async def test_voicepipeline_run_multi_turn_split_words() -> None: function test_voicepipeline_float32 (line 195) | async def test_voicepipeline_float32() -> None: function test_voicepipeline_transform_data (line 218) | async def test_voicepipeline_transform_data() -> None: class _BlockingWorkflow (line 251) | class _BlockingWorkflow(FakeWorkflow): method __init__ (line 252) | def __init__(self, gate: asyncio.Event): method run (line 256) | async def run(self, _: str): class _OnStartYieldThenFailWorkflow (line 261) | class _OnStartYieldThenFailWorkflow(FakeWorkflow): method on_start (line 262) | async def on_start(self): function test_voicepipeline_trace_not_finished_before_single_turn_completes (line 268) | async def test_voicepipeline_trace_not_finished_before_single_turn_compl... function test_voicepipeline_trace_finishes_after_multi_turn_processing (line 292) | async def test_voicepipeline_trace_finishes_after_multi_turn_processing(... function test_voicepipeline_multi_turn_on_start_exception_does_not_abort (line 305) | async def test_voicepipeline_multi_turn_on_start_exception_does_not_abor... FILE: tests/voice/test_workflow.py class FakeStreamingModel (line 32) | class FakeStreamingModel(Model): method __init__ (line 33) | def __init__(self): method set_next_output (line 36) | def set_next_output(self, output: list[TResponseOutputItem]): method add_multiple_turn_outputs (line 39) | def add_multiple_turn_outputs(self, outputs: list[list[TResponseOutput... method get_next_output (line 42) | def get_next_output(self) -> list[TResponseOutputItem]: method get_response (line 47) | async def get_response( method stream_response (line 63) | async def stream_response( function test_single_agent_workflow (line 102) | async def test_single_agent_workflow(monkeypatch) -> None: