Repository navigation
PC-4992: move uipath-agent-framework to agent-framework-openai split - #381
Draft
al3xanndru wants to merge 1 commit into
Draft
al3xanndru wants to merge 1 commit into
al3xanndru wants to merge 1 commit into
Conversation
agent-framework-core 1.0.0rc6 moved the OpenAI clients into agent-framework-openai and renamed model_id to model; OpenAIChatClient became the Responses API client and Chat Completions moved to OpenAIChatCompletionClient. The package still passed model_id and an unbounded core floor, so a fresh install failed at import. - UiPathOpenAIChatClient subclasses OpenAIChatCompletionClient (the gateway flavor it calls) and passes model=; the Anthropic client and the scaffold template pass model= too; the graph schema reads .model. - Depend on agent-framework-openai>=1.0.0 and core>=1.0.0. - Cap agent-framework-orchestrations below 1.0.0b260409, which made handoff require per-service-call history persistence and (b260429) changed what orchestrations yield; the runtime is not adapted to either yet. - Cap anthropic below 1.0.0: anthropic 1.x requires httpx2 clients and rejects the gateway's httpx transport. - Test stream mocks support async with, like openai.AsyncStream. - Bump to 0.1.2 and floor the samples at it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch has not been deployed
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.



Problem
PC-4992:
uipath-agent-frameworkcan't be installed into a working environment from a clean checkout. The package and its samples declareagent-framework-core>=1.0.0rc1with no upper bound, so a freshuv syncresolves today's core. Every agent then fails at import:The package agent-framework-openai is required to use OpenAIChatClient(the package doesn't depend on it).TypeError: OpenAIChatClient.__init__() got an unexpected keyword argument 'model_id'(chat/openai.py).Our CI never saw this. The package's
[tool.uv] exclude-newer = "2 days"only affects lock resolution, anduv.lockwas still pinned at core1.0.0rc1.Root cause
At
agent-framework-core1.0.0rc6 (2026-03-30) Microsoft made three changes:agent-framework-openaipackage (agent_framework.openaiis now a lazy re-export stub);model_idtomodel(the attribute is now.model).agent-framework-anthropicfollowed at 1.0.0b260402;OpenAIChatClientthe Responses API client and moved Chat Completions toOpenAIChatCompletionClient.The third change matters beyond the rename.
UiPathOpenAIChatClientcalls the LLM Gateway with ApiFlavorOpenAiChatCompletions, and its transport rewrites only/chat/completionsURLs. Renaming the kwarg alone would send/responsesrequests straight toapi.openai.comwith a UiPath token.Change
chat/openai.py:UiPathOpenAIChatClientnow subclassesOpenAIChatCompletionClientand passesmodel=. Atype: ignore[arg-type]covers openai>=3: it is typed forhttpx2but still accepts thehttpxclient the gateway transport builds.chat/anthropic.py: passesmodel=toAnthropicClient.runtime/schema.py:_get_model_namereadsclient.model(graph node model names)._cli/_templates/main.py.template(uipath new):OpenAIChatCompletionClient(model=...).pyproject.toml:agent-framework-core>=1.0.0, plus a newagent-framework-openai>=1.0.0dependency;agent-framework-orchestrations>=1.0.0b260402, <1.0.0b260409(see below);[anthropic]extra:anthropic>=0.43.0, <1.0.0,agent-framework-anthropic>=1.0.0b260402;agent_framework_openai.*;0.1.2.samples/*/pyproject.toml:uipath-agent-framework>=0.1.2,agent-framework-core>=1.0.0,agent-framework-orchestrations>=1.0.0b260402.uv.lockre-locked: core 1.23.0, openai 1.17.0, orchestrations 1.0.0b260402, anthropic 0.116.0, agent-framework-anthropic 1.0.0b261002, openai SDK 3.40.0.Why two upper bounds
Resolving everything to the latest release fixes the rename but breaks other parts of this package. I bisected each break with the test suite:
agent-framework-orchestrations1.0.0b260409+ requiresrequire_per_service_call_history_persistence=Trueon every handoff participant. With that flag set,test_hitl_e2e.py::test_multi_turn_after_hitl_resumefails: the session we persist after a HITL resume keeps ahandoff_to_billing_agentfunction_call with no result, and OpenAI rejects the next turn on that.agent-framework-orchestrations1.0.0b260429 also changed what orchestrations yield:AgentResponse/AgentResponseUpdatein place oflist[Message]. The sequential breakpoint e2e test then loses the last agent's message events.anthropic1.0.0+ (2026-08-20) is built onhttpx2and raisesTypeErroron ourhttpx.AsyncClient. Without the cap, the extra resolvesagent-framework-anthropic1.0.0b261022 (which needs anthropic>=1.11) andUiPathAnthropicClient()fails.Adapting the runtime to these is a separate change. The caps keep core and openai on their latest releases and hold back only the packages the runtime isn't ready for.
Tests
Added:
test_chat_clients.py::test_openai_client_uses_chat_completions_client_with_model: the client is anOpenAIChatCompletionClient,.modelis set, and the graph schema reports it.test_chat_clients.py::test_openai_client_sends_chat_completion_to_gateway: a realget_responsegoes through the openai SDK and our transport (only the socket send is faked). It asserts the gateway URL, theOpenAiChatCompletionsflavor header and themodelfield. With the base class switched back toOpenAIChatClient, this test and the one above fail.test_chat_clients.py::test_anthropic_client_passes_model.test_cli_new.py::test_scaffolded_main_builds_its_agent: runs the scaffoldedmain.pyagainst the installed agent-framework, so drift in the template's constructor fails a build.Updated:
OpenAIChatCompletionClient(model=...).test_graph.pymocks.model.conftest.py's streaming factories return aMockAsyncStream, which supports bothasync forandasync withlikeopenai.AsyncStream. The new client opens streams withasync with.Run, in a venv synced from the new
uv.lock(Python 3.11):pytest(CI's command, with coverage): 169 passed, coverage 86.00%.ruff check .passes,ruff format --check .passes, andmypy --config-file pyproject.toml .reports no issues in 35 files.Risks / open questions
agent-framework-orchestrationsstays old until the runtime handles handoff history persistence and the new output shape. That needs a follow-up ticket.uipath-agent-framework>=0.1.2in the samples resolves only once 0.1.2 is published, which happens when this merges.uipath initwritingrequires-pythoninside[tool.uv]. It isn't in this package:cli_new.generate_pyprojectwrites it under[project]. It belongs to theuipathCLI's init.PC-4992: …). This repo's commitlint expectsfix(agent-framework): … [PC-4992], so rename the PR before merge.Drafted by the wabbit-dri draft-fixes loop for PC-4992 (draft #1), for a human to review: not ready to merge as is.
🤖 Generated with Claude Code