feat(providers): add native OpenAI provider on Pydantic AI - #421
Open
hertznsk wants to merge 12 commits into
Open
feat(providers): add native OpenAI provider on Pydantic AI#421hertznsk wants to merge 12 commits into
hertznsk wants to merge 12 commits into
Conversation
Drive the real OpenAIChatModel + AsyncOpenAI through run_agent_pipeline with httpx.MockTransport. Covers success usage mapping, 400 non-retryable (one request), and 429 retryable then success (two requests).
…gration Add todo-11 test coverage for the openai provider: - factory: string + structured construction, YAML api_key precedence over env, missing API key raises ValidationError naming OPENAI_API_KEY - validate-level: runtime/provider: openai, per-agent provider: openai, reasoning.effort: max static rejection, tools allowlist, mcp_servers, skills - retry: existing openai.RateLimitError/BadRequestError tests already cover the requirement; no new code needed - SecretStr redaction for openai ProviderSettings - temperature: schema-level 1.5 valid / 2.5 invalid, validator-level mixed default=openai + per-agent/for_each inline claude override fails naming temperature and claude Also exclude openai-named example files from the copilot backward-compatibility helper so the existing copilot-only assertion does not trip over examples/openai-compatible.yaml. Verification: uv run pytest tests/test_config tests/test_providers/test_factory.py tests/test_providers/test_pydantic_ai_retry.py -x (1253 passed, 9 skipped); make check clean.
… OPENAI_BASE_URL env fallback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a native OpenAI-compatible provider backed by the shared Pydantic AI runtime introduced for Claude in #355. It also extracts the common Pydantic AI execution pipeline so the Claude and OpenAI adapters share Conductor-owned retry, interrupt, event, MCP, structured-output, usage, and partial-output behavior.
Together with the already merged #355, this closes #315 by demonstrating and shipping Pydantic AI as the shared inner runtime for direct Anthropic and OpenAI providers.
What changed
openaiprovider using Pydantic AI and the OpenAI Chat Completions API;OPENAI_API_KEY/OPENAI_BASE_URL;Practical validation
Builds from this branch have been used for an extended period on real working workflows. No shortcomings were identified during that use beyond the separately reported MCP 2.0 compatibility issue in #419. The issue is not specific to this provider implementation and is intentionally tracked separately.
Verification
origin/main;origin/main;make check;make test: 6295 passed, 39 skipped, 8 deselected;conductor --help;examples/openai-compatible.yamland a missing workflow path.Closes #315.
Related: #355, #419.