migrating-openai-agents-sdk-to-pydantic-ai

Installation
SKILL.md

Migrate OpenAI Agents SDK to Pydantic AI

Preserve caller-visible behavior, not OpenAI Agents SDK object shapes. Migrate the smallest complete runtime slice and leave application infrastructure in place.

Work from the running application

  1. Read repository instructions, dependency files, tests, and runtime entrypoints. Record the installed openai-agents, Pydantic AI, and Harness versions.
  2. Trace one representative Runner.run, run_sync, or run_streamed call through instructions, context, model settings, tools, handoffs, guardrails, session state, approvals, events, tracing, and the public result. Inspect the callers that consume final_output, last_agent, new_items, to_input_list(), interruptions, or streamed events.
  3. Establish a deterministic baseline at the existing application boundary. Record only behavior the active path uses.
  4. Classify the slice before designing it:
    • Ordinary agent: use one reusable Pydantic AI Agent with typed dependencies, tools, and outputs.
    • Manager with specialists: use explicit application orchestration, an agent tool, or Harness SubAgents according to who must own the final response.
    • Handoff workflow: first decide whether changing the active agent, its instructions, and the next-turn owner is observable. A nested agent tool is not a handoff.
    • Sandbox or coding agent: evaluate Harness Coder and its component capabilities. Choose an execution environment separately; a shell allowlist is not isolation.
    • Realtime or voice path: treat transport, interruption, audio, and live-session behavior as a separate migration slice using Pydantic AI realtime agents.
    • Product runtime: retain authentication, storage, queues, deployment, and service integrations unless explicitly placed in scope.
  5. Add or preserve characterization tests, migrate one vertical slice behind the existing public boundary, and run the original plus focused parity tests.

Read Concept Mapping for the source features you found. Read Verification and Cutover before changing persistence, handoffs, approval, streaming, security, or production traffic, and before declaring completion or removing openai-agents.

Installs
223
Repository
pydantic/skills
GitHub Stars
140
First Seen
Sep 19, 2026