Skip to content

Add cookbook: Handle backend failures inside an OpenAI Agents SDK tool #4

Add cookbook: Handle backend failures inside an OpenAI Agents SDK tool

Add cookbook: Handle backend failures inside an OpenAI Agents SDK tool #4

name: Validate tool-failure recovery
on:
pull_request:
paths:
- '.github/scripts/test_tool_failure_recovery.py'
- '.github/workflows/validate-tool-failure-recovery.yaml'
- 'examples/agents_sdk/testing_agent_recovery_from_tool_failures.ipynb'
- 'examples/agents_sdk/tool_failure_recovery/**'
permissions:
contents: read
jobs:
recovery-contracts:
name: Recovery contracts (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.12']
env:
PYTHONPATH: examples/agents_sdk
RUN_LIVE_AGENT: 'false'
EXPORT_AGENTS_TRACES: 'false'
steps:
- name: Checkout repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- name: Set up Python
uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4
with:
python-version: ${{ matrix.python-version }}
- name: Install the documented notebook dependencies
run: python -m pip install 'openai-agents>=0.18.2' pydantic pandas nbformat
- name: Compile every recovery implementation module
run: python -m compileall -q examples/agents_sdk/tool_failure_recovery
- name: Run offline recovery, security, and adversarial evaluations
run: python .github/scripts/test_tool_failure_recovery.py